All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Friends | List of all members
gazebo::physics::LinkState Class Reference

Store state information of a physics::Link object. More...

#include <physics/physics.hh>

Inheritance diagram for gazebo::physics::LinkState:
Inheritance graph
[legend]

Public Member Functions

 LinkState ()
 Default constructor.
 LinkState (const LinkPtr _link, const common::Time &_realTime, const common::Time &_simTime)
 Constructor.
 LinkState (const LinkPtr _link)
 Constructor.
 LinkState (const sdf::ElementPtr _sdf)
 Constructor.
virtual ~LinkState ()
 Destructor.
void FillSDF (sdf::ElementPtr _sdf)
 Populate a state SDF element with data from the object.
const math::PoseGetAcceleration () const
 Get the link acceleration.
CollisionState GetCollisionState (unsigned int _index) const
 Get a collision state.
CollisionState GetCollisionState (const std::string &_collisionName) const
 Get a link state by link name.
unsigned int GetCollisionStateCount () const
 Get the number of link states.
const std::vector
< CollisionState > & 
GetCollisionStates () const
 Get the collision states.
const math::PoseGetPose () const
 Get the link pose.
const math::PoseGetVelocity () const
 Get the link velocity.
const math::PoseGetWrench () 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)
 Load a LinkState from a Link pointer.
virtual void Load (const sdf::ElementPtr _elem)
 Load state from SDF element.
LinkState operator+ (const LinkState &_state) const
 Addition operator.
LinkState operator- (const LinkState &_state) const
 Subtraction operator.
LinkStateoperator= (const LinkState &_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.
Stateoperator= (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::LinkState &_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.

Detailed Description

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.

Constructor & Destructor Documentation

gazebo::physics::LinkState::LinkState ( )

Default constructor.

gazebo::physics::LinkState::LinkState ( const LinkPtr  _link,
const common::Time _realTime,
const common::Time _simTime 
)

Constructor.

Build a LinkState from an existing Link.

Parameters
[in]_modelPointer to the Link from which to gather state info.
[in]_realTimeReal time stamp.
[in]_simTimeSim time stamp
gazebo::physics::LinkState::LinkState ( const LinkPtr  _link)
explicit

Constructor.

Build a LinkState from an existing Link.

Parameters
[in]_modelPointer to the Link from which to gather state info.
gazebo::physics::LinkState::LinkState ( const sdf::ElementPtr  _sdf)
explicit

Constructor.

Build a LinkState from SDF data

Parameters
[in]_sdfSDF data to load a link state from.
virtual gazebo::physics::LinkState::~LinkState ( )
virtual

Destructor.

Member Function Documentation

void gazebo::physics::LinkState::FillSDF ( sdf::ElementPtr  _sdf)

Populate a state SDF element with data from the object.

Parameters
[out]_sdfSDF element to populate.
const math::Pose& gazebo::physics::LinkState::GetAcceleration ( ) const

Get the link acceleration.

Returns
The acceleration represented as a math::Pose.
CollisionState gazebo::physics::LinkState::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.

Parameters
[in]_indexIndex of the CollisionState.
Returns
State of the Collision.
Exceptions
common::ExceptionWhen _index is invalid.
CollisionState gazebo::physics::LinkState::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.

Parameters
[in]_collisionNameName of the CollisionState
Returns
State of the Collision.
Exceptions
common::ExceptionWhen _collisionName is invalid
unsigned int gazebo::physics::LinkState::GetCollisionStateCount ( ) const

Get the number of link states.

This returns the number of Collisions recorded.

Returns
Number of CollisionState recorded.
const std::vector<CollisionState>& gazebo::physics::LinkState::GetCollisionStates ( ) const

Get the collision states.

Returns
A vector of collision states.
const math::Pose& gazebo::physics::LinkState::GetPose ( ) const

Get the link pose.

Returns
The math::Pose of the Link.
const math::Pose& gazebo::physics::LinkState::GetVelocity ( ) const

Get the link velocity.

Returns
The velocity represented as a math::Pose.
const math::Pose& gazebo::physics::LinkState::GetWrench ( ) const

Get the force applied to the Link.

Returns
Magnitude of the force.
bool gazebo::physics::LinkState::IsZero ( ) const

Return true if the values in the state are zero.

Returns
True if the values in the state are zero.
void gazebo::physics::LinkState::Load ( const LinkPtr  _link,
const common::Time _realTime,
const common::Time _simTime 
)

Load a LinkState from a Link pointer.

Build a LinkState from an existing Link.

Parameters
[in]_modelPointer to the Link from which to gather state info.
[in]_realTimeReal time stamp.
[in]_simTimeSim time stamp
virtual void gazebo::physics::LinkState::Load ( const sdf::ElementPtr  _elem)
virtual

Load state from SDF element.

Load LinkState information from stored data in and SDF::Element.

Parameters
[in]_elemPointer to the SDF::Element containing state info.

Reimplemented from gazebo::physics::State.

LinkState gazebo::physics::LinkState::operator+ ( const LinkState _state) const

Addition operator.

Parameters
[in]_ptA state to add.
Returns
The resulting state.
LinkState gazebo::physics::LinkState::operator- ( const LinkState _state) const

Subtraction operator.

Parameters
[in]_ptA state to substract.
Returns
The resulting state.
LinkState& gazebo::physics::LinkState::operator= ( const LinkState _state)

Assignment operator.

Parameters
[in]_stateState value
Returns
this
virtual void gazebo::physics::LinkState::SetRealTime ( const common::Time _time)
virtual

Set the real time when this state was generated.

Parameters
[in]_timeClock time since simulation was stated.

Reimplemented from gazebo::physics::State.

virtual void gazebo::physics::LinkState::SetSimTime ( const common::Time _time)
virtual

Set the sim time when this state was generated.

Parameters
[in]_timeSimulation time when the data was recorded.

Reimplemented from gazebo::physics::State.

virtual void gazebo::physics::LinkState::SetWallTime ( const common::Time _time)
virtual

Set the wall time when this state was generated.

Parameters
[in]_timeThe absolute clock time when the State data was recorded.

Reimplemented from gazebo::physics::State.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  _out,
const gazebo::physics::LinkState _state 
)
friend

Stream insertion operator.

Parameters
[in]_outoutput stream
[in]_stateLink state to output
Returns
the stream

Disabling this for efficiency.

Disabling this for efficiency.


The documentation for this class was generated from the following file: