gazebo-yarp-plugins
Gazebo Plugins exposing YARP interfaces.
|
Plugin exposing the Gazebo Clock on the YARP network, allowing to synchronize the simulation with an external controller. More...
#include <Clock.hh>
Public Member Functions | |
GazeboYarpClock () | |
virtual | ~GazeboYarpClock () |
virtual void | Load (int _argc=0, char **_argv=NULL) |
void | gazeboYarpClockLoad (std::string world_name) |
void | clockUpdate () |
void | clockPause () |
pause the simulation | |
void | clockContinue () |
resume the simulation | |
void | clockStep (unsigned steps=1) |
Step the simulation for the input number of steps. | |
common::Time | getSimulationTime () |
Returns the simulation time. | |
void | resetSimulationTime () |
Reset the simulation time back to zero. | |
void | resetSimulationState () |
Reset the simulation state back to initial state. | |
void | resetSimulation () |
Reset the simulation time and state back to zero. | |
virtual double | getStepSize () |
Get the current step size in seconds. | |
Plugin exposing the Gazebo Clock on the YARP network, allowing to synchronize the simulation with an external controller.
The plugin itself exposes two features:
/clock
/clock/rpc
) to allows control of the simulation time.The plugin should be launched as a system plugin:
gazebo -slibgazebo_yarp_clock.so
The RPC communication API is written in thrift and a stub is automatically generated and can be used for remote procedure calls. The APIs allow to stop, resume and step the simulation.
The features exposed by this plugin should be enough to cover most of the synchronization issues.
If you need to implement synchronization in your module, you should use the RPC calls to properly step the simulation.
At the current state, you can use the synchronization out-of-the-box in these two cases:
Yarp already supports the use of an external clock. In this case, the only thing that is needed is to set the environmental variable YARP_CLOCK
to be equal to the clock port, e.g., YARP_CLOCK=/clock
. We strongly advice you to NOT put the variable in your .bashrc
but to do it explicitly for each module.
If you are using the WB-Toolbox a block called Simulator Synchronizer
already implements the correct RPC calls. You only have to put the block in your Simulink model.
gazebo::GazeboYarpClock::GazeboYarpClock | ( | ) |
|
virtual |
|
virtual |
void gazebo::GazeboYarpClock::gazeboYarpClockLoad | ( | std::string | world_name | ) |
void gazebo::GazeboYarpClock::clockUpdate | ( | ) |
void gazebo::GazeboYarpClock::clockPause | ( | ) |
pause the simulation
void gazebo::GazeboYarpClock::clockContinue | ( | ) |
resume the simulation
void gazebo::GazeboYarpClock::clockStep | ( | unsigned | steps = 1 | ) |
Step the simulation for the input number of steps.
Defaults to 1
[in] | steps | number of steps |
common::Time gazebo::GazeboYarpClock::getSimulationTime | ( | ) |
Returns the simulation time.
void gazebo::GazeboYarpClock::resetSimulationTime | ( | ) |
Reset the simulation time back to zero.
void gazebo::GazeboYarpClock::resetSimulationState | ( | ) |
Reset the simulation state back to initial state.
void gazebo::GazeboYarpClock::resetSimulation | ( | ) |
Reset the simulation time and state back to zero.
|
virtual |
Get the current step size in seconds.