ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

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

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

jbb gravatar image


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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 373 times

Last updated: Jul 20 '16