Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

DynamicMotionSequence Class Reference

Uses STL's vector for dynamic memory allocation - don't use this as a motion command, pointers in shared memory regions can be invalid in other processes. More...

#include <DynamicMotionSequence.h>

Inheritance diagram for DynamicMotionSequence:

Detailed Description

Uses STL's vector for dynamic memory allocation - don't use this as a motion command, pointers in shared memory regions can be invalid in other processes.

See MotionSequenceEngine for documentation on its members

Definition at line 13 of file DynamicMotionSequence.h.

List of all members.

Public Member Functions

 DynamicMotionSequence ()
 constructor
 DynamicMotionSequence (const char *filename)
 constructor, loads from a file and then resets the playtime to beginning and begins to play
virtual ~DynamicMotionSequence ()
 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
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

Protected Types

typedef std::vector< Movelist_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
std::vector< Move_idx_terased
 recycles erased keyframes, can't just shift elements in moves, it would throw off index numbers in Move structures
bool dirty
 true if last updateOutputs was dirty, so we know when to post status event

Member Typedef Documentation

typedef std::vector<Move> DynamicMotionSequence::list_t [protected]

shorthand for the ListMemBuf that stores all of the movement frames

Definition at line 88 of file DynamicMotionSequence.h.


Constructor & Destructor Documentation

DynamicMotionSequence::DynamicMotionSequence (  ) 

constructor

Definition at line 10 of file DynamicMotionSequence.h.

Referenced by DynamicMotionSequence().

DynamicMotionSequence::DynamicMotionSequence ( const char *  filename  )  [explicit]

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

Definition at line 13 of file DynamicMotionSequence.h.

virtual DynamicMotionSequence::~DynamicMotionSequence (  )  [virtual]

destructor

Definition at line 20 of file DynamicMotionSequence.h.


Member Function Documentation

virtual void DynamicMotionSequence::clear (  )  [virtual]

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

Implements MotionSequenceEngine.

Definition at line 70 of file DynamicMotionSequence.h.

Referenced by DynamicMotionSequence(), and ~DynamicMotionSequence().

virtual void DynamicMotionSequence::eraseKeyFrame ( Move_idx_t  x  )  [protected, virtual]

marks keyframe x unused

Implements MotionSequenceEngine.

Definition at line 108 of file DynamicMotionSequence.h.

virtual const Move& DynamicMotionSequence::getKeyFrame ( Move_idx_t  x  )  const [protected, virtual]

returns moves[x]

Implements MotionSequenceEngine.

Definition at line 96 of file DynamicMotionSequence.h.

virtual Move& DynamicMotionSequence::getKeyFrame ( Move_idx_t  x  )  [protected, virtual]

returns moves[x]

Implements MotionSequenceEngine.

Definition at line 95 of file DynamicMotionSequence.h.

virtual unsigned int DynamicMotionSequence::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 83 of file DynamicMotionSequence.h.

virtual unsigned int DynamicMotionSequence::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 84 of file DynamicMotionSequence.h.

virtual int DynamicMotionSequence::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 37 of file DynamicMotionSequence.h.

virtual int DynamicMotionSequence::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 36 of file DynamicMotionSequence.h.

virtual Move_idx_t DynamicMotionSequence::newKeyFrame (  )  [protected, virtual]

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

Implements MotionSequenceEngine.

Definition at line 97 of file DynamicMotionSequence.h.

void DynamicMotionSequence::setDirty (  ) 

Definition at line 39 of file DynamicMotionSequence.h.

bool DynamicMotionSequence::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 110 of file DynamicMotionSequence.h.

virtual int DynamicMotionSequence::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 41 of file DynamicMotionSequence.h.


Member Data Documentation

bool DynamicMotionSequence::dirty [protected]

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

Definition at line 93 of file DynamicMotionSequence.h.

Referenced by DynamicMotionSequence().

std::vector<Move_idx_t> DynamicMotionSequence::erased [protected]

recycles erased keyframes, can't just shift elements in moves, it would throw off index numbers in Move structures

Definition at line 92 of file DynamicMotionSequence.h.

Referenced by DynamicMotionSequence().

stores all of the movement keyframes

Definition at line 91 of file DynamicMotionSequence.h.

Referenced by DynamicMotionSequence(), and newKeyFrame().


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

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