Kuon  1.1.3
RoadNarrows Robotics Large Outdoor Mobile Robot Project
kuon::KuonJointStatePoint Class Reference

Joint state point class. More...

#include <kuonJoint.h>

Public Member Functions

 KuonJointStatePoint ()
 Default constructor.
 
 KuonJointStatePoint (const KuonJointStatePoint &src)
 Copy constructor.
 
 ~KuonJointStatePoint ()
 Destructor.
 
KuonJointStatePoint operator= (const KuonJointStatePoint &rhs)
 Assignment operator. More...
 
std::string getKinematicChainName ()
 Get the kinematic chain name. More...
 
void setKinematicChainName (std::string strKinName)
 Set the kinematic chain name. More...
 
size_t getNumPoints ()
 Get the number of joint states in joint state point. More...
 
bool hasJoint (const std::string &strJointName)
 Test if joint is a member of the joint state. More...
 
void append (const KuonJointState &jointState)
 Append joint state to end of joint state point. More...
 
KuonJointStateoperator[] (const size_t i)
 Subscript operator to get reference to joint point at the given index. More...
 
KuonJointStateoperator[] (const std::string &strJointName)
 Key subscript operator to get reference to joint point at the given index. More...
 
void clear ()
 Clear all state data.
 

Protected Attributes

std::string m_strKinName
 name of kinematic chain
 
std::vector< KuonJointStatem_jointState
 vector of joint states
 

Detailed Description

Joint state point class.

This class encapsulates the current state of all joints in a kinematic chain.

A joint state point (J0, J1, ..., Jn-1) specifies the current dynamic state of a set of joints (kinematic chain) Ji, i=0,n-1.

Definition at line 217 of file kuonJoint.h.

Member Function Documentation

void kuon::KuonJointStatePoint::append ( const KuonJointState jointState)
inline

Append joint state to end of joint state point.

Parameters
jointStateJoint state to append.

Definition at line 302 of file kuonJoint.h.

Referenced by kuon::KuonRobot::getJointState().

303  {
304  m_jointState.push_back(jointState);
305  }
std::vector< KuonJointState > m_jointState
vector of joint states
Definition: kuonJoint.h:345
std::string kuon::KuonJointStatePoint::getKinematicChainName ( )
inline

Get the kinematic chain name.

Returns
String.

Definition at line 263 of file kuonJoint.h.

264  {
265  return m_strKinName;
266  }
std::string m_strKinName
name of kinematic chain
Definition: kuonJoint.h:344
size_t kuon::KuonJointStatePoint::getNumPoints ( )
inline

Get the number of joint states in joint state point.

Returns
Number of points.

Definition at line 283 of file kuonJoint.h.

284  {
285  return m_jointState.size();
286  }
std::vector< KuonJointState > m_jointState
vector of joint states
Definition: kuonJoint.h:345
bool KuonJointStatePoint::hasJoint ( const std::string &  strJointName)

Test if joint is a member of the joint state.

Parameters
strJointNameJoint name.
Returns
Returns true or false.

Definition at line 193 of file kuonJoint.cxx.

194 {
195  vector<KuonJointState>::iterator iter;
196 
197  for(iter = m_jointState.begin(); iter != m_jointState.end(); ++iter)
198  {
199  if( iter->m_strName == strJointName )
200  {
201  return true;
202  }
203  }
204  return false;
205 }
std::vector< KuonJointState > m_jointState
vector of joint states
Definition: kuonJoint.h:345
KuonJointStatePoint kuon::KuonJointStatePoint::operator= ( const KuonJointStatePoint rhs)
inline

Assignment operator.

Parameters
rhsRight hand side object.
Returns
Returns copy of this.

Definition at line 250 of file kuonJoint.h.

References m_jointState, and m_strKinName.

251  {
252  m_strKinName = rhs.m_strKinName;
253  m_jointState = rhs.m_jointState;
254 
255  return *this;
256  }
std::vector< KuonJointState > m_jointState
vector of joint states
Definition: kuonJoint.h:345
std::string m_strKinName
name of kinematic chain
Definition: kuonJoint.h:344
KuonJointState& kuon::KuonJointStatePoint::operator[] ( const size_t  i)
inline

Subscript operator to get reference to joint point at the given index.

Big boy warranty. No out of bound checks are made.

Parameters
iIndex.
Returns
Joint state.

Definition at line 317 of file kuonJoint.h.

318  {
319  return m_jointState[i];
320  }
std::vector< KuonJointState > m_jointState
vector of joint states
Definition: kuonJoint.h:345
KuonJointState& kuon::KuonJointStatePoint::operator[] ( const std::string &  strJointName)

Key subscript operator to get reference to joint point at the given index.

Big boy warranty. No out of bound checks are made.

Parameters
strJointNameJoint name.
Returns
Joint state.
void kuon::KuonJointStatePoint::setKinematicChainName ( std::string  strKinName)
inline

Set the kinematic chain name.

Parameters
String.

Definition at line 273 of file kuonJoint.h.

Referenced by kuon::KuonRobot::getJointState().

274  {
275  m_strKinName = strKinName;
276  }
std::string m_strKinName
name of kinematic chain
Definition: kuonJoint.h:344

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