Q: How to navigate while avoiding obstacles? Original question here: https://answers.ros.org/question/274391/could-use-some-guidance-on-how-to-navigate-while-avoiding-obstacles/?answer=274526#post-id-274526
A: In order to do navigation using a laser for localization and obstacle avoidance, you need to do first a map of the environment you want to move through. For that, you need to use the gmapping package. Launch the gmapping package, and then move the robot around using the keyboard or joystick so it can build the map.
Once the map is done, you need to save it using the following command:
rosrun map_server map_saver -f name_of_map
Then you are ready to use that map for localization and sending the robot to different locations in the map, while avoiding obstacles. Kill the gmapping node and launch now the localization package (the amcl). Together with the amcl you need to launch the map_server (to use the map you created on the previous step) and the move_base (to make the robot move around while avoiding obstacles).
RELATED LINKS:
- ROS Development Studio: Develop your ROS project online.
- ROS Courses Library
Suppose if I add a random object, say a cylinder in the gazebo environment after making the map, can the robot still avoid this object when it is given a goal. If yes, how do I do it? Thanks