How to obtain corrected Odometry to display in rviz?

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

How to obtain corrected Odometry to display in rviz?

ArkadiuszN
I am using ZED camera with rtabmap_ros and try to utilize loop closure to correct odometry that the camera is generating.
I know that I can plot MapGraph topic in rviz but is there a way to transform \zed\odom topic so it looks like the odom displayed in the RTAB-Map GUI?

If I am correct the rtabmap reposts the /map -> /odom tf but my example rosbag's odometry looks exactly the same with and without rtabmap turned on. /rtabmap/mapGraph looks good though (corrected).

Reply | Threaded
Open this post in threaded view
|

Re: How to obtain corrected Odometry to display in rviz?

matlabbe
Administrator
If you show TF frames in RVIZ and you set the fixed frame to /map in RVIZ's global options, you will see the /base_link frame (i.e., the base frame on the robot/camera) moving along /map frame (odom corrected) instead of only /odom frame.
Reply | Threaded
Open this post in threaded view
|

Re: How to obtain corrected Odometry to display in rviz?

ArkadiuszN
This post was updated on .
I think the problem is that zed-ros-wrapper also publishes tf /odom->/map. These are frames without rtabmap:



I am not able to do what you wrote, I have also tried to change /map in zed-ros-wrapper to different name but it also did not allow me to obtain ODOM i corrected frame...

Edit: I have set publish_tf to false in zed wrapper and now get tree like this:



I think that odometry behaves as you described. Is this correct?
Reply | Threaded
Open this post in threaded view
|

Re: How to obtain corrected Odometry to display in rviz?

matlabbe
Administrator
I checked again on my system and I did reproduced the problem. In latest zed_ros_wrapper version, they do also localization when odometry is used, causing a /map -> /odom frame also published by zed wrapper along the /odom -> zed_camera_center. There is no way to disable this by parameters and use only odometry. We have to comment this line in zed wrapper to avoid publishing /map -> /odom when we do the example "B) With zed odometry" on this tutorial. I updated the wiki for this issue. You should have afterward this TF tree instead:


The example "A) With rtabmap odometry" should work as expected. rtabmap will publish /map -> /odom and rgbd_odometry will publish /odom->/zed_camera_center.

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

Re: How to obtain corrected Odometry to display in rviz?

ArkadiuszN
You are right, I have also found out that there's no way to turn off this so I rebuild the wrapper without this tf. Everything works now, thanks.

I will ask on zed repo if they want a PR with the ability to turn off /map -> /odom.