Gravity from the IMU (sensor_msg/Imu)

Issue #27 resolved
Dimitrios Kanoulas
created an issue

Hi Matt --

in an issue we had the discussion of having the IMU data representing in ROS sensor_msg/Imu, but there was some info missing (orientation?). Can we still compute somehow the gravity vector at each frame?

Thanks a lot!

Comments (4)

  1. Matt Alvarado

    Hi Dimitrios,

    Your are correct, as I noted in issue #19 the sensor_msgs::Imu message does not have the orientation quaternion populated. In theory you could compute a orientation directly from the gravity vector, but that would only work well for roll and pitch when the sensor was oriented parallel to the ground. This is because the components of the gravity vector in the plane corresponding to yaw are essentially 0. The best solution would be to combine the accelerometer and gyroscope measurements using either a complementary filter or Kalman filter. This is something we have in our planned improvements to the ROS driver. If you are going to attempt something like this yourself I would advise setting the accelerometer and gyroscope to the highest resolution settings (i.e “2g_1mg_per_lsb”, and “250dps_9mdps_per_lsb”) so you get the most accurate results.

    Thanks, Matt Alvarado Engineer Carnegie Robotics

  2. Log in to comment