Skip to content

Workshop 6 ‐ Navigation II

Riccardo Polvara edited this page Nov 1, 2024 · 2 revisions

Task 1 - Waypoints navigation

For this task, you are required to work in simulation for the time being.

  1. Launch the simulation in the way you learnt in the previous weeks - you can check the dedicated Wiki pages if you don't remember how to do it.

  2. Launch the navigation stack by invoking the following command

    ros2 launch limo_navigation limo_navigation.launch.py

  3. Add a new Map type marker for your local_costmap topic, and set the Color scheme to costmap. Notice how obstacles got inflated by a safety area which is not traversable by the robot. You can read more about it here.

    image

  4. Inspect the new file demo_inspection.py that has been added to the repository of the module. It contains a list of user defined waypoints that the robot will follow using a BasicNavigator approach.

  5. Now, run the autonomous waypoints-based navigation by typing in a new terminal

    ros2 run cmp9767_tutorial demo_inspection

    and the robot should start moving, before returning to the initial position.

Task 1.b - Waypoints with Obstacles

  1. Add a cube in the middle of the arena, as in the following image, and then try again the waypoint navigation script. Observe the resulting behaviour, if the robot is able to avoid the new obstacle or not.

    image

Task 1.c - Custom Waypoints

Let's try yourself now to find a new set of waypoints for your custom application. Ideally, when we are in an environment which I have the map, a simple approach would be to teleoperate the robot first on top of the waypoints we want the robot goes through autonomously, and record their coordinates by listening to the robot pose topic at that moment and location.

  1. As such, the first objective is to find the coordinate of the waypoints. The current demo_inspection.py script needs a list of PoseStamped messages. The first objective is to identify which topic does publish a msg of a suitable type (e.g., Pose, PoseStamped, PoseWithCovarianceStamped, etc).

  2. Once you found a suitable topic, keep a terminal open meanwhile you are ros2 topic echo XXX on the topic XXX you found at the previous stage.

  3. Teleoperate the robot where you would like the robot to stop and modify the inspection_route list in the demo_inspection.py file such that each element of the list is in the format [pos_x, pos_y, or_x, or_y, or_z, or_w] by using the values that are printed in console.

  4. Once you are happy with the list of waypoints, try the demo_inspection.py file with your own modification.

Notes

  • In case the robot has difficulties in navigating from waypoint to waypoint in case they are too close to obstacles, remember you can modify some parameters (e.g., 'robot_radius' for increasing the robot footprint, 'inflation_radius' for increasing safety space around obstacles) of the global/local costmap, either by:

    • inspecting the /opt/ros/lcas/install/limo_navigation/share/limo_navigation/params/nav2_params.yaml file and change the values for inflation_radius layer such that the robot does not get stuck near the walls. This change will be reflected the next time you launch the simulation.

    • dynamically reconfigure on the fly by opening ros2 run rqt_gui rqt_gui or by simply typing rqt from the console and then from the menu bar Plugins/Configuration/Dynamic Reconfigure. Please select global_costamp or local_costamp in the menu on the left, and you should be able to visualise all the parameters you can change.