ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Read images from disk, publish as camera [closed]

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

jespestana gravatar image

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

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



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 image joq  ( 2013-03-08 04:32:17 -0500 )edit

Thanks, I am publishing the tf of the cameras using static_transform_publisher nodes ( ). 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 image jespestana  ( 2013-03-08 12:33:16 -0500 )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: )

jespestana gravatar image jespestana  ( 2013-03-08 12:34:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

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

Miquel Massot gravatar image

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

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


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

jespestana gravatar image jespestana  ( 2013-03-07 09:12:47 -0500 )edit

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

Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2013-03-07 09:30:38 -0500 )edit

I have made my own version of, 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 image jespestana  ( 2013-03-08 07:29:50 -0500 )edit

is there any similar tool for c++ ?


lilouch gravatar image lilouch  ( 2015-03-20 03:27:32 -0500 )edit

Question Tools


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

Seen: 2,092 times

Last updated: Mar 07 '13