How to transform Odometry

asked 2021-05-20 05:59:46 -0500

Guglie gravatar image

updated 2021-05-20 06:06:46 -0500

I have an odometry source (VIO) which has a (static) transform from the base_link of the robot.

How can I properly transform the Odometry message to the base_link frame?
For position and orientation it's almost trivial with tf, but for Twist?
What about the covariances?

I know that I can set base_link to the sensor position as I've seen commonly done but I want to compare the odometry to other sensors such as IMU.

edit retag flag offensive close merge delete

Comments

Just modify the code according to your needs: Publishing Odometry Information over ROS (python)

Orhan gravatar image Orhan  ( 2021-05-21 17:34:05 -0500 )edit

Thank you @Orhan but I just want to transform the twist component in another frame. I can use tf library to transform the Pose, but not the twist

Guglie gravatar image Guglie  ( 2021-06-07 10:32:35 -0500 )edit

You can always create a topic like /my_odom with type nav_msgs/Odometry and publish the odometry data there for watching the twist part and covariance. For imu, just like the odometry frame, start your node with IMU's frame at map frame location(just zero distance), and then and publish your IMU measurement changes over time to tf if you don't want to use ready-to-use imu drivers that just use your IMU's frame in your URDF, with robot_state_publisher.

Orhan gravatar image Orhan  ( 2021-06-08 10:32:44 -0500 )edit