Introduction

The goal of this lab is to use numpy to improve our Turtlebot’s ability to wander without hitting obstacles.

Step 1:

Bringup the Turtlebot and rviz according to the instructions from this previous lab.

Then download and execute smart_wander.py. For now, just run this as a Python script:

python smart_wander.py

Click the “Add” button in the lower-left corner of the Rviz window to add a visualization for detected obstacles. If you select the “by topic” tab you should see an option for “obstacles -> MarkerArray”. Once you select that option, you should see a line of green spheres.

You may also want to run the following node, which will stop the Turtlebot whenever no other node is publishing movement commands: safe_cmd_vel.py.

Part 2

Open smart_wander.py and make sure you understand the provided code. Your goal is to update the timer_callback method so that it satisfies the following requirements:

Hints and Suggestions:

Part 3

Once you are happy with the behavior of your node, turn it into a ROS 2 package named smart_wander and submit through GitHub classroom.


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.