0
$\begingroup$

Rosanswers logo

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!


Originally posted by Marco Poli on ROS Answers with karma: 86 on 2013-06-06

Post score: 3

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by davinci with karma: 2573 on 2013-06-07

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Marco Poli on 2013-06-07:
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.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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!


Originally posted by Josh Whitley with karma: 1766 on 2013-06-22

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by Marco Poli on 2013-07-05:
It will be greatly appreciated!:)

Comment by kalectro on 2013-08-13:
any progress on this? Maybe a github repo? I would be willing to contribute

Comment by Josh Whitley on 2013-08-13:
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)

Comment by Josh Whitley on 2013-08-13:
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.

Comment by Josh Whitley on 2013-08-13:
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.

Comment by kalectro on 2013-08-13:
thanks, I will look into it

Comment by joq on 2013-08-13:
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.)

Comment by machack on 2013-09-02:
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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.