Visual SLAM and coordinate frames for a mobile robot

asked 2018-04-28 04:31:47 -0500

rayvburn gravatar image

updated 2018-04-28 09:02:18 -0500

[ROS Kinetic, Ubuntu 16.04]

Hello again. I followed tf tutorials, read REP103, REP105 and still having trouble setting coordinate systems for my mapping robot properly.

I get map->camera_optical transform from ORB-SLAM2 (version with ROS publishers from I will use that information to navigate my mobile robot with navigation stack. The robot has Raspberry Pi camera used for visual SLAM (visual odometry and obstacle detection implemented in that package). Robot has wheel encoders and uses diff_drive_controller that publishes/could publish odom->base_link transform.

move_base's local_costmap requires some local reference frame - /odom would be perfect for that purpose. By contrast, global_costmap requires global reference - it would be good to use /map for that.

This is my tf_tree just for tests, I thought everything was OK until I tried to use ORB-SLAM.

image description

Then I had to change tf_tree to following form to allow map->camera_optical transform (camera_optical must not have 2 parents - map and base_camera). Nevermind a lack of correspondence in frame names between 2 pictures, it's just to illustrate the structure. Also in the screen there is no map->camera_optical transform because ORB-SLAM wasn't running at the moment.

image description

The problem is - how can I set coordinate frames to make use of /map and /odom at the same time, while having map->camera_optical and odom->base_link transforms? I have no idea how to "divide" map->camera_optical transform into map->base_link and base_link->camera_optical. Is there any possibility to do that?

I would appreciate any help.

edit retag flag offensive close merge delete


Confused by the statement "Then I had to change tf_tree to the following form to allow map->camera_optical transform (camera_optical must not have 2 parents - map and base_camera)". Can you explain? To me, the first connected tree looks perfectly fine.

robotchicken gravatar image robotchicken  ( 2018-04-28 11:49:43 -0500 )edit

If map->camera_optical is published by ORBSLAM, then you can write a tf broadcaster from camera_optical->base_link. This way all three transforms are connected in the tree.

robotchicken gravatar image robotchicken  ( 2018-04-28 12:14:57 -0500 )edit