[ROS Q&A] 49 – How to navigate while avoiding obstacles

Written by Ricardo Tellez

30/10/2017

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:

Topics: ROS Q&A
Masterclass 2023 batch2 blog banner

Check Out These Related Posts

1 Comment

  1. Ash B

    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

    Reply

Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This