Point grey camera image capture

asked 2017-11-09 17:21:13 -0500

rsmitha gravatar image

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.

edit retag flag offensive close merge delete

Comments

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

glukon gravatar image glukon  ( 2017-11-10 02:38:51 -0500 )edit

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 typing rostopic list

glukon gravatar image glukon  ( 2017-11-10 02:40:20 -0500 )edit

Thanks, @glukon. I have not tried the compressed image topic. I shall try your suggestions.

rsmitha gravatar image rsmitha  ( 2017-11-10 14:52:14 -0500 )edit

hey, anything new here? successfull? I'm also very interested in your question :)

glukon gravatar image glukon  ( 2017-11-14 10:06:08 -0500 )edit

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.

rsmitha gravatar image rsmitha  ( 2017-11-15 05:00:46 -0500 )edit