V-ART
|
A coordinated movement of joints in an articulated body. More...
#include <jointaction.h>
Classes | |
class | Initializer |
Public Member Functions | |
JointAction () | |
virtual | ~JointAction () |
JointMover * | AddJointMover (Joint *jointPtr, float newDuration, const Interpolator &interpolator) |
Adds a joint mover to the action. More... | |
JointMover * | AddJointMover (Joint *jointPtr, JointMover *jointMover) |
Used to add a copy of jointMover, aplied to jointPtr. More... | |
void | SetPriority (unsigned int newPriority) |
Sets the priority of an action. More... | |
void | GetFinalTimes (std::list< float > *resultPtr) |
Returns a ordered list with all different final times for every dof mover. More... | |
void | ModifyDofMovers (DMModifier &mod) |
Modifies dof movers. More... | |
DofMover * | SearchDofMover (Joint *jointPtr, Joint::DofID dof) |
Returns a dof mover. More... | |
void | GetJoints (std::list< Joint * > *listPtr) |
Returns a list of all target joints. More... | |
virtual void | Activate () |
Activates a JointAction. More... | |
Public Member Functions inherited from VART::BaseAction | |
BaseAction () | |
Creates an action with sane defaults. More... | |
virtual | ~BaseAction () |
void | SetSpeed (float newSpeed) |
void | SetDuration (float seconds) |
void | SetCyclic (bool value) |
bool | IsCyclic () |
bool | IsActive () const |
void | Deactivate (float seconds) |
Mark for auto deactivation in given time. More... | |
virtual void | Deactivate () |
Deactivate now. More... | |
Protected Member Functions | |
virtual void | Move () |
Make the action update its targets. More... | |
void | DeactivateDofMovers () |
void | AddToActiveInstancesList () |
Adds itself to list of active instances, in priority order. More... | |
Protected Member Functions inherited from VART::BaseAction | |
virtual void | ComputePositionIndex (bool *cycled) |
Computes current position index. More... | |
Protected Attributes | |
std::list< JointMover * > | jointMoverList |
unsigned int | priority |
Protected Attributes inherited from VART::BaseAction | |
bool | cyclic |
Whether the action restarts upon termination. More... | |
bool | active |
Whether the action is currently active (changing its target). More... | |
float | speedModifier |
Speed modifier. More... | |
float | duration |
Duration in seconds. More... | |
float | timeToLive |
Time (in seconds) to auto deactivate. More... | |
float | positionIndex |
Current position index. More... | |
float | lastPositionIndex |
Position index of last update. More... | |
Time | lastUpdateTime |
Time of last update. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &output, const JointAction &action) |
Additional Inherited Members | |
Static Public Member Functions inherited from VART::BaseAction | |
static unsigned int | MoveAllActive () |
Moves all active actions. More... | |
Public Attributes inherited from VART::BaseAction | |
std::string | description |
CallBack * | callbackPtr |
Termination callback. More... | |
Static Protected Attributes inherited from VART::BaseAction | |
static std::list< BaseAction * > | activeInstances |
List of active actions. More... | |
static std::list< Initializer * > | initializers |
List of action initializers. More... | |
A coordinated movement of joints in an articulated body.
Actions represent simple tasks such as walking, waving or scratching the head. They may be thought as an integration of key poses, interpolation schemes and time control. When the time period for a non-cyclic action terminates, it is automatically deactivated. They are implementated as a collection of joint movers (see JointMover).
Definition at line 26 of file jointaction.h.
VART::JointAction::JointAction | ( | ) |
Definition at line 38 of file jointaction.cpp.
|
inlinevirtual |
Definition at line 30 of file jointaction.h.
|
virtual |
Activates a JointAction.
Reimplemented from VART::BaseAction.
Definition at line 45 of file jointaction.cpp.
VART::JointMover * VART::JointAction::AddJointMover | ( | Joint * | jointPtr, |
float | newDuration, | ||
const Interpolator & | interpolator | ||
) |
Adds a joint mover to the action.
[in] | jointPtr | A pointer to the joint that will be controlled by the new joint mover. |
[in] | newDuration | Duration (in seconds) of the joint movement. |
[in] | interpolator | An interpolator instance that will control motion. |
Creates a new joint mover which is assigned to the action. The memory allocated by the joint mover will be deallocated by the action's destructor.
Definition at line 113 of file jointaction.cpp.
JointMover* VART::JointAction::AddJointMover | ( | Joint * | jointPtr, |
JointMover * | jointMover | ||
) |
Used to add a copy of jointMover, aplied to jointPtr.
|
protected |
Adds itself to list of active instances, in priority order.
Definition at line 60 of file jointaction.cpp.
References priority.
|
protected |
Definition at line 90 of file jointaction.cpp.
void VART::JointAction::GetFinalTimes | ( | std::list< float > * | resultPtr | ) |
Returns a ordered list with all different final times for every dof mover.
Definition at line 97 of file jointaction.cpp.
void VART::JointAction::GetJoints | ( | std::list< Joint * > * | listPtr | ) |
Returns a list of all target joints.
Definition at line 105 of file jointaction.cpp.
void VART::JointAction::ModifyDofMovers | ( | DMModifier & | mod | ) |
Modifies dof movers.
Definition at line 149 of file jointaction.cpp.
|
protectedvirtual |
Make the action update its targets.
Move is to be called from MoveAllActive.
Implements VART::BaseAction.
Definition at line 125 of file jointaction.cpp.
References VART::DofMover::cycle, VART::JointMover::goalTime, and VART::DofMover::priority.
VART::DofMover * VART::JointAction::SearchDofMover | ( | Joint * | jointPtr, |
Joint::DofID | dof | ||
) |
Returns a dof mover.
Searches for a DofMover that works on given joint and dof. Returns NULL if not found.
Definition at line 157 of file jointaction.cpp.
|
inline |
|
friend |
|
protected |
Definition at line 87 of file jointaction.h.
|
protected |
Definition at line 88 of file jointaction.h.
Referenced by AddToActiveInstancesList(), and SetPriority().