Restarting and modifying a world/model in gazebo
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 :)
Asked by FranJRO on 2020-03-04 15:12:53 UTC
Answers
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.
Asked by starcosmos on 2020-05-18 02:42:52 UTC
Comments