Home | Tutorials | Wiki | Issues
Ask Your Question
0

Restarting and modifying a world/model in gazebo

asked 2020-03-04 14:12:53 -0500

FranJRO gravatar image

Hi everyone again! I'm programing an reinforcemente learning aplication for a robot.

I've created the whole learning code, but I need one more thing to finish: restarting the world. I'm using the gazebo simulator, and when teh robot have achive its objetive, I have to change the world, I mean, reset the robot pose and change the obstacles poses randonly).

I haven't found some solutions for changing the pose of the obstacles randonly (I thought modifying the line with determines the pose of the obstacle in the xml file from c++ and strings, scan and thats stuff, I don't know if it is a good idea, could you tell me?). But for the pose reset of the robot I have no idea.

I've looking for how to make a roslaunch of the .launch which contain the urdf model, the necesary nodes, etc, but from c++. But it could be slow doesn't it? Because it would have to re-open the simulator...

Please if you know or you have some information or advices I'll apreciate it so much. Thanks :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-05-18 02:42:52 -0500

starcosmos gravatar image

Hello. I have the same question. At present, I train my model by rewriting the world file. And then kill the gazebo in the code and use "roslaunch *_gazebo" to re-start the gzserver. But after training 40-50 iteration, gazebo will report an error, and then I has to re-start the main program manually. I doubt it's a wrong way to restart gazebo. If you solve this problem, I hope you can tell me.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-03-04 14:12:53 -0500

Seen: 40 times

Last updated: May 18