Store state information of a physics::World object. More...
#include <physics/physics.hh>
Inherits State.
Public Member Functions | |
WorldState () | |
Default constructor. More... | |
WorldState (const WorldPtr _world) | |
Constructor. More... | |
WorldState (const sdf::ElementPtr _sdf) | |
Constructor. More... | |
virtual | ~WorldState () |
Destructor. More... | |
const std::vector< std::string > & | Deletions () const |
Get the vector of SDF deletions. More... | |
void | FillSDF (sdf::ElementPtr _sdf) |
Populate a state SDF element with data from the object. More... | |
uint64_t | GetIterations () const |
Get the iterations when this state was generated. More... | |
LightState | GetLightState (const std::string &_lightName) const |
Get a light state by light name. More... | |
ModelState | GetModelState (const std::string &_modelName) const |
Get a model state by model name. More... | |
unsigned int | GetModelStateCount () const |
Get the number of model states. More... | |
ModelState_M | GetModelStates (const boost::regex &_regex) const |
Get model states based on a regular expression. More... | |
const ModelState_M & | GetModelStates () const |
Get the model states. More... | |
std::string | GetName () const |
Get the name associated with this State. More... | |
common::Time | GetRealTime () const |
Get the real time when this state was generated. More... | |
common::Time | GetSimTime () const |
Get the sim time when this state was generated. More... | |
common::Time | GetWallTime () const |
Get the wall time when this state was generated. More... | |
bool | HasLightState (const std::string &_lightName) const |
Return true if WorldState has a LightState with the given name. More... | |
bool | HasModelState (const std::string &_modelName) const |
Return true if WorldState has a ModelState with the given name. More... | |
const std::vector< std::string > & | Insertions () const |
Get the vector of SDF insertions. More... | |
bool | IsZero () const |
Return true if the values in the state are zero. More... | |
unsigned int | LightStateCount () const |
Get the number of light states. More... | |
const LightState_M & | LightStates () const |
Get the light states. More... | |
void | Load (const WorldPtr _world) |
Load from a World pointer. More... | |
virtual void | Load (const sdf::ElementPtr _elem) |
Load state from SDF element. More... | |
WorldState | operator+ (const WorldState &_state) const |
Addition operator. More... | |
State | operator- (const State &_state) const |
Subtraction operator. More... | |
WorldState | operator- (const WorldState &_state) const |
Subtraction operator. More... | |
WorldState & | operator= (const WorldState &_state) |
Assignment operator. More... | |
void | SetDeletions (const std::vector< std::string > &_deletions) |
Set a new vector of SDF deletions. More... | |
void | SetInsertions (const std::vector< std::string > &_insertions) |
Set a new vector of SDF insertions. More... | |
virtual void | SetIterations (const uint64_t _iterations) |
Set the simulation interations when this state was generated. More... | |
void | SetName (const std::string &_name) |
Set the name associated with this State. More... | |
virtual void | SetRealTime (const common::Time &_time) |
Set the real time when this state was generated. More... | |
virtual void | SetSimTime (const common::Time &_time) |
Set the sim time when this state was generated. More... | |
virtual void | SetWallTime (const common::Time &_time) |
Set the wall time when this state was generated. More... | |
void | SetWorld (const WorldPtr _world) |
Set the world. More... | |
Protected Attributes | |
uint64_t | iterations |
The number of simulation iterations when this state was generated. More... | |
std::string | name |
Name associated with this State. More... | |
common::Time | realTime |
common::Time | simTime |
common::Time | wallTime |
Times for the state data. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const gazebo::physics::WorldState &_state) |
Stream insertion operator. More... | |
Store state information of a physics::World object.
Instances of this class contain the state of a World at a specific time. World state includes the state of all models, and their children.
WorldState | ( | ) |
Default constructor.
|
explicit |
Constructor.
Generate a WorldState from an instance of a World.
[in] | _world | Pointer to a world |
|
explicit |
Constructor.
Build a WorldState from SDF data
[in] | _sdf | SDF data to load a world state from. |
|
virtual |
Destructor.
const std::vector<std::string>& Deletions | ( | ) | const |
Get the vector of SDF deletions.
void FillSDF | ( | sdf::ElementPtr | _sdf | ) |
Populate a state SDF element with data from the object.
[out] | _sdf | SDF element to populate. |
|
inherited |
Get the iterations when this state was generated.
LightState GetLightState | ( | const std::string & | _lightName | ) | const |
Get a light state by light name.
[in] | _lightName | Name of the light state to get. |
common::Exception | When the _lightName doesn't exist. |
ModelState GetModelState | ( | const std::string & | _modelName | ) | const |
Get a model state by model name.
[in] | _modelName | Name of the model state to get. |
common::Exception | When the _modelName doesn't exist. |
unsigned int GetModelStateCount | ( | ) | const |
Get the number of model states.
Returns the number of models in this instance.
ModelState_M GetModelStates | ( | const boost::regex & | _regex | ) | const |
Get model states based on a regular expression.
[in] | _regex | The regular expression. |
const ModelState_M& GetModelStates | ( | ) | const |
Get the model states.
|
inherited |
|
inherited |
Get the real time when this state was generated.
|
inherited |
Get the sim time when this state was generated.
|
inherited |
Get the wall time when this state was generated.
bool HasLightState | ( | const std::string & | _lightName | ) | const |
Return true if WorldState has a LightState with the given name.
[in] | _lightName | Name of the light to search for. |
bool HasModelState | ( | const std::string & | _modelName | ) | const |
Return true if WorldState has a ModelState with the given name.
[in] | _modelName | Name of the model to search for. |
const std::vector<std::string>& Insertions | ( | ) | const |
Get the vector of SDF insertions.
bool IsZero | ( | ) | const |
Return true if the values in the state are zero.
This will check to see if the all model states are zero.
unsigned int LightStateCount | ( | ) | const |
Get the number of light states.
Returns the number of lights in this instance.
const LightState_M& LightStates | ( | ) | const |
Get the light states.
void Load | ( | const WorldPtr | _world | ) |
Load from a World pointer.
Generate a WorldState from an instance of a World.
[in] | _world | Pointer to a world |
|
virtual |
Load state from SDF element.
Set a WorldState from an SDF element containing WorldState info.
[in] | _elem | Pointer to the WorldState SDF element. |
Reimplemented from State.
WorldState operator+ | ( | const WorldState & | _state | ) | const |
Addition operator.
[in] | _pt | A state to add. |
Subtraction operator.
[in] | _pt | A state to substract. |
WorldState operator- | ( | const WorldState & | _state | ) | const |
Subtraction operator.
[in] | _pt | A state to substract. |
WorldState& operator= | ( | const WorldState & | _state | ) |
void SetDeletions | ( | const std::vector< std::string > & | _deletions | ) |
Set a new vector of SDF deletions.
[in] | _deletions | Vector containing names of entities removed in the current simulation frame. |
void SetInsertions | ( | const std::vector< std::string > & | _insertions | ) |
Set a new vector of SDF insertions.
[in] | _insertions | Vector containing SDF blocks. Each block should contain the SDF of the new models spawned in the current simulation frame. |
|
virtual |
Set the simulation interations when this state was generated.
[in] | _iterations | Simulation iterations when the data was recorded. |
Reimplemented from State.
|
inherited |
|
virtual |
Set the real time when this state was generated.
[in] | _time | Clock time since simulation was stated. |
Reimplemented from State.
|
virtual |
Set the sim time when this state was generated.
[in] | _time | Simulation time when the data was recorded. |
Reimplemented from State.
|
virtual |
void SetWorld | ( | const WorldPtr | _world | ) |
Set the world.
[in] | _world | Pointer to the world. |
|
friend |
Stream insertion operator.
[in] | _out | output stream |
[in] | _state | World state to output |
|
protectedinherited |
The number of simulation iterations when this state was generated.
|
protectedinherited |
Name associated with this State.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Times for the state data.