ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Based on the measurements you provided, it sounds like the imu reports values in North-East-Down (NED) - max x is north, max y is east, that leaves z to be down with a right handed coordinate system.
You can use the HMC5883's datasheet to verify by looking for the "dot" on the top of the chip (assuming no firmware changes that would change the chips operation from the default):
Your measurements suggest the "dot" would be pointing down, and that Z would be down.
X axis forward, Y left and Z up
^ Would be a Left handed coordinate system, so I have a hunch this is incorrect
Now you mentioned REP103 which specifies the ENU frame. That means you would probably have to transform your imu data from NED to ENU somewhere in the data pipeline to match ROS's expectations for whatever localization algorithm you're using.
If all you want is heading and you are only reading x and y values, then you can rearrange the x and y components depending on your data's reference frame:
heading_enu = atan2(mag_y_enu, mag_x_enu) = atan2(mag_x_ned, mag_y_ned)
2 | No.2 Revision |
Based on the measurements you provided, it sounds like the imu reports values in North-East-Down (NED) North-West-Up (NWU) - max x is north, max y is east, that leaves when the robot points east (so the y axis is pointing north at -90 deg, or west at 0 deg), and as confirmed by your positive measurements on the southern hemisphere, z to be down with a right handed coordinate system. is up.
You can use the HMC5883's datasheet to verify by looking for the "dot" on the top of the chip (assuming no firmware changes that would change the chips operation from the default):
Your measurements suggest the "dot" would
It should be pointing down, and that Z would be down.
X axis forward, Y left and Z up
^ Would be a Left handed coordinate system, so I have a hunch this is incorrecton the bottom right corner of your robot (as you confirmed in the comments below).
Now you mentioned REP103 which specifies the ENU frame. That means you would probably have to transform your imu data from NED to ENU NWU to ENU somewhere in the data pipeline to match ROS's expectations for whatever localization algorithm you're using. This is an easy enough transformation:
x_enu <=> -y_nwu
y_enu <=> x_nwu
z_enu <=> z_nwu
Or if you are fond of rotation matrices,
If all you want is heading and you are only reading x and y values, then you can rearrange the x and y components depending on your data's reference frame:
heading_enu = atan2(mag_y_enu, mag_x_enu) =
atan2(mag_x_ned, mag_y_ned)
3 | No.3 Revision |
Based on the measurements you provided, it sounds like the imu reports values in North-West-Up (NWU) - max x is north, max y is when the robot points east (so the y axis is pointing north at -90 deg, or west at 0 deg), and as confirmed by your positive measurements on the southern hemisphere, z is up.
You can use the HMC5883's datasheet to verify by looking for the "dot" on the top of the chip (assuming no firmware changes that would change the chips operation from the default): It should be on the bottom right corner of your robot (as you confirmed in the comments below).
Now you mentioned REP103 which specifies the ENU frame. That means you would probably have to transform your imu data from NWU to ENU somewhere in the data pipeline to match ROS's expectations for whatever localization algorithm you're using. This is an easy enough transformation:
x_enu <=> -y_nwu
y_enu <=> x_nwu
z_enu <=> z_nwu
Or if you are fond of rotation matrices,
If all you want is heading and you are only reading x and y values, then you can rearrange the x and y components depending on your data's reference frame:
heading_enu = atan2(mag_y_enu, mag_x_enu) = atan2(mag_x_nwu, -mag_y_nwu)