ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

Raspberry Pi CSI Camera Driver/Support

asked 2013-06-06 14:24:46 -0600

Marco Poli gravatar image

updated 2014-01-28 17:16:48 -0600

ngrennan gravatar image

I am thinking on buying one of the just-released Pi Cameras, a camera that seems to communicate with a Raspberry Pi module through CSI (Camera Serial Interface).

Is there support for the CSI cameras somewhere in ROS already?

Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-06-07 01:37:30 -0600

davinci gravatar image

updated 2013-06-07 04:06:09 -0600

I can't find any modules for it. But the camera code is available so it could be put in a node.

Another option would be to create a mjpg stream as described here. And modify the Axis camera node to work with a non Axis mjpg stream.

edit flag offensive delete link more

Comments

Those references will surely be a good place to start. I just bought one and will get my hands on it soon, I might give this development a try. Thanks.

Marco Poli gravatar image Marco Poli  ( 2013-06-07 14:49:12 -0600 )edit
2

answered 2013-06-22 20:09:15 -0600

Josh Whitley gravatar image

updated 2013-11-01 14:14:12 -0600

There's a gentleman over at the Raspberry Pi forums who has broken down the example code and figured out the MMAL API that is being used. The thread with all of his info is here: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=44982&p=356842.

I am attempting to make a node for the Raspberry Pi camera as well so I've been working on this for a little while.

EDIT: I found a solution that works pretty well using existing software! Here are the steps that are required:

  1. Get the Raspberry Pi UV4L camera driver from www.linux-projects.org.
  2. Download gencam_cu from http://prairiedog.googlecode.com/svn/trunk/gencam_cu/ (this is still a dry package so you'll have to create a separate rosbuild workspace, overlay it on your catkin workspace using the instructions at http://wiki.ros.org/catkin/Tutorials/using_rosbuild_with_catkin and build it using rosmake [BUT DON'T BUILD YET]).
  3. Modify gencam_cu to include a link to the uv4l driver at build-time by modifying ~/rosbuild_ws/gencam_cu/src/CMakeLists.txt. Add the line link_directories(/usr/lib/uv4l/uv4lext/armv6l/) at the top and the line target_link_libraries(gencam_cu uv4lext) at the end.
  4. Now you can rosmake gencam_cu.
  5. Launch the uv4l driver using uv4l --driver raspicam --auto-video_nr --width 640 --height 480 --nopreview which will create an MJPEG-based camera at /dev/videoX (where X is auto-incremented starting at 0).
  6. Launch roscore, then rosrun gencam_cu gencam_cu.

I get about 16-18 fps at 640x480 and you get compressed image streams!

edit flag offensive delete link more

Comments

It will be greatly appreciated!:)

Marco Poli gravatar image Marco Poli  ( 2013-07-05 14:25:18 -0600 )edit

any progress on this? Maybe a github repo? I would be willing to contribute

kalectro gravatar image kalectro  ( 2013-08-13 04:49:50 -0600 )edit

The problem so far has been that the conversion from the camera's YUV stream to an RGB stream (needed for ROS) has caused too much overhead. However, Broadcom has recently modified the RPi firmware to allow this in the GPU. I've got an app that outputs a raw YUV stream (next comment)

Josh Whitley gravatar image Josh Whitley  ( 2013-08-13 04:55:31 -0600 )edit

https://github.com/circpeoria/raspividYUV - This just needs to now output RGB. See the updated raspistillYUV with the -rgb option from Userland on how to accomplish this (though I've been unable to so far). Once this is added to my app, we should be able to wrap it up in C++ and make a node.

Josh Whitley gravatar image Josh Whitley  ( 2013-08-13 04:57:39 -0600 )edit

FYI - my app may be missing the vcos_semaphore that is necessary at the end of each frame since it isn't being run through the encoder. Can't remember - it's been a little while since I worked on it.

Josh Whitley gravatar image Josh Whitley  ( 2013-08-13 05:03:10 -0600 )edit

thanks, I will look into it

kalectro gravatar image kalectro  ( 2013-08-13 05:14:45 -0600 )edit

A ROS driver *could* publish a "yuv422" encoding instead of "rgb8". Maybe conversion from YUV420p to YUV422 would be easier. (I don't know whether the ROS image pipeline handles that correctly or not.)

joq gravatar image joq  ( 2013-08-13 06:13:42 -0600 )edit

There is a node that I've been developping for the camera module of the raspberry pi. The node is designed to output images in jpeg format to a topic. More information can be obtained from http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=54092

machack gravatar image machack  ( 2013-09-02 05:40:05 -0600 )edit

Question Tools

4 followers

Stats

Asked: 2013-06-06 14:24:46 -0600

Seen: 8,245 times

Last updated: Nov 01 '13