Whenever I try to calibrate the inertial sensor, it works fine. Then, when the code starts reading the gyro, I notice it will constantly tick up until it reaches a point. That angle is the angle it is from a certain point, that always being the same every time I restart the code / bot
My inertial sensor is called Gyro
How have you mounted the inertial sensor ? if it is at an angle when you calibrate it will slowly drift to match the angle it is mounted at. What does the dashboard show ? does it do the same thing as your code ?
It gives me tiny readings which led to the robot spinning before reaching a set heading.
Is there a proper way of reading from the new V5 Inertial sensor?
It is very good that the new IMU gives students easy to use heading and rotation values (by handling internally challenging geometry related to qurternions).
However, it would be great if there was an option to return timestamped raw measurements from individual gyro and accelerometer sensors.
If measurements from inertial sensor are used in conjunction with other sensors (i.e. encoders) by some sort of the filtering algorithm to achieve sensor fusion, then it is better to handle everything in the higher level algorithm, instead of passing partially pre-processed filtered/smoothed data to the upstream filter.
The raw measurements don’t have to come at high data rate. As long as they are timestamped this should work well with filters.
I’ll see if we can add that in a future vexos/sdk release, we already have timestamp on incoming messages, should not be too hard to add but there will still be an some error between when the data was actually available to read inside the IMU and when it arrives at the V5 brain.