Cause the vehicle to brake after detecting a person.
We create a subscriber for the camera ROS topic to get image frames (input) and a publisher to control the vehicle brakes (output). We run OpenCV's person detection algorithm on input image frames and if a person is found, we publish the brake command to the vehicle.
Outside Vehicle View
Inside Vehicle Command Line View
For installing some dependencies like, pacmod_msgs
and cv_bridge
, use the apt-get
command like:
$ sudo apt-get install ros-kinetic-pacmod-msgs
For running, startup ROS Core (in one terminal) and run brake.py
(on separate terminal).
# start up ROS Core
$ roscore
# run the code in separate terminal
$ python brake.py