Your goal for this lab is to complete the provided sentry.py
node so that it makes an audible signal any time something crosses in front of the robot. The Kobuki beeping sounds can be controlled by publishing to the /mobile_base/commands/sound
topic.
Your intruder detection code should follow the algorithm below. Your solution should not contain any loops. Use appropriate numpy
methods to accomplish each step.
Complete each of the following steps on each callback:
(This is also called the \(L1\) norm of the difference, and could be expressed \(\lVert \mathbf{c} - \mathbf{p} \rVert_1\) )
Note that you will need to clear out the nan
values before you calculate the sum. Any sum involving a nan
will be equal to nan
. You can remove nan
values from a numpy array using the following magic:
x = x[~np.isnan(x)]