Ask Your Question
3

Read images from disk, publish as camera [closed]

asked 2013-03-07 06:31:51 -0600

jespestana gravatar image

updated 2014-01-28 17:15:35 -0600

ngrennan gravatar image

I have a dataset of images on disk, along with a set of camera parameters (though they are not in ROS camera_info file format). I am trying to make a node that reads and publish de images in round robin (when it finishes reading the images in the folder, it starts again). My main objective is to make it in such a way that I can "fool" other nodes, making them think that the node is a camera.

I have being trying to do it in the following way:

  • Publish the images in a topic /camera/image_rect_color
  • Publish sensor_msgs/CameraInfo in the topic /camera/camera_info
  • I have tried to visualize the images in rviz using a camera display, but rviz complains because it says no /camera_link frame is published

At this point I believe there has to be an easier way to do this... Does anybody has suggestions about how to achieve this?

Thanks in advance!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Miquel Massot
close date 2015-06-25 02:50:29.985799

Comments

1

You are probably close. The /camera_link is probably a missing tf frame of reference. Try setting rviz to use that frame ID for its display.

joq gravatar imagejoq ( 2013-03-08 04:32:17 -0600 )edit

Thanks, I am publishing the tf of the cameras using static_transform_publisher nodes ( http://www.ros.org/wiki/tf#static_transform_publisher ). I had to be careful to name the camera frames equally in the cameraInfo and when launching the static_transform_publisher nodes. Now everything works!

jespestana gravatar imagejespestana ( 2013-03-08 12:33:16 -0600 )edit

Regarding the stereo camera baseline (if anybody reads this question) is stored in the matrixes in the cameraInfo of the left and right cameras (see the answers to this question: http://answers.ros.org/question/29050/stereo-camera-calibration-fundamental-matrix/ )

jespestana gravatar imagejespestana ( 2013-03-08 12:34:00 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2013-03-07 07:25:39 -0600

Miquel Massot gravatar image

updated 2013-03-07 07:26:51 -0600

We've got a python node that does that, take a look here, and the code is also here. Unfortunatelly, it does not start again when all the images have been published, but feel free to contribute!

edit flag offensive delete link more

Comments

Thanks a lot, I am going to study and try your code!

jespestana gravatar imagejespestana ( 2013-03-07 09:12:47 -0600 )edit
3

You could make it restart by running it in a launch file with respawn="true"

Dan Lazewatsky gravatar imageDan Lazewatsky ( 2013-03-07 09:30:38 -0600 )edit
1

I have made my own version of image_stereo_sequence_publisher.py, image_stereo_sequence_publish.launch based on your files. The main difference is that I am publishing stereo images simultaneously from the same node; and that I can set the name of the topics stereo/left/image_rect, etc.Thanks!

jespestana gravatar imagejespestana ( 2013-03-08 07:29:50 -0600 )edit

is there any similar tool for c++ ?

Thank

lilouch gravatar imagelilouch ( 2015-03-20 03:27:32 -0600 )edit

Question Tools

Stats

Asked: 2013-03-07 06:31:51 -0600

Seen: 1,494 times

Last updated: Mar 07 '13