Point grey camera image capture
Hi,
I am trying to use a point grey camera with a jackal to capture images and process them by subscribing to the image topic in ROS.
Here is what I am doing:
- I have installed the point grey camera driver software on the ROS platform in the jackal.
- I launch the camera driver using roslaunch in one terminal.
- Once the camera driver is launched, the camera gets detected and the topics related to the point grey camera become available such as "camera/image_raw".
- I have a small program which does nothing but start ros and subscribe to the "camera/image" topic to get the data which is an array as per link:[http://docs.ros.org/api/sensor_msgs/html/msg/Image.html]
- A callback function collects the data and creates files.
- This is launched in a separate terminal using rosrun <package> <executable>
My problem:
- The capture is slow and the files captured are big -- I am suspecting that this is because I have not done anything to restrict the frame capture rate and that this is to be adjusted in the driver parameters.
- When this program is running, ROS does not seem to respond quickly to the SIGINT interrupt -- I suspect this is because it busy trying to complete its write of the camera data which is big and slow.(??)
- The data is raw and from the documentation I am not able to see how to map the data to 'r', 'g', 'b' channel values to pixel coordinate and colour information.
I need advice regarding:
- How do I reduce the size of the files for the capture? How do I fix the frame sample rate? Can I change the subscription rate in the program so that the capture of data from the topic happens at a fixed rate?
- Do I have to convert the raw data into an openCV format to be able to distinguish colour and pixel information?
- What is the efficient way and topic to use and access camera data?
- Is the method of launching the camera driver software and the program correct?
I would really appreciate help and advise.
Thanks, rsmitha.
What about the compressed image topics? I'm using gstreamer or usbcam ros-pkg/ driver. Here I have topics like
username@robot: ~ (0) $ rostopic list | grep /camera* /camera/camera_info /camera/image_raw /camera/image_raw/compressed /camera/image_raw/compressed/parameter_descriptions /camera/image
Try to use a
/camera/image_raw/compressed
before trying 2 do all the work on compression by yourself. After launching (your launchfile) you'll find all the camera topics by opening a new terminal and simply typingrostopic list
Thanks, @glukon. I have not tried the compressed image topic. I shall try your suggestions.
hey, anything new here? successfull? I'm also very interested in your question :)
Hi @glukon, I am writing to a file each time the callback happens. That is expensive. So I need to experiment with a smaller sampling rate and converting the image to opencv. I will post my results.