Store state information of a physics::Link object. More...
#include <physics/physics.hh>
Inherits State.
Public Member Functions | |
LinkState () | |
Default constructor. More... | |
LinkState (const LinkPtr _link, const common::Time &_realTime, const common::Time &_simTime, const uint64_t _iterations) | |
Constructor. More... | |
LinkState (const LinkPtr _link) | |
Constructor. More... | |
LinkState (const sdf::ElementPtr _sdf) | |
Constructor. More... | |
virtual | ~LinkState () |
Destructor. More... | |
const ignition::math::Pose3d & | Acceleration () const |
Get the link acceleration. More... | |
void | FillSDF (sdf::ElementPtr _sdf) |
Populate a state SDF element with data from the object. More... | |
const math::Pose | GetAcceleration () const GAZEBO_DEPRECATED(8.0) |
Get the link acceleration. More... | |
CollisionState | GetCollisionState (unsigned int _index) const |
Get a collision state. More... | |
CollisionState | GetCollisionState (const std::string &_collisionName) const |
Get a link state by link name. More... | |
unsigned int | GetCollisionStateCount () const |
Get the number of link states. More... | |
const std::vector < CollisionState > & | GetCollisionStates () const |
Get the collision states. More... | |
uint64_t | GetIterations () const |
Get the iterations when this state was generated. More... | |
std::string | GetName () const |
Get the name associated with this State. More... | |
const math::Pose | GetPose () const GAZEBO_DEPRECATED(8.0) |
Get the link pose. 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... | |
const math::Pose | GetVelocity () const GAZEBO_DEPRECATED(8.0) |
Get the link velocity. More... | |
common::Time | GetWallTime () const |
Get the wall time when this state was generated. More... | |
const math::Pose | GetWrench () const GAZEBO_DEPRECATED(8.0) |
Get the force applied to the Link. More... | |
bool | IsZero () const |
Return true if the values in the state are zero. More... | |
void | Load (const LinkPtr _link, const common::Time &_realTime, const common::Time &_simTime, const uint64_t _iterations) |
Load a LinkState from a Link pointer. More... | |
virtual void | Load (const sdf::ElementPtr _elem) |
Load state from SDF element. More... | |
LinkState | operator+ (const LinkState &_state) const |
Addition operator. More... | |
State | operator- (const State &_state) const |
Subtraction operator. More... | |
LinkState | operator- (const LinkState &_state) const |
Subtraction operator. More... | |
LinkState & | operator= (const LinkState &_state) |
Assignment operator. More... | |
const ignition::math::Pose3d & | Pose () const |
Get the link pose. More... | |
bool | RecordVelocity () const |
Get whether link velocity is recorded. More... | |
virtual void | SetIterations (const uint64_t _iterations) |
Set the simulation iterations 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... | |
void | SetRecordVelocity (const bool _record) |
Set whether to record link velocity. 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... | |
const ignition::math::Pose3d & | Velocity () const |
Get the link velocity. More... | |
const ignition::math::Pose3d & | Wrench () const |
Get the force and torque applied to the Link. More... | |
Protected Attributes | |
uint64_t | iterations = 0 |
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::LinkState &_state) |
Stream insertion operator. More... | |
Store state information of a physics::Link object.
This class captures the entire state of a Link at one specific time during a simulation run.
State of a Link includes the state of itself all its child Collision entities.
LinkState | ( | ) |
Default constructor.
LinkState | ( | const LinkPtr | _link, |
const common::Time & | _realTime, | ||
const common::Time & | _simTime, | ||
const uint64_t | _iterations | ||
) |
|
explicit |
|
virtual |
Destructor.
const ignition::math::Pose3d& Acceleration | ( | ) | const |
Get the link acceleration.
void FillSDF | ( | sdf::ElementPtr | _sdf | ) |
Populate a state SDF element with data from the object.
[out] | _sdf | SDF element to populate. |
const math::Pose GetAcceleration | ( | ) | const |
Get the link acceleration.
CollisionState GetCollisionState | ( | unsigned int | _index | ) | const |
Get a collision state.
Get a Collision State based on an index, where index is in the range of 0...LinkState::GetCollisionStateCount.
[in] | _index | Index of the CollisionState. |
common::Exception | When _index is invalid. |
CollisionState GetCollisionState | ( | const std::string & | _collisionName | ) | const |
Get a link state by link name.
Searches through all CollisionStates. Returns the CollisionState with the matching name, if any.
[in] | _collisionName | Name of the CollisionState |
common::Exception | When _collisionName is invalid |
unsigned int GetCollisionStateCount | ( | ) | const |
Get the number of link states.
This returns the number of Collisions recorded.
const std::vector<CollisionState>& GetCollisionStates | ( | ) | const |
Get the collision states.
|
inherited |
Get the iterations when this state was generated.
|
inherited |
const math::Pose GetPose | ( | ) | const |
Get the link pose.
|
inherited |
Get the real time when this state was generated.
|
inherited |
Get the sim time when this state was generated.
const math::Pose GetVelocity | ( | ) | const |
Get the link velocity.
|
inherited |
Get the wall time when this state was generated.
const math::Pose GetWrench | ( | ) | const |
Get the force applied to the Link.
bool IsZero | ( | ) | const |
Return true if the values in the state are zero.
void Load | ( | const LinkPtr | _link, |
const common::Time & | _realTime, | ||
const common::Time & | _simTime, | ||
const uint64_t | _iterations | ||
) |
|
virtual |
Addition operator.
[in] | _pt | A state to add. |
Subtraction operator.
[in] | _pt | A state to substract. |
Subtraction operator.
[in] | _pt | A state to substract. |
const ignition::math::Pose3d& Pose | ( | ) | const |
Get the link pose.
bool RecordVelocity | ( | ) | const |
Get whether link velocity is recorded.
|
virtual |
Set the simulation iterations 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.
void SetRecordVelocity | ( | const bool | _record | ) |
Set whether to record link velocity.
[in] | _record | True to record link velocity, false to leave it out of the log |
|
virtual |
Set the sim time when this state was generated.
[in] | _time | Simulation time when the data was recorded. |
Reimplemented from State.
|
virtual |
const ignition::math::Pose3d& Velocity | ( | ) | const |
Get the link velocity.
const ignition::math::Pose3d& Wrench | ( | ) | const |
Get the force and torque applied to the Link.
|
friend |
Stream insertion operator.
[in] | _out | output stream |
[in] | _state | Link state to output |
Disabling this for efficiency.
Disabling this for efficiency.
|
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.