Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

MotionSequenceMC< MAXMOVE > Class Template Reference

Instantiates MotionSequenceEngines - when you want to run a motion sequence, make one of these. More...

#include <MotionSequenceMC.h>

Inheritance diagram for MotionSequenceMC< MAXMOVE >:

Detailed Description

template<unsigned int MAXMOVE>
class MotionSequenceMC< MAXMOVE >

Instantiates MotionSequenceEngines - when you want to run a motion sequence, make one of these.

Allows a compile-time variable amount of data storage through its template parameter.

See also:
MotionSequenceEngine for the majority of the usage documentation
TinyMotionSequenceMC, SmallMotionSequenceMC, MediumMotionSequenceMC, LargeMotionSequenceMC, XLargeMotionSequenceMC

Definition at line 16 of file MotionSequenceMC.h.

List of all members.

Public Member Functions

 MotionSequenceMC ()
 constructor
 MotionSequenceMC (const std::string &filename)
 constructor, loads from a file and then resets the playtime to beginning and begins to play
virtual ~MotionSequenceMC ()
 destructor
virtual int isDirty ()
 not used by MotionManager at the moment, but could be used to reduce recomputation, and you may find it useful
virtual int isAlive ()
 used to prune "dead" motions from the MotionManager
virtual void setDirty ()
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 void clear ()
 empties out the sequence (constant time operation - faster than a series of pops)
virtual unsigned int getMaxFrames () const
 returns the maximum number of key frames (Move's) which can be stored, determined by the instantiating MotionSequenceMC's template parameter
virtual unsigned int getUsedFrames () const
 returns the number of used key frames (Move's) which have been stored by the instantiation MotionSequenceEngine subclass

Static Public Attributes

static const unsigned int CAPACITY = MAXMOVE
 allows recovery of capacity in a general way (MAXMOVE may, and probably will, be obscured by a typedef)

Protected Types

typedef ListMemBuf< Move,
MAXMOVE, Move_idx_t
list_t
 shorthand for the ListMemBuf that stores all of the movement frames

Protected Member Functions

virtual MovegetKeyFrame (Move_idx_t x)
 returns moves[x]
virtual const MovegetKeyFrame (Move_idx_t x) const
 returns moves[x]
virtual Move_idx_t newKeyFrame ()
 causes subclass to create a new Move structure, returns its index
virtual void eraseKeyFrame (Move_idx_t x)
 marks keyframe x unused
bool setRange (unsigned int t, Move_idx_t &prev, Move_idx_t &next) const
 advances (or rewinds) prev and next so that t falls between them

Protected Attributes

list_t moves
 stores all of the movement keyframes
bool dirty
 true if last updateOutputs was dirty, so we know when to post status event

Member Typedef Documentation

template<unsigned int MAXMOVE>
typedef ListMemBuf<Move,MAXMOVE,Move_idx_t> MotionSequenceMC< MAXMOVE >::list_t [protected]

shorthand for the ListMemBuf that stores all of the movement frames

Definition at line 96 of file MotionSequenceMC.h.


Constructor & Destructor Documentation

template<unsigned int MAXMOVE>
MotionSequenceMC< MAXMOVE >::MotionSequenceMC (  ) 

constructor

Definition at line 21 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
MotionSequenceMC< MAXMOVE >::MotionSequenceMC ( const std::string &  filename  )  [explicit]

constructor, loads from a file and then resets the playtime to beginning and begins to play

Definition at line 27 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
virtual MotionSequenceMC< MAXMOVE >::~MotionSequenceMC (  )  [virtual]

destructor

Definition at line 35 of file MotionSequenceMC.h.


Member Function Documentation

template<unsigned int MAXMOVE>
virtual void MotionSequenceMC< MAXMOVE >::clear (  )  [virtual]

empties out the sequence (constant time operation - faster than a series of pops)

Implements MotionSequenceEngine.

Definition at line 77 of file MotionSequenceMC.h.

Referenced by MotionSequenceMC< MAXMOVE >::MotionSequenceMC().

template<unsigned int MAXMOVE>
virtual void MotionSequenceMC< MAXMOVE >::eraseKeyFrame ( Move_idx_t  x  )  [protected, virtual]

marks keyframe x unused

Implements MotionSequenceEngine.

Definition at line 111 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
virtual const Move& MotionSequenceMC< MAXMOVE >::getKeyFrame ( Move_idx_t  x  )  const [protected, virtual]

returns moves[x]

Implements MotionSequenceEngine.

Definition at line 103 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
virtual Move& MotionSequenceMC< MAXMOVE >::getKeyFrame ( Move_idx_t  x  )  [protected, virtual]

returns moves[x]

Implements MotionSequenceEngine.

Definition at line 102 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
virtual unsigned int MotionSequenceMC< MAXMOVE >::getMaxFrames (  )  const [virtual]

returns the maximum number of key frames (Move's) which can be stored, determined by the instantiating MotionSequenceMC's template parameter

Implements MotionSequenceEngine.

Definition at line 91 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
virtual unsigned int MotionSequenceMC< MAXMOVE >::getUsedFrames (  )  const [virtual]

returns the number of used key frames (Move's) which have been stored by the instantiation MotionSequenceEngine subclass

Implements MotionSequenceEngine.

Definition at line 92 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
virtual int MotionSequenceMC< MAXMOVE >::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 38 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
virtual int MotionSequenceMC< MAXMOVE >::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 37 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
virtual Move_idx_t MotionSequenceMC< MAXMOVE >::newKeyFrame (  )  [protected, virtual]

causes subclass to create a new Move structure, returns its index

Implements MotionSequenceEngine.

Definition at line 104 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
virtual void MotionSequenceMC< MAXMOVE >::setDirty (  )  [virtual]

Definition at line 40 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
bool MotionSequenceMC< MAXMOVE >::setRange ( unsigned int  t,
Move_idx_t prev,
Move_idx_t next 
) const [protected, virtual]

advances (or rewinds) prev and next so that t falls between them

Implements MotionSequenceEngine.

Definition at line 113 of file MotionSequenceMC.h.

Referenced by MotionSequenceMC< MAXMOVE >::updateOutputs().

template<unsigned int MAXMOVE>
virtual int MotionSequenceMC< MAXMOVE >::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 43 of file MotionSequenceMC.h.


Member Data Documentation

template<unsigned int MAXMOVE>
const unsigned int MotionSequenceMC< MAXMOVE >::CAPACITY = MAXMOVE [static]

allows recovery of capacity in a general way (MAXMOVE may, and probably will, be obscured by a typedef)

Definition at line 18 of file MotionSequenceMC.h.

template<unsigned int MAXMOVE>
bool MotionSequenceMC< MAXMOVE >::dirty [protected]

true if last updateOutputs was dirty, so we know when to post status event

Definition at line 100 of file MotionSequenceMC.h.

Referenced by MotionSequenceMC< MAXMOVE >::setDirty(), and MotionSequenceMC< MAXMOVE >::updateOutputs().


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

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