ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How is Rviz able to get the /odom and /base_link transform from playing rosbag data?

asked 2020-11-14 11:06:00 -0500

I have a rosbag file named husky_navigation.bag. The output of rosbag info husky_navigation.bag produces the following information-

path:        husky_navigation.bag
version:     2.0
duration:    60.0s
start:       Feb 08 2018 22:04:11.00 (1518107651.00)
end:         Feb 08 2018 22:05:10.00 (1518107711.00)
size:        294.7 MB
messages:    3563
compression: none [301/301 chunks]
types:       nav_msgs/Odometry       [cd5e73d190d741a2f92e81eda573aca7]
             sensor_msgs/Imu         [6a62c6daae103f4ff57a132d6f95cec2]
             sensor_msgs/JointState  [3066dcd76a6cfaef579bd0f34173e9fd]
             sensor_msgs/PointCloud2 [1158d486dd51d683ce2f1be655c3c181]
topics:      /husky_velocity_controller/odom       600 msgs    : nav_msgs/Odometry      
             /imu/data                            1190 msgs    : sensor_msgs/Imu        
             /joint_states                        1172 msgs    : sensor_msgs/JointState 
             /velodyne/assembled_cloud_filtered    601 msgs    : sensor_msgs/PointCloud2

I am also running an ekf_localization_node provided in the robot_localization package.

When I add 'TF' in Rviz, I see two frames - 'odom' and 'base_link'.

How is Rviz able to get these these two frames even when I haven't yet launched the robot_state_publisher node? I read the definition of the 'robot_state_publisher' and it says this - 'This package allows you to publish the state of a robot to tf.'

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-11-14 11:16:12 -0500

I think you already answered the question yourself. It's because you are running a robot_localization node. That node takes odom and imu topics, in your case probably /husky_velocity_controller/odom and /imu/data and computes a transform from the odom frame to the base_link frame, which it then publishes on the TF tree. The best way to see this is to inspect the TF tree (either using view_frames or on the terminal using ros-blessed). You will see who (which node) is publishing the odom->base_link transform, and it will be ekf_localization_node if what I'm saying is correct.

edit flag offensive delete link more


Is there a way to compute the transform from the /odom frame to the base_link frame without using the robot_localization package? I am trying to view the base_link axes' rotation and translation as I replay a rosbag file in RViz but the base_link axes disappear after a few seconds, leaving only the map axes and green trajectory path.

hunterlineage1 gravatar image hunterlineage1  ( 2022-08-10 11:12:38 -0500 )edit

Question Tools

1 follower


Asked: 2020-11-14 11:06:00 -0500

Seen: 509 times

Last updated: Nov 14 '20