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

Monte Carlo simulations- repeated trials

asked 2019-04-20 18:48:50 -0500

kitkatme gravatar image

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++.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-04-21 08:30:19 -0500

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.

edit flag offensive delete link more

Comments

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.

kitkatme gravatar image kitkatme  ( 2019-04-22 15:01:48 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-04-20 18:48:50 -0500

Seen: 186 times

Last updated: Apr 21 '19