CollisionState Class Reference

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

#include <physics/phyiscs.hh>

Inherits State.

Public Member Functions

 CollisionState ()
 Default constructor. More...
 
 CollisionState (const CollisionPtr _collision)
 Constructor. More...
 
 CollisionState (const sdf::ElementPtr _sdf)
 Constructor. More...
 
virtual ~CollisionState ()
 Destructor. 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...
 
std::string GetName () const
 Get the name associated with this State. More...
 
const math::Pose GetPose () const GAZEBO_DEPRECATED(8.0)
 Get the Collision 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...
 
common::Time GetWallTime () const
 Get the wall time when this state was generated. More...
 
bool IsZero () const
 Return true if the values in the state are zero. More...
 
virtual void Load (const sdf::ElementPtr _elem)
 Load state from SDF element. More...
 
CollisionState operator+ (const CollisionState &_state) const
 Addition operator. More...
 
State operator- (const State &_state) const
 Subtraction operator. More...
 
CollisionState operator- (const CollisionState &_state) const
 Subtraction operator. More...
 
CollisionStateoperator= (const CollisionState &_state)
 Assignment operator. More...
 
const ignition::math::Pose3d & Pose () const
 Get the Collision pose. More...
 
virtual void SetIterations (const uint64_t _iterations)
 Set the 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...
 
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...
 

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::CollisionState &_state)
 Stream insertion operator. More...
 

Detailed Description

Store state information of a physics::Collision object.

This class captures the entire state of a Collision at one specific time during a simulation run.

State of a Collision is its Pose.

Constructor & Destructor Documentation

Default constructor.

CollisionState ( const CollisionPtr  _collision)
explicit

Constructor.

Build a CollisionState from an existing Collision.

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

Constructor.

Build a CollisionState from SDF data

Parameters
[in]_sdfSDF data to load a collision state from.
virtual ~CollisionState ( )
virtual

Destructor.

Member Function Documentation

void FillSDF ( sdf::ElementPtr  _sdf)

Populate a state SDF element with data from the object.

Parameters
[out]_sdfSDF element to populate.
uint64_t GetIterations ( ) const
inherited

Get the iterations when this state was generated.

Returns
Iterations when the data was recorded
std::string GetName ( ) const
inherited

Get the name associated with this State.

Returns
Name associated with this state information. Typically a name of an Entity.
const math::Pose GetPose ( ) const

Get the Collision pose.

Returns
The pose of the CollisionState
Deprecated:
See function that returns ign-math.
common::Time GetRealTime ( ) const
inherited

Get the real time when this state was generated.

Returns
Clock time since simulation was stated.
common::Time GetSimTime ( ) const
inherited

Get the sim time when this state was generated.

Returns
Simulation time when the data was recorded.
common::Time GetWallTime ( ) const
inherited

Get the wall time when this state was generated.

Returns
The absolute clock time when the State data was recorded.
bool IsZero ( ) const

Return true if the values in the state are zero.

Returns
True if the values in the state are zero.
virtual void Load ( const sdf::ElementPtr  _elem)
virtual

Load state from SDF element.

Load CollisionState information from stored data in and SDF::Element

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

Reimplemented from State.

CollisionState operator+ ( const CollisionState _state) const

Addition operator.

Parameters
[in]_ptA state to add.
Returns
The resulting state.
State operator- ( const State _state) const
inherited

Subtraction operator.

Parameters
[in]_ptA state to substract.
Returns
The resulting state.
CollisionState operator- ( const CollisionState _state) const

Subtraction operator.

Parameters
[in]_ptA state to substract.
Returns
The resulting state.
CollisionState& operator= ( const CollisionState _state)

Assignment operator.

Parameters
[in]_stateState value
Returns
Reference to this
const ignition::math::Pose3d& Pose ( ) const

Get the Collision pose.

Returns
The pose of the CollisionState
virtual void SetIterations ( const uint64_t  _iterations)
virtualinherited

Set the iterations when this state was generated.

Parameters
[in]_iterationsIterations when the data was recorded.

Reimplemented in ModelState, LinkState, and WorldState.

void SetName ( const std::string &  _name)
inherited

Set the name associated with this State.

Parameters
[in]_nameName associated with this state information. Typically the name of an Entity.
virtual void SetRealTime ( const common::Time _time)
virtualinherited

Set the real time when this state was generated.

Parameters
[in]_timeClock time since simulation was stated.

Reimplemented in ModelState, LinkState, and WorldState.

virtual void SetSimTime ( const common::Time _time)
virtualinherited

Set the sim time when this state was generated.

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

Reimplemented in ModelState, LinkState, and WorldState.

virtual void SetWallTime ( const common::Time _time)
virtualinherited

Set the wall time when this state was generated.

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

Reimplemented in ModelState, LinkState, and WorldState.

Friends And Related Function Documentation

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

Stream insertion operator.

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

Member Data Documentation

uint64_t iterations = 0
protectedinherited

The number of simulation iterations when this state was generated.

std::string name
protectedinherited

Name associated with this State.

common::Time realTime
protectedinherited
common::Time simTime
protectedinherited
common::Time wallTime
protectedinherited

Times for the state data.


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