TL;DR: Make sure your environment is setup correctly and remember (stating the obvious) that you will be working on a ARM architecture as opposed to a x86 most likely found on your laptop.
These notes assumes you have enabled the camera through raspi-config. Make sure
raspistill and raspivid are functioning as expected. (ex.
test.png should result in an image named test.png placed in the current
Using the raspicam_node
One can take the time to program their own Raspi camera node, but for this
exercise we will be using
raspicam_node created by UbiquityRobotics. The ROS
node can be installed following the instructions found
Some steps need to be taken to address the network configuration, in order for Raspi to communicate with a master on a different machine.
ROS_MASTER_URI that is set for the machine considered the master
(laptop in my case), needs to be set exactly the same for the child
(raspberry-pi in my case). In my particular case, the hostnames were not
resolving, and was getting an error message
Couldn't find an AF_INET address
for on my master machine. To resolve this issue, I explicitly specified the
ROS_IP of the child. (Use ifconfig to find IP address of the child).
Once the network is setup, roscore needs to be initialized on the master
(laptop), before launching the launch file related to
you will get an error message indicating that the master can not be reached.
raspicam_node outputs the following topics:
/raspicam_node/camera_info /raspicam_node/image/compressed /raspicam_node/parameter_descriptions /raspicam_node/parameter_updates /rosout /rosout_agg
Notice that the
/raspicam_node/image/compressed is only available, thus
without the appropriate conversion, the image will not be viewable using
image_view image_view image:=/topic_name. Thus we will need to publish a
/image/compressed topic to
/image by using `
rosrun image_transport republish compressed in:=/raspicam_node/image raw
. Another way to access the image is by using
rqt_image_view` which starts a GUI and allows for the visualization of the
Now that we have the camera working on a child machine separate from the master, we can work on more interesting robotics projects related to collaboration across multiple machines.