Open mphamhung opened 4 years ago
There is nothing exposed right now, but it should be easy to clear the scene and re-spawn the agents
In simulator_node.cpp, I add the following calls too a ros listener callback:
sm.cleanUp();
sm.initializeSimulation();
sm.runSimulation();
Where sm.cleanUp is defined in simulator.cpp as:
void Simulator::cleanUp() {
SCENE.clear();
}
This seems to get the simulator to reset on callback, except the pedsim simulator node crashes after a few times. I get an exit code -11, which sounds to me like a memory reference problem. Furthermore, each time new agents spawn, their number in rviz also increases?
Is there a different way to clear and respawn?
Yes, this is a little more involved. We need to also reset agent ids in the libpedsim part.
Hi, are there any exposed functions that would let me restart the simulation without killing and relaunching? I'm looking to implementing an openaigym-like interface and want to restart the simulation for each episode.