Comments (21)
from opencat.
from opencat.
You can delete the macro for DEVELOPER, and use the code blocks inside to print out the angles. The format is yaw, pitch, roll.
#ifdef FIX_OVERFLOW
for (byte g = 1; g < 3; g++) {
yprLag[lag][g] = ypr[g];
ypr[g] = yprLag[(lag - 1 + HISTORY) % HISTORY][g] ;
}
lag = (lag + 1) % HISTORY;
#endif
#ifdef DEVELOPER
PT(ypr[0]);
PTF("\t");
PT(ypr[1]);
PTF("\t");
PTL(ypr[2]);
#endif
}
from opencat.
@borntoleave and what about accelerometer data? Seems like it's not used in the code.
from opencat.
from opencat.
@borntoleave great, thank you!
from opencat.
@borntoleave to provide sufficient info to nav package I need to collect linear acceleration, angular velocity and orientation from IMU. Just want to confirm this info can be collected from Bittle. I see several examples with accel, but not really sure what’s the difference between common accel and world accel? I also see quaternion structure in code. Is it sufficient to determine orientation? Or I need to apply additional formulas against pitch, roll and yaw to compute it? And for angular velocity I guess I can use roll, pitch and yaw, right?
from opencat.
from opencat.
@borntoleave I want to try another IMU (10 DOF). However, i2c port on RPi is occupied by the NyBoard. Can I access NyBoard's i2C from RPi if I solder the sensor's pins to the available slots above the i2c groove socket?
from opencat.
You can connect external sensors to its port.
@borntoleave do you mean RPi port or those i2C port linked with a groove?
RPi port is already occupied with a hat. I just need to access an external i2C sensor via RPi.
Are you saying it's possible only if RPi switch is on?
from opencat.
As long as the I2C switch is not dialed at RPi, the I2C port of RPi is not really connected to the board's I2C network.
The switch can disconnect the I2C network from 328P and connect them to the RPi.
from opencat.
@borntoleave but even if it's not connected to NyBoard's i2c network, the RPi pins would still be occupied if we use Zero or A+ board as a hat. So we can't physically connect sensors directly to Pi's i2c. And if we switch the I2C network from 328P, we won't be able to control servos via OpenCat code anymore, as you have mentioned. So what would be your recommendation in this case? What's the best option of connecting i2c sensor to Pi mounted on top of 328P w/o loosing the main Bittle's functionality?
from opencat.
from opencat.
But SCL and SDA pins are occupied by NyBoard (2x5 socket) when Pi is used as a hat. And 2 extra SCL/SDA pins on Pi are intended to eeprom usage only. They won't work for common use cases. So how can I wire SDA/SCL between Pi (connected to NyBoard) and a sensor then?
from opencat.
SCL and SDA pins are occupied by NyBoard (2x5 socket) when Pi is used as a hat.
Yes. But they are not really connected to anything devices. So you can solder two wires to the back of the pins on the Pi.
from opencat.
@borntoleave well, I did it, but here's a new issue. When I run i2cdetect -y 1
, it gives me the following picture:
By default, if I don't connect RPi to NyBoard, I have only a single 0x68 address occupied by my sensor. But when RPi is used as a hat, I see this weird matrix. 0x68 address doesn't work anymore (conflict?). How can I guess which one is mine now w/o brute-forcing each address? I'm also wondering why all those addresses are occupied? Is NyBoard really bind them for something?
from opencat.
Ok, from the above picture I see that 0x68 address is used by MPU6050. So that's a problem. 2 sensors have the same address. Any thoughts on how to resolve this conflict?
from opencat.
Made it work via software i2c bus. Details here: https://forums.raspberrypi.com/viewtopic.php?p=1968858#p1967861
@borntoleave I see you committed accel data printing feature. Have you also tried to output raw gyro data? I played with it a bit based on the provided samples but always got constant values like [0;0;1]. Also, wondering why there are int values and not float like for rpy?
from opencat.
Thanks for the note on I2C.
The IMU code is mostly from i2cdevlib. The raw gyro data is VectorInt16 gy and you may print it out similar to the example code.
The accel data is read from the register and is in integer type. You may divide some factors to get real accelerations in float.
I validated the updated code again on my board. The 'v' token prints the MPU data once and the 'V' token prints the MPU data for every loop. I got the readings changed with my movements.
from opencat.
@borntoleave what lib/tool do you use for plotting real-time data?
Regarding gy
example: yes, I used it before, but as I've mentioned, I've been always getting 0, 0, 1
values. So that's weird.
from opencat.
The 2.0 branch has a switch case for printing gyros. token -v and -V
from opencat.
Related Issues (20)
- Example code for Task creation HOT 1
- Running the Firmware Uploader on a Raspberry PI does not work HOT 1
- Changing the speed of "Walk" HOT 1
- MU Camera using arduino IDE error HOT 2
- Can I make a deb package for OpenCat UI app? HOT 1
- wrong-path-for-interpreter /opt/anaconda3/envs/petoi/bin/python3
- very-long-line-length-in-source-file > 512 HOT 3
- Unable to upload code after bluetooth connection failed HOT 10
- Wrong
- compatible with "azure openai api"
- Adding to siri, but not work in siri. HOT 2
- Can you configure a standard Python package format for setup.py?
- opencat app bug : Team: 网络连接已中断。 HOT 2
- After uploading the code of OpenCat.ino Robot will not accept any new code. HOT 3
- Sketch too big for NyBoard V0_2 HOT 2
- Petoi Bluetooth Adapter not compatible with NyBoard_V02 ? HOT 2
- pyUI/commonVar.py uses wrong paths for Linux HOT 2
- Is there a way to disable the beep sound? HOT 1
- Getting data from IMU data (such as YRP and Accelerators) on the main source HOT 9
- Add support for Mistral HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencat.