Raspicam Image Publish RAW instead

I am trying to use the raspicam pacakge as my camera device, however, I need to use raw image instead of the compressed.

What do I need to adjust in the code to make the image being published to be raw instead of compressed?

It has been a long time since I did what you are discussing but I have this note, look into use of this method I guess. This method takes in a compressed stream and outputs a raw stream.
This was for my use a few years back so you may have to mess with the topic names.

The tool is use of image_transport (if this is not on your image you would have to get it using an apt get but I don’t have time right now to try all this. See if this helps. I can try more later if the info below does not work for you today.

rosrun image_transport republish compressed in:=/raspicam_node/image raw out:=/raspicam_node/image

And here is a second note that was meant for putting in my launch file rather than on command line:

The second one new topic is a different name so you have to use the new name of the raw topic stream of course in your conversion input source topic.

1 Like

I shall try this out and see what I can do, thanks!

Actually, that’s not the whole story. The raw format requires width to be divisible by 32, and height to be divisible by 16 which it isn’t by default.

So you’ll have to go into the launch file and correct to resolution so it fits that requirement otherwise transport will crash.

More info:

This is something we should really fix, but nobody’s really taken it up yet.

1 Like

Raspicam also supports raw publishing by adding enable_raw:=true to the launch command, for example:

roslaunch raspicam_node camerav2_1280x960_10fps.launch enable_raw:=true

Its in the calibration section of the README: https://github.com/UbiquityRobotics/raspicam_node#calibration

1 Like