Introduction

The goal of this lab is to use numpy to give our Turtlebots the ability to detect and report intruders.

Step 1:

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

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

Click the “Add” button in the lower-left corner of the Rviz window to add a visualization for the intruder detection. If you select the “by topic” tab you should see an option for “intruder -> PointStamped”. Once you select that option, you should see a small ball appear one meter in front of the robot. That ball is the position where the robot is reporting an intruder.

Part 2

Open sentry.py and make sure you understand the provided code. Your goal is to update the timer_callback method so that it publishes to the intruder topic only when a sufficiently large change is observed in the laser scan data. When a change is observed, the published point should indicate its location. Your solution must use only vectorized numpy operations. No loops are allowed.

Some points to consider as you develop your solution:

Part 3

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


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