Ask Your Question

Adding roll and pitch from offset IMU to base frame

asked 2015-08-20 15:34:27 -0500

pwong gravatar image

The ground usually isn't completely flat, so what I like to do is add a roll and pitch from an IMU to correct the laser scan frame before using it for gmapping and amcl.

I was planning to use to publish base_frame with the roll and pitched added, and add the laser frame to base_frame.

The IMU on the robot is offset by a translation and rotation from the actual base link. hector_imu_attitude_to_tf just takes roll and pitch from sensor_msgs/Imu published, and publishes the TF. But what I need to do, is find roll and pitch of base frame from my IMU, and not just take the roll and pitch directly from the IMU itself.

Is there a way to find roll/pitch of base_frame from using TF as it is? Or is it something which requires calculation on my end and republish the IMU message before sending it into hector_imu_attitude_tf?

The system being run is ROS indigo on ubuntu 14.04. Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-09 10:26:42 -0500

pwong gravatar image

I was over thinking it. As long as the IMU was mounted on the robot rigidly, the roll and pitch doesn't need additional transforms/conversions done to the values themselves.

I ended up not using the hector_imu_attitude_to_tf node. My constraint was having an IMU be mounted with a rotation of -3.14 radians(in the x direction). I subscribed to the imu topic(add the offset), then included the roll/pitch to the base_link transform and odometry.

I don't think the hector_imu_attitude_to_tf_node allows for an imu which is mounted in a different orientation as the base_link.

edit flag offensive delete link more


Hi, I have the same problem. Can you help me with my setup. Do I need to make separate tf for the roll and pitch or just fixing the tf for the /imu will suffice everything. I need to figure out the roll and pitch of the platform before doing anything with the laser scans. Thanks.

AlexR gravatar image AlexR  ( 2016-10-05 03:22:14 -0500 )edit

Alex, I'm not sure how you are using your /imu frame, so I cant really answer your first question. In my application, my /base_link is connected to my /odometry frame, so all I had to do was put the roll/pitch straight into my /odometry frame, and my laser scan was fine.

pwong gravatar image pwong  ( 2016-10-13 00:22:05 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-08-20 15:34:27 -0500

Seen: 908 times

Last updated: Oct 09 '15