Using Gazebo as a physics simulation inside a motion planner
I'm interested in using Gazebo physics simulator inside the inner loop of a motion planner. For example, I would like to set the environment in an initial state, run exactly 100 ms of simulation, then record the final state of the environment. Ideally, I would like to run the [relatively simple] simulation much faster than real-time.
This requires low-level control over starting, stopping, and stepping the simulation without waiting for Gazebo's main event loop to run. We've found callbacks that notify us of these event happen, but no way to trigger them ourselves.
Are there any functions in the API that give us this type of low-level control over the simulation loop? Do I need to bypass Gazebo entirely and write my own simulation loop?
I'll try to setup a working example tomorrow, and post my result. In the mean time, you could look at writing a system plugin to control gazebo start/stop/run states.
Thanks again for the reply. That sounds like what we're looking for. However, I don't actually see any functionality besides Init, Load, and Reset exposed through the SystemPlugin interface. How do I control the start/stop/run state from that interface? (This will likely already be answered by the example.)