odom_frame_id and odom_topic in rtabmap.launch

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

odom_frame_id and odom_topic in rtabmap.launch

dave-ms
Hello all,

In the default launch file there is odom_frame_id and odom_topic. According to the docs odom_frame_id takes precedence if it's set.

Within the various odometry nodes odom_frame_id is set to vo_frame_id, which in turn is set to odom_topic which defaults to odom. And then in the rtabmap node it's set to odom_frame_id.

A couple of questions:

* Why is vo_frame_id set to odom_topic? (ie, setting a frame_id variable to a topic name, seems strange)
* Why is odom_frame_id sometimes left alone and sometimes set to vo_frame_id?

Thanks, Dave.
Reply | Threaded
Open this post in threaded view
|

Re: odom_frame_id and odom_topic in rtabmap.launch

matlabbe
Administrator
Hi,

It is only for convenience with rtabmap.launch (it is not ros-related standard). If you set odom_topic to rtabmap_odom, then its TF will be rtabmap_odom. If you don't want the TF frame to be modified when changing the default odom topic name, then set explicitly vo_frame_id back to "odom".

rtabmap.launch is a convenient launch file to start visual odometry and rtabmap nodes at the same time. Here some cases:

1) default: visual odometry publishes odometry topic under odom_topic name and TF frame under vo_frame_id name, which is "odom" by default. With odom_frame_id="", rtabmap will subscribe to visual odometry topic to get the pose covariance.

2) we want to use wheel odometry as guess for visual odometry: we set odom_guess_frame_id (which may be "odom" from the wheel odometry), then we set odom_topic to "vo_odom" (thus vo_frame_id="vo_odom") to not clash with already published "odom" frame, then rtamap will subscribe to "vo_odom" topic. We just changed two arguments: guess_frame_id and odom_topic.

3) we want to use external odometry only: we set visual_odometry to false, and odom_topic to our external odometry topic.

4) we want to use external odometry only but its covariance is not set: we set visual_odometry to false, and odom_frame_id to our odometry TF, then set odom_tf_angular_variance and odom_tf_linear_variance to some fixed covariance. rtabmap will get odometry from TF and sets the corresponding covariance.

5) we want to use robot_localization to do odometry fusion from wheel odometry, imu and visual odometry: set publish_tf_odom to false, set odom_topic to "vo_odom" to not publish on same topic name than wheel odometry, make sure wheel odometry is not publishing TF too, then connect both odom topics to EKF localization node. Set odom_frame_id so that rtabmap subscribes to TF published from ekf localization (while setting odom_tf_angular_variance and odom_tf_linear_variance).

When using odometry from rtabmap.launch, I generally not set odom_frame_id unless there is some sensor fusion like above. Note also that when you have a complicated setup, it is preferred to launch the nodes individually (like in those examples) than using rtabmap.launch.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: odom_frame_id and odom_topic in rtabmap.launch

dave-ms
Thanks Mathieu, that helps a lot.

If we want to use ICP odometry (from a 3d lidar) can I just replace "visual_odometry" with "icp_odometry" in your five scenarios and have that be broadly correct?

Dave.
Reply | Threaded
Open this post in threaded view
|

Re: odom_frame_id and odom_topic in rtabmap.launch

matlabbe
Administrator
Hi, mostly yes. I have an example with Husky here that has many possibilities (11!!!). See comments in the header of the launch file to know how to start the simulator. My plan was to make the corresponding tutorials in Setup RTAB-Map on your Robot! page, but didn't have time... :(

I have also examples for ouster and velodyne.

cheers,
Mathieu