Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

TailWagMC Class Reference

A simple motion command for wagging the tail - you can specify period, magnitude, and tilt. More...

#include <TailWagMC.h>

Inheritance diagram for TailWagMC:

Detailed Description

A simple motion command for wagging the tail - you can specify period, magnitude, and tilt.

Definition at line 14 of file TailWagMC.h.

List of all members.

Public Member Functions

 TailWagMC ()
 constructor
 TailWagMC (unsigned int cyc_period, float cyc_magnitude)
 constructor
virtual ~TailWagMC ()
 destructor
virtual int updateOutputs ()
 is called once per update cycle, can do any processing you need to change your priorities or set output commands on the MotionManager
virtual int isDirty ()
 not used by MotionManager at the moment, but could be used to reduce recomputation, and you may find it useful
virtual void setDirty ()
virtual int isAlive ()
 used to prune "dead" motions from the MotionManager
void setPeriod (unsigned int p)
 sets the period of time between swings, in milliseconds
unsigned int getPeriod () const
 gets the period of time between swings, in milliseconds
void setMagnitude (float mag)
 sets the magnitude of swings, in radians
double getMagnitude () const
 gets the magnitude of swings, in radians
void setTilt (float r)
 sets the tilt of the tail while wagging, in radians
void unsetTilt ()
 makes the tilt control unspecified, will let something else control tilt
double getTilt () const
 gets the tilt of the tail while wagging, in radians
double getPan () const
 returns the most recent pan value of the tail while wagging, in radians
bool getActive ()
 returns true if this is currently trying to wag the tail
void setActive (bool a)
 turns the tail wagger on or off

Protected Attributes

unsigned int period
 period of time between swings, in milliseconds
float magnitude
 magnitude of swings, in radians
unsigned int offset
 offset in the period, only used if period is changed to avoid twitching
bool active
 true if this is currently trying to wag the tail
float last_pan
 last tail position
int last_sign
 sign of tail movement direction
OutputCmd tilt
 holds current setting for the tilt joint
OutputCmd pans [NumFrames]
 holds commands for planning ahead the wagging

Constructor & Destructor Documentation

TailWagMC::TailWagMC (  ) 

constructor

Definition at line 18 of file TailWagMC.h.

TailWagMC::TailWagMC ( unsigned int  cyc_period,
float  cyc_magnitude 
)

constructor

Definition at line 23 of file TailWagMC.h.

virtual TailWagMC::~TailWagMC (  )  [virtual]

destructor

Definition at line 28 of file TailWagMC.h.


Member Function Documentation

bool TailWagMC::getActive (  ) 

returns true if this is currently trying to wag the tail

Definition at line 96 of file TailWagMC.h.

double TailWagMC::getMagnitude (  )  const

gets the magnitude of swings, in radians

Definition at line 90 of file TailWagMC.h.

double TailWagMC::getPan (  )  const

returns the most recent pan value of the tail while wagging, in radians

Definition at line 94 of file TailWagMC.h.

unsigned int TailWagMC::getPeriod (  )  const

gets the period of time between swings, in milliseconds

Definition at line 88 of file TailWagMC.h.

double TailWagMC::getTilt (  )  const

gets the tilt of the tail while wagging, in radians

Definition at line 93 of file TailWagMC.h.

virtual int TailWagMC::isAlive (  )  [virtual]

used to prune "dead" motions from the MotionManager

note that a motion could be "paused" or inactive and therefore not dirty, but still alive, biding its time to "strike" ;)

Returns:
zero if the motion is still processing, non-zero otherwise

Implements MotionCommand.

Definition at line 78 of file TailWagMC.h.

virtual int TailWagMC::isDirty (  )  [virtual]

not used by MotionManager at the moment, but could be used to reduce recomputation, and you may find it useful

Returns:
zero if none of the commands have changed since last getJointCmd(), else non-zero

Implements MotionCommand.

Definition at line 75 of file TailWagMC.h.

void TailWagMC::setActive ( bool  a  ) 

turns the tail wagger on or off

Definition at line 99 of file TailWagMC.h.

virtual void TailWagMC::setDirty (  )  [virtual]

Definition at line 76 of file TailWagMC.h.

void TailWagMC::setMagnitude ( float  mag  ) 

sets the magnitude of swings, in radians

Definition at line 89 of file TailWagMC.h.

void TailWagMC::setPeriod ( unsigned int  p  ) 

sets the period of time between swings, in milliseconds

a bit complicated in order to avoid jerking around when the period changes

Definition at line 82 of file TailWagMC.h.

void TailWagMC::setTilt ( float  r  ) 

sets the tilt of the tail while wagging, in radians

Definition at line 91 of file TailWagMC.h.

void TailWagMC::unsetTilt (  ) 

makes the tilt control unspecified, will let something else control tilt

Definition at line 92 of file TailWagMC.h.

virtual int TailWagMC::updateOutputs (  )  [virtual]

is called once per update cycle, can do any processing you need to change your priorities or set output commands on the MotionManager

Returns:
zero if no changes were made, non-zero otherwise
See also:
RobotInfo::NumFrames
RobotInfo::FrameTime

Implements MotionCommand.

Definition at line 30 of file TailWagMC.h.


Member Data Documentation

bool TailWagMC::active [protected]

true if this is currently trying to wag the tail

Definition at line 109 of file TailWagMC.h.

Referenced by getActive(), isDirty(), setActive(), setDirty(), and updateOutputs().

last tail position

Definition at line 110 of file TailWagMC.h.

Referenced by getPan(), and updateOutputs().

int TailWagMC::last_sign [protected]

sign of tail movement direction

Definition at line 111 of file TailWagMC.h.

Referenced by setActive(), and updateOutputs().

magnitude of swings, in radians

Definition at line 107 of file TailWagMC.h.

Referenced by getMagnitude(), setMagnitude(), and updateOutputs().

unsigned int TailWagMC::offset [protected]

offset in the period, only used if period is changed to avoid twitching

Definition at line 108 of file TailWagMC.h.

Referenced by setPeriod(), and updateOutputs().

OutputCmd TailWagMC::pans[NumFrames] [protected]

holds commands for planning ahead the wagging

Definition at line 113 of file TailWagMC.h.

Referenced by updateOutputs().

unsigned int TailWagMC::period [protected]

period of time between swings, in milliseconds

Definition at line 106 of file TailWagMC.h.

Referenced by getPeriod(), setPeriod(), and updateOutputs().

holds current setting for the tilt joint

Definition at line 112 of file TailWagMC.h.

Referenced by getTilt(), setTilt(), unsetTilt(), and updateOutputs().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:17 2016 by Doxygen 1.6.3