System framework and data flow

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

System framework and data flow

yanmingz
Hi Mathieu,

Thanks for your warm help in the last a few months.

I have one more question.

Based on your paper and code, the whole RTAB-Map can be divided into 2 parts, visual odometry (VO) and bundle adjustment (BA).

For RGBD slam, the main inputs for visual odometry are the rgb/depth image pair and output is the pose of base-link.

For bundle adjustment, the main inputs for bundle adjustment are pose of base-link and rgb/depth image pair. And the output is the optimized map.

I am not very sure if I am correct for the description above.

My question is I notice that the optimized map can change the pose output by VO and I can't find how it is implemented in your code?

In more details, if the rgb/depth image pair at time Tn is input to both VO and BA, and loop closure is detected and map optimization is done between time Tn+j and time Tn+j+1, will the changes caused by the optimization be included in change between poses. If so, when and how the changes are included?

Thanks a lot.
Yanming
Reply | Threaded
Open this post in threaded view
|

Re: System framework and data flow

matlabbe
Administrator
Hi Yanming,

The optimized map won't change odometry values (the mapping module doesn't talk to odometry module), it will just add a correction transform on its side. This transform is always Identity if the graph is optimized from the last node.

In ROS, the correction is published under TF /map -> /odom with the transform saved here. On standalone in the GUI, the map correction is saved here.

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

Re: System framework and data flow

yanmingz
Hi Mathieu,

Thanks for your quick reply.

Am I correct if I say the output of odometry module is in the odom frame and output of mapping model is in the map frame? And any other nodes which work in map frame need this TF to calculate base_link's pose from the output of odometry module?

Best regards
Yanming
Reply | Threaded
Open this post in threaded view
|

Re: System framework and data flow

matlabbe
Administrator
Hi Yanming,

Yes, if any other modules need to work in /map frame, it should get the transform /map -> /base_link from TF. For example, the global planner of move_base would work in /map frame, but the local planner would work in /odom frame.

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

Re: System framework and data flow

yanmingz
Hi Mathieu,

I have read your code of class rtabmap very carefully these days and tried to get your idea of your code. I am not so sure about my understanding. Could you help me to check if my understanding is right or not?

In class rtabmap, the pose of a node is recorded in member _memory, which comes from odometry node and not be modified in the whole process and saved in rtabmap.db when the whole program finished. In the mapping process, the optimization results are saved in _optimzedposes and utilized as initial values for the next optimization, but not saved in the rtabmap.db.

Before a new session starts, all the nodes are loaded from rtabmap.db. Since their poses are the original poses from odometry, an optimization process is needed. The optimization results are sent to rtabmaprviz, but not saved in the rtabmap object. So in the localization mode, when the first loop closure is detected, the poses saved in _memory have to be optimized again.

Am I right? Many thanks to you.

Best regards
Yanming
Reply | Threaded
Open this post in threaded view
|

Re: System framework and data flow

matlabbe
Administrator
Hi Yanming,

Yes, you are right. After the first optimization done on first localization, no more optimizations would be required (unless there are nodes transferred or retrieved from the long-term memory).

Every request to get the map from rtabmap would result in a optimization if you set the flag global=1 on the services /rtabmap/get_map, /rtabmap/get_graph or /rtabmap/publish_map, otherwise (with global=0), the actual optimized map is sent.

cheers,
Mathieu