Closed subodh-malgonde closed 6 years ago
I observed values from the serial monitor, which shows data directly from Razor_AHRS, I get this coordinate system:
So it looks like Razor_AHRS has the same coordinate system as REP-103, which is:
So imu_node.py
does not need to modify anything. Am I right @lebarsfa?
This is a bit unexpected... The conventions should be the one described here : https://github.com/Razor-AHRS/razor-9dof-ahrs/issues/57#issuecomment-378585065 ... See also https://github.com/Razor-AHRS/razor-9dof-ahrs/wiki/tutorial (around the middle of the page, the screenshot of Razor_AHRS_test.pde). With the serial monitor, do you get yaw=0 when towards the North, yaw=90 towards the East, yaw=-90 (or 270) towards the West? If it is not the case, that means that you probably use a different/modified firmware inside the Razor (also, do you use the default options?), or maybe your Razor is different...
For the accelerations, note this : https://github.com/KristofRobot/razor_imu_9dof/blob/fb23b76e4727cd294a84c453506ed6d5eeb7562e/nodes/imu_node.py#L240 This probably explains why the sign of the accelerations is the contrary.
Thank you so much for getting back!
With the serial monitor, do you get yaw=0 when towards the North, yaw=90 towards the East, yaw=-90 (or 270) towards the West?
I get yaw = 90 towards east. However when I orient it to north, it does not go to 0. Also for west it does not go to -90. I think my magnetometer is faulty. See this GIF, as I rotate the Razor around the Z axis, the visualitzation does not follow the actual movement.
I used Razor_AHRS_test.pde for the above sketch. For rotations around X & Y axes, it follows (this part is not in the GIF).
If it is not the case, that means that you probably use a different/modified firmware inside the Razor (also, do you use the default options?), or maybe your Razor is different...
I have not changed anything from Razor_AHRS.ino
apart from HW__VERSION_CODE
(14001). Is that what you mean by default options?
I think the firmware inside the Razor is different, maybe Sparkfun changed it.
UPDATE: The incorrect yaw on the horizontal plane was due to non-calibrated sensors. This resulted in the IMU firmware applying incorrect drift correction for the gyroscope and magnetometer. Source: Troubleshooting: Unstable yaw (aka heading aka azimuth) readings / Yaw drift. After calibrating the sensors, my yaw
values are correct.
~Going back to the original problem of wrong co-ordinate system, I applied these corrections to the code in imu_node.py
to fix it~:
UPDATE 2: It turns out IMUs measure acceleration opposite of gravitational acceleration in the static state. Please see these posts:
So the razor_imu_9dof
package provides data in the right format. No changes are required to the code.
@lebarsfa Your suspicion was right about the negated accelerations.
I am using Razor 9DOF IMU (hardware version SEN14001). The code in imu_node.py converts the readings from Razor AHRS firmware to ROS standards (REP 103). However when I test the orientations by measuring the acceleration due to gravity (9.8 m/s^2) on each axis by echoing messsages from the topic
imu
(I am runningroslaunch razor_imu_9dof razor-pub.launch
), I get very different orientations. See these Pictures:This means the axis are oriented this way:
This is the left handed coordinate system, whereas ROS uses right handed coordinate system.
Am I missing something? I ask because according to PR https://github.com/KristofRobot/razor_imu_9dof/pull/34 this repo supposed to work with SEN14001?