Store state information of a physics::Model object. More...
#include <physics/physics.hh>
Public Member Functions | |
ModelState () | |
Default constructor. | |
ModelState (const ModelPtr _model, const common::Time &_realTime, const common::Time &_simTime) | |
Constructor. | |
ModelState (const ModelPtr _model) | |
Constructor. | |
ModelState (const sdf::ElementPtr _sdf) | |
Constructor. | |
virtual | ~ModelState () |
Destructor. | |
void | FillSDF (sdf::ElementPtr _sdf) |
Populate a state SDF element with data from the object. | |
JointState | GetJointState (unsigned int _index) const |
Get a Joint state. | |
JointState | GetJointState (const std::string &_jointName) const |
Get a Joint state by Joint name. | |
unsigned int | GetJointStateCount () const |
Get the number of joint states. | |
JointState_M | GetJointStates (const boost::regex &_regex) const |
Get joint states based on a regular expression. | |
const JointState_M & | GetJointStates () const |
Get the joint states. | |
LinkState | GetLinkState (unsigned int _index) const GAZEBO_DEPRECATED(1.7) |
Get a link state. | |
LinkState | GetLinkState (const std::string &_linkName) const |
Get a link state by Link name. | |
unsigned int | GetLinkStateCount () const |
Get the number of link states. | |
LinkState_M | GetLinkStates (const boost::regex &_regex) const |
Get link states based on a regular expression. | |
const LinkState_M & | GetLinkStates () const |
Get the link states. | |
const math::Pose & | GetPose () const |
Get the stored model pose. | |
bool | HasJointState (const std::string &_jointName) const |
Return true if there is a joint with the specified name. | |
bool | HasLinkState (const std::string &_linkName) const |
Return true if there is a link with the specified name. | |
bool | IsZero () const |
Return true if the values in the state are zero. | |
void | Load (const ModelPtr _model, const common::Time &_realTime, const common::Time &_simTime) |
Load state from Model pointer. | |
virtual void | Load (const sdf::ElementPtr _elem) |
Load state from SDF element. | |
ModelState | operator+ (const ModelState &_state) const |
Addition operator. | |
ModelState | operator- (const ModelState &_state) const |
Subtraction operator. | |
ModelState & | operator= (const ModelState &_state) |
Assignment operator. | |
virtual void | SetRealTime (const common::Time &_time) |
Set the real time when this state was generated. | |
virtual void | SetSimTime (const common::Time &_time) |
Set the sim time when this state was generated. | |
virtual void | SetWallTime (const common::Time &_time) |
Set the wall time when this state was generated. | |
Public Member Functions inherited from gazebo::physics::State | |
State () | |
Default constructor. | |
State (const std::string &_name, const common::Time &_realTime, const common::Time &_simTime) | |
Constructor. | |
virtual | ~State () |
Destructor. | |
std::string | GetName () const |
Get the name associated with this State. | |
common::Time | GetRealTime () const |
Get the real time when this state was generated. | |
common::Time | GetSimTime () const |
Get the sim time when this state was generated. | |
common::Time | GetWallTime () const |
Get the wall time when this state was generated. | |
State | operator- (const State &_state) const |
Subtraction operator. | |
State & | operator= (const State &_state) |
Assignment operator. | |
void | SetName (const std::string &_name) |
Set the name associated with this State. |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const gazebo::physics::ModelState &_state) |
Stream insertion operator. |
Additional Inherited Members | |
Protected Attributes inherited from gazebo::physics::State | |
std::string | name |
Name associated with this State. | |
common::Time | realTime |
common::Time | simTime |
common::Time | wallTime |
Times for the state data. |
Store state information of a physics::Model object.
This class captures the entire state of a Model at one specific time during a simulation run.
State of a Model includes the state of all its child Links and Joints.
gazebo::physics::ModelState::ModelState | ( | ) |
Default constructor.
gazebo::physics::ModelState::ModelState | ( | const ModelPtr | _model, |
const common::Time & | _realTime, | ||
const common::Time & | _simTime | ||
) |
Constructor.
Build a ModelState from an existing Model.
[in] | _model | Pointer to the model from which to gather state info. |
[in] | _realTime | Real time stamp. |
[in] | _simTime | Sim time stamp. |
|
explicit |
Constructor.
Build a ModelState from an existing Model.
[in] | _model | Pointer to the model from which to gather state info. |
|
explicit |
Constructor.
Build a ModelState from SDF data
[in] | _sdf | SDF data to load a model state from. |
|
virtual |
Destructor.
void gazebo::physics::ModelState::FillSDF | ( | sdf::ElementPtr | _sdf | ) |
Populate a state SDF element with data from the object.
[out] | _sdf | SDF element to populate. |
JointState gazebo::physics::ModelState::GetJointState | ( | unsigned int | _index | ) | const |
Get a Joint state.
Return a JointState based on a index, where index is between 0...ModelState::GetJointStateCount().
[in] | _index | Index of a JointState. |
common::Exception | When _index is out of range. |
JointState gazebo::physics::ModelState::GetJointState | ( | const std::string & | _jointName | ) | const |
Get a Joint state by Joint name.
Searches through all JointStates. Returns the JointState with the matching name, if any.
[in] | _jointName | Name of the JointState. |
common::Exception | When _jointName is invalid. |
unsigned int gazebo::physics::ModelState::GetJointStateCount | ( | ) | const |
Get the number of joint states.
Returns the number of JointStates recorded.
JointState_M gazebo::physics::ModelState::GetJointStates | ( | const boost::regex & | _regex | ) | const |
Get joint states based on a regular expression.
[in] | _regex | The regular expression. |
const JointState_M& gazebo::physics::ModelState::GetJointStates | ( | ) | const |
Get the joint states.
LinkState gazebo::physics::ModelState::GetLinkState | ( | unsigned int | _index | ) | const |
Get a link state.
Get a Link State based on an index, where index is in the range of 0...ModelState::GetLinkStateCount
[in] | _index | Index of the LinkState |
common::Exception | When _index is out of range. |
LinkState gazebo::physics::ModelState::GetLinkState | ( | const std::string & | _linkName | ) | const |
unsigned int gazebo::physics::ModelState::GetLinkStateCount | ( | ) | const |
Get the number of link states.
This returns the number of Links recorded.
LinkState_M gazebo::physics::ModelState::GetLinkStates | ( | const boost::regex & | _regex | ) | const |
Get link states based on a regular expression.
[in] | _regex | The regular expression. |
const LinkState_M& gazebo::physics::ModelState::GetLinkStates | ( | ) | const |
Get the link states.
const math::Pose& gazebo::physics::ModelState::GetPose | ( | ) | const |
Get the stored model pose.
bool gazebo::physics::ModelState::HasJointState | ( | const std::string & | _jointName | ) | const |
Return true if there is a joint with the specified name.
[in] | _jointName | Name of the Jointtate. |
bool gazebo::physics::ModelState::HasLinkState | ( | const std::string & | _linkName | ) | const |
Return true if there is a link with the specified name.
[in] | _linkName | Name of the LinkState. |
bool gazebo::physics::ModelState::IsZero | ( | ) | const |
Return true if the values in the state are zero.
void gazebo::physics::ModelState::Load | ( | const ModelPtr | _model, |
const common::Time & | _realTime, | ||
const common::Time & | _simTime | ||
) |
Load state from Model pointer.
Build a ModelState from an existing Model.
[in] | _model | Pointer to the model from which to gather state info. |
[in] | _realTime | Real time stamp. |
[in] | _simTime | Sim time stamp. |
|
virtual |
Load state from SDF element.
Load ModelState information from stored data in and SDF::Element
[in] | _elem | Pointer to the SDF::Element containing state info. |
Reimplemented from gazebo::physics::State.
ModelState gazebo::physics::ModelState::operator+ | ( | const ModelState & | _state | ) | const |
Addition operator.
[in] | _pt | A state to substract. |
ModelState gazebo::physics::ModelState::operator- | ( | const ModelState & | _state | ) | const |
Subtraction operator.
[in] | _pt | A state to substract. |
ModelState& gazebo::physics::ModelState::operator= | ( | const ModelState & | _state | ) |
|
virtual |
Set the real time when this state was generated.
[in] | _time | Clock time since simulation was stated. |
Reimplemented from gazebo::physics::State.
|
virtual |
Set the sim time when this state was generated.
[in] | _time | Simulation time when the data was recorded. |
Reimplemented from gazebo::physics::State.
|
virtual |
Set the wall time when this state was generated.
[in] | _time | The absolute clock time when the State data was recorded. |
Reimplemented from gazebo::physics::State.
|
friend |
Stream insertion operator.
[in] | _out | output stream. |
[in] | _state | Model state to output. |