ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Odometry is a proprioceptive measure, i.e. it gives you information about the state of the robot not about the external world.

SLAM algorithms (Simultaneous Localization and Mapping) are what you need, but they always rely on exteroceptive sensors (lidar, camera, sonar...).

If you don't know what's surrounding your robot it's almost impossible to build a map. From the odometry you can only build the path the robot has followed so far. Moreover also obstacle avoidance becomes problematic.

If you need to map an environment using standard SLAM techniques there are examples in ROS.

http://wiki.ros.org/turtlebot_navigation/Tutorials/Build%20a%20map%20with%20SLAM

http://wiki.ros.org/nav2d_tutorials?distro=lunar

On the other hand, if what you need is really to build a map using ONLY odometry, the only solution is to cover all the environment with the robot. Just make an algorithm to move the robot from wall to wall using a "snake" pattern. Note that the robot will not be able to asses where obstacles are until it bumps into them. So you will need at least a bumper or another additional sensor which tells you that the wheels are spinning but the robot is not moving forward (because it's against a wall). In this case you could look for "wall following" algorithms and "environment coverage" ones. But I strongly suggest to think about you really need to map using odometry.