build details

Show: section status errors & todos local changes recent changes last change in-page changes feedback controls

Robot behaviour with ROS

Modified 2020-10-14 by arsimone

In this section you will extend some concepts already touched in an earlier exercise to work with ROS.

Laptop setup (unknown ref opmanual_duckiebot/laptop-setup)

previous warning next (43 of 57) index
warning
I will ignore this because it is an external link. 

 > I do not know what is indicated by the link '#opmanual_duckiebot/laptop-setup'.

Location not known more precisely.

Created by function n/a in module n/a.

Duckiebot initialization (unknown ref opmanual_duckiebot/setup-duckiebot)

previous warning next (44 of 57) index
warning
I will ignore this because it is an external link. 

 > I do not know what is indicated by the link '#opmanual_duckiebot/setup-duckiebot'.

Location not known more precisely.

Created by function n/a in module n/a.

Basic robot behavior with ROS

ROS based color detector

Modified 2019-10-02 by Aleksandar Petrov

Converting the color detector to ROS nodes

Using the following concepts:

Do the following:

  • Create two repositories from the ROS template.

  • Add all your python dependencies to the different ./dependencies-py.txt files

  • In the first one, add the code to extract images using your specific camera hardware(PiCamera or NVIDIA Jetson Nano camera) and publish it on a topic. This node will run on your Duckiebot and the node should run using a launch file. Remember to turn off all container that are instances of duckiebot-interface image and any other container which can use the camera.

  • In the second one, add code to subscribe to that topic and extract color. Using concepts from roslaunch, use your .launch file to launch two nodes instances using the same script. This means that you are not allowed to have different Python files for each node. The first node detects the color red and the second detects yellow. You should use params within your node tag to let your detector know whether it is supposed to detect red/yellow. These nodes will run on your laptop. Once again, pass the required environment variables to connect the container on your laptop to the rosmaster of your Duckiebot using docker run.

  • You should publish some debug images from within the color detection node. These debug images should have rectangles drawn in the region where the colors are detected. Note that we are not looking for perfect color detectors, as long as they produce reasonable output. You can draw multiple rectangles in the image if the multiple regions in the image have the requred color.

  • If you are using sensor_msgs/CompressedImage, make sure that your image topic names end with /compressed. For example, instead of naming the topic /my_image, name it /my_image/compressed

  • Record a bag file containing the original and debug images.

A sample debug image stream for the yellow color detector is shown here:

The video is at https://vimeo.com/364266236.

Sample Yellow Color Detector