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

running images in a loop using roslaunch

asked 2016-07-19 16:32:57 -0500

xploderz22 gravatar image

I have few images which I wanted to run using roslaunch command. Unfortunately, the images doesn't loop itself. Is there a way to loop images in ROS using roslaunch?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-07-20 04:56:17 -0500

jbb gravatar image

Hi

You could write a node that publishes your images one after the other and then launch that node from a launch file.

To do that you can probably follow this tutorial and modify it to loop through your images.

I haven't tested any of this but I guess you would have to change cv::Mat image = cv::imread(argv[1], CV_LOAD_IMAGE_COLOR); to something like :

cv::Mat image1 = cv::imread(path/to/image1, CV_LOAD_IMAGE_COLOR);

cv::Mat image2 = cv::imread(path/to/image2, CV_LOAD_IMAGE_COLOR);

cv::Mat image3 = cv::imread(path/to/image3, CV_LOAD_IMAGE_COLOR);

and then change msg at a regular time interval in the loop

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-07-19 16:32:57 -0500

Seen: 407 times

Last updated: Jul 20 '16