0
$\begingroup$

Rosanswers logo

I need to run the same simulation repeatedly (100 times) and I'd rather not do it manually. However, I have not found any resources describing how to do this in ROS. I have a launch file that runs the simulation once, so ideally I could write code that launches it, cuts it off after simulation time reaches a certain point, then saves and relaunches. How can I do this?

Other details: in ROS melodic, and all my code is in C++.


Originally posted by kitkatme on ROS Answers with karma: 47 on 2019-04-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If you have a launch file, you should be able to start/monitor/stop that launch file from python (as roslaunch is written is python, there isn't a C++ api). See the wiki for details about the API.


Originally posted by BryceWilley with karma: 711 on 2019-04-21

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by kitkatme on 2019-04-22:
thanks, that was my confusion, I thought the roslaunch API could only be used if your code was also in python. now I'm trying to make it work and hitting new errors, but I'll post those in a new question.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.