How to save pi camera data using ROS?

Hi folks,

I am currently working on a drone project which requires me to store all the sensor information on a drone simultaneously. I am trying to use ROS to get the images from the pi camera, is it ever possible to store them in real time(30 fps/sec)? Any instruction will be greatly appreciated!


Hi @Tommy_Xiong!
Of course it’s possible to store images. Take a look at my project where I was dealing with the raspberry pi camera. You can get some useful information from it. Also, for storing images use image_saver tool from image_view.

Hi, I checked on your project and got two questions.

  1. what package/node you are using for operating pi camera? I used this one here: but it seems to be only working with ROS kinect (my is indigo)

  2. How do you install kinect? My problem is that I used Navio2+raspberry pi. And the image they provided contains pre-installed ROS (indigo) + raspbian (jessie). And I am not sure if anything if I can do about it.

Or if you can recommand a package working for pi camera, it would be great!

Thanks a lot!

I was running ROS kinetic on my local machine, but now the latest Emlid raspbian image comes with pre-installed ROS kinetic. So you can try to use raspicam_node or gscam. Also I should mention that if you’re planning to not only store images, you can encounter some restrictions of the arm architecture. For example opencv extensively uses the SSE instructions which arm processors doesn’t have. However, you can substitute them with NEON instructions and try them.

Dear Kobylyankiy,

Thank you so much for your helpful answer! My project needs to be fully running on the navio, so I am finding a way to install your solution on board. However, for the last week, I kept encountering a dependency problem, showing that the very important ros package cannot be installed, neither can the raspi_cam node go with the emlid boot. But I just found that the problem is the newest image Navio2 provides: Kinect works poorly with Debian:Stretch. I installed the older version, which is using Jessie and Indigo, everything turns out to be working smoothly. I used “sudo modprobe bcm2835-v4l2” to enable pi camera to be a USB device, then installed ros-indigo-usb-cam to fetch the image. I havent check the image visually yet, but I can already echo the raw_image topic giving me 255 255 68 68 90 … which i believe is a sign of success. I will follow up the result shortly

Hi Suo,

please check my latest reply. Indigo+Jessie is better than Kinect+Stretch


Thanks Tommy! I tried to stick with indigo+Jessie when using pi camera and was able to installed gscam. I will post updates when I publish/subscribe raw_image tested successfully.

I have just confirmed that using" sudo modprobe bcm2835-v4l2 "+picamera + usb_cam + ros indigo + jessie + rosbag succesfully saved me a video of raw_image and I can reply it using image_view

How does “sudo modprobe bcm2835-v4l2” do to the configuration of picamera?

by directly using this bash line you can find that you get /dev/video0, thus enables you to use usb_cam or any ros usb cam package

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.