DOFStatusListener Class Reference

A class listening to joint status modifications. More...

Inheritance diagram for DOFStatusListener:

Public Member Functions

 DOFStatusListener (const PhyDOF *dof, Qt::ConnectionType connType=Qt::DirectConnection)
 Constructor.
 
 ~DOFStatusListener ()
 Destructor.
 
real position () const
 Returns the current expected position for the DOF.
 
void update ()
 Call this to compute the new expected position for the DOF.
 

Protected Attributes

real m_curPosition
 The current expected position for the DOF.
 
real m_desideredPosition
 The desidered DOF position.
 
const PhyDOF *const m_dof
 The DOF whose changes we listen to.
 
PhyDOF::MotionMode m_motionMode
 The kind of motion control.
 
real m_velocity
 The DOF velocity.
 

Detailed Description

A class listening to joint status modifications.

This class is used by PhyObjectsGroup to be notified of changes of an individual joint of a chain.

Definition at line 106 of file phyicubhelpers.h.

Constructor & Destructor Documentation

DOFStatusListener ( const PhyDOF dof,
Qt::ConnectionType  connType = Qt::DirectConnection 
)

Constructor.

Parameters
dofthe DOF whose changes we listen to. Never pass a dof that has a NULL associated joint, otherwise a crash could occur in the update function (where we use joint to get the world timestep)
connTypethe type of connection between dof signals and our slots

Definition at line 128 of file phyicubhelpers.cpp.

References DOFStatusListener::m_dof.

Destructor.

Definition at line 142 of file phyicubhelpers.cpp.

Member Function Documentation

real position ( ) const
inline

Returns the current expected position for the DOF.

Returns
the current expected position for the DOF

Definition at line 142 of file phyicubhelpers.h.

void update ( )

Call this to compute the new expected position for the DOF.

Call position() after this function to get the new expected position for the DOF

Definition at line 147 of file phyicubhelpers.cpp.

References PhyDOF::joint(), PhyDOF::limits(), DOFStatusListener::m_curPosition, DOFStatusListener::m_desideredPosition, DOFStatusListener::m_dof, DOFStatusListener::m_motionMode, DOFStatusListener::m_velocity, farsa::ramp(), World::timeStep(), and PhyJoint::world().

Member Data Documentation

real m_curPosition
protected

The current expected position for the DOF.

This is the position computed by update(), not the effective position of the DOF

Definition at line 182 of file phyicubhelpers.h.

Referenced by DOFStatusListener::update().

real m_desideredPosition
protected

The desidered DOF position.

Definition at line 187 of file phyicubhelpers.h.

Referenced by DOFStatusListener::update().

const PhyDOF* const m_dof
protected

The DOF whose changes we listen to.

Definition at line 174 of file phyicubhelpers.h.

Referenced by DOFStatusListener::DOFStatusListener(), and DOFStatusListener::update().

PhyDOF::MotionMode m_motionMode
protected

The kind of motion control.

Here we only accept PhyDOF::vel, PhyDOF::pos and PhyDOF::off (it makes no sense to use PhyDOF::force)

Definition at line 200 of file phyicubhelpers.h.

Referenced by DOFStatusListener::update().

real m_velocity
protected

The DOF velocity.

Definition at line 192 of file phyicubhelpers.h.

Referenced by DOFStatusListener::update().


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