Ask Your Question

Revision history [back]

As far as I know, there are no guides. I suggest you to have a look at gmapping, amcl and mapserver nodes.

In practice you have to implement the following things (presuming that you are going to work with most recent graph-slam theories)

  • a node that listen to odom and scan topics. When the distance traveled overcomes a certain threshold you add a node to your topological map. A laser scan has to be attached to each node. Then, each time you add a new node you can perform least squares adjustment, loop closure and similar stuffs.

  • a node that given the graph (and so the last optimized node) correct the robot position. Your tf tree has to be something like this: map -> odom -> base_link . The robot moves with respect to the odom frame, so to correct drift you have to publish a map to odom transform.

  • a node that given the graph, creates the map as an occupancy grid. This can be done again using the graph: given the scan associated to nodes, you can elaborate the map. For example, considering a single scan, assume that the first laser ray reaches distance D, so you know that the cells from the robot pose until D, along the ray direction, will be free; the cell at D will be an obstacle; the cells behind D will remain unknown. Obviously you have to integrate together the information coming from all the scans, because maybe a successive scan could see the same obstacle at distance D+1 and so on.... So you have to assign to each cell a probability of being occupied or not, depending on how many rays go beyond it and on how many stops at it.

I hope that this can clarify your ideas.