Raspberry Pi Camera
The diffbot robot uses the UbiquityRobotics/raspicam_node
to interface the Raspberry Pi Camera v2.
Setup
Currently there exists no binary of the raspicam_node
for ROS noetic (only for kinetic there is the ros-kinetic-raspicam-node
).
To work with the raspicam_node
for ROS Noetic, you have to build it from source with steps
outlined in the build intstructions of the readme.
For completeness, these steps are listed here:
First go to your catkin_ws cd ~/ros_ws/src
and download the source for this node by running
1 |
|
There are some dependencies that are not recognized by ROS, so you need to create the file /etc/ros/rosdep/sources.list.d/30-ubiquity.list
and add
the following to it:
1 |
|
This will add ROS dependency sources, which are relevant for the Raspberry Pi.
For completeness you can list the content of this yaml file here:
Show content
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
To make use of these sources run
1 |
|
Next, we parse the package.xml
file for required dependencies and also install them with the rosdep
command:
1 2 |
|
Finally, you can compile the code with the catkin build
command from catkin-tools
or
use the legacy catkin_make
command.
Running the node
To publish the camera image on the /raw/image/compressed
topic run the following on the SBC of the robot:
1 |
|
Running rostopic list
should show the topics of raspicam node:
1 2 3 4 |
|
To view the compressed image run the following command on your development PC:
1 |
|
This will open up a window where you can see the camera image. If it is dark, check if you removed the lense protection ;-)
Note
There is also a rpicamera.launch
in the diffbot_bringup
package which you can make use of:
1 |
|