GT2003MotionNetSpecialActions Class Reference

#include <GT2003MotionNetSpecialActions.h>

Inheritance diagram for GT2003MotionNetSpecialActions:

SpecialActions Module SpecialActionsInterfaces MessageHandler List of all members.

Public Member Functions

 GT2003MotionNetSpecialActions (SpecialActionsInterfaces &interfaces)
virtual bool executeParameterized (SpecialActionRequest specialActionRequest, JointData &jointData)
virtual bool specialActionIsExecutableInWalkingCycle (int specialActionID, double walkCycle)
virtual bool handleMessage (InMessage &message)

Protected Member Functions

int getMotionIndex (MotionRequest::MotionID motionType, SpecialActionRequest::SpecialActionID specialActionType)
int getMotionIndex (const SpecialActionRequest &request)
bool getNextData (const SpecialActionRequest &specialActionRequest)
void calculateJointData (JointData &jointData)
void readOdometryTable ()

Protected Attributes

MotionNetData motionNetData
short currentNode
JointData currentData
 Current joint data.
JointData lastData
 Last data for interpolation.
bool lastDataValid
 Last data was set.
bool interpolationMode
 True if values should be interpolated.
long dataRepetitionLength
 Length of current data line in cycles.
long dataRepetitionCounter
 Cycle counter for current data line.
OdometryEntry odometryTable [SpecialActionRequest::numOfSpecialAction+1]
MotionInfo motionInfoTable [SpecialActionRequest::numOfSpecialAction+1]
MotionRequest executedMotionRequestTable [SpecialActionRequest::numOfSpecialAction+1]
OdometryEntry currentOdometry
SpecialActionRequest::SpecialActionID lastSpecialActionType

Classes

class  OdometryEntry

Detailed Description

This module executes special actions by using the GT2003 motion net compiler

Definition at line 18 of file GT2003MotionNetSpecialActions.h.


Constructor & Destructor Documentation

GT2003MotionNetSpecialActions::GT2003MotionNetSpecialActions ( SpecialActionsInterfaces interfaces  ) 

Definition at line 14 of file GT2003MotionNetSpecialActions.cpp.

References int(), and SpecialActionRequest::specialActionType.


Member Function Documentation

void GT2003MotionNetSpecialActions::calculateJointData ( JointData jointData  )  [protected]

Calculates the next joint data vector by interpolating if necessary

Definition at line 192 of file GT2003MotionNetSpecialActions.cpp.

References currentData, JointData::data, dataRepetitionCounter, dataRepetitionLength, interpolationMode, jointDataInvalidValue, lastData, lastDataValid, and JointData::numOfJoint.

Referenced by executeParameterized().

bool GT2003MotionNetSpecialActions::executeParameterized ( SpecialActionRequest  specialActionRequest,
JointData jointData 
) [virtual]

Executes the special action

Implements SpecialActions.

Definition at line 208 of file GT2003MotionNetSpecialActions.cpp.

References calculateJointData(), Pose2D::conc(), currentData, currentNode, currentOdometry, dataRepetitionCounter, getNextData(), GT2003MotionNetSpecialActions::OdometryEntry::homogeneous, lastData, lastDataValid, SpecialActionsInterfaces::lastMotionType, lastSpecialActionType, GT2003MotionNetSpecialActions::OdometryEntry::none, SpecialActionRequest::numOfSpecialAction, GT2003MotionNetSpecialActions::OdometryEntry::o, SpecialActionsInterfaces::odometryData, GT2003MotionNetSpecialActions::OdometryEntry::once, MotionRequest::specialAction, and GT2003MotionNetSpecialActions::OdometryEntry::type.

int GT2003MotionNetSpecialActions::getMotionIndex ( const SpecialActionRequest request  )  [protected]

Get motion net motion index from a MotionRequest

int GT2003MotionNetSpecialActions::getMotionIndex ( MotionRequest::MotionID  motionType,
SpecialActionRequest::SpecialActionID  specialActionType 
) [protected]

Get motion net motion index from motion type and special action id

bool GT2003MotionNetSpecialActions::getNextData ( const SpecialActionRequest specialActionRequest  )  [protected]

Get next motion node from motion net

Definition at line 118 of file GT2003MotionNetSpecialActions.cpp.

References MotionInfo::bodyTilt, currentData, currentNode, currentOdometry, MotionNetNode::d, dataRepetitionCounter, dataRepetitionLength, MotionInfo::executedMotionRequest, interpolationMode, MotionNetData::label_extern_start, lastSpecialActionType, SpecialActionsInterfaces::motionInfo, motionInfoTable, MotionInfo::motionIsStable, motionNetData, SpecialActionsInterfaces::motionRequest, MotionRequest::motionType, MotionInfo::neckHeight, MotionNetData::nodeArray, odometryTable, SpecialActionsInterfaces::pidData, MotionRequest::specialAction, MotionRequest::specialActionRequest, SpecialActionRequest::specialActionType, MotionNetNode::toExecutedMotionRequest(), MotionNetNode::toJointData(), MotionNetNode::toPIDData(), MotionNetNode::typeConditionalTransition, MotionNetNode::typeData, MotionNetNode::typePID, and MotionNetNode::typeTransition.

Referenced by executeParameterized().

bool GT2003MotionNetSpecialActions::handleMessage ( InMessage message  )  [virtual]

Called from a MessageQueue to distribute messages.

Parameters:
message The message that can be read.
Returns:
true if the message was read (handled).

Reimplemented from Module.

Definition at line 182 of file GT2003MotionNetSpecialActions.cpp.

References InMessage::config, InMessage::getMessageID(), idMotionNet, MotionNetData::load(), and motionNetData.

void GT2003MotionNetSpecialActions::readOdometryTable (  )  [protected]

Read odometry table from file

Definition at line 31 of file GT2003MotionNetSpecialActions.cpp.

References MotionInfo::bodyTilt, InStream< S, R >::eof(), MotionInfo::executedMotionRequest, executedMotionRequestTable, InFile::exists(), Pose2D::fromAngle(), getRobotConfiguration(), RobotConfiguration::getRobotDimensions(), SpecialActionRequest::getSpecialActionIDName(), GT2003MotionNetSpecialActions::OdometryEntry::homogeneous, idText, OdometryData::leaveWalkCycleSections, RobotDimensions::motionCycleTime, motionInfoTable, MotionInfo::motionIsStable, MotionRequest::motionType, MotionInfo::neckHeight, GT2003MotionNetSpecialActions::OdometryEntry::none, SpecialActionRequest::numOfSpecialAction, GT2003MotionNetSpecialActions::OdometryEntry::o, odometryTable, GT2003MotionNetSpecialActions::OdometryEntry::once, OUTPUT, Pose2D::rotation, MotionRequest::specialAction, MotionRequest::specialActionRequest, SpecialActionRequest::specialActionType, text, Pose2D::translation, GT2003MotionNetSpecialActions::OdometryEntry::type, OdometryData::walkCycleDissection, Vector2< V >::x, and Vector2< V >::y.

bool GT2003MotionNetSpecialActions::specialActionIsExecutableInWalkingCycle ( int  specialActionID,
double  walkCycle 
) [virtual]

Implements SpecialActions.

Definition at line 244 of file GT2003MotionNetSpecialActions.cpp.

References OdometryData::leaveWalkCycleSections, GT2003MotionNetSpecialActions::OdometryEntry::o, odometryTable, and OdometryData::walkCycleDissection.


Member Data Documentation

JointData GT2003MotionNetSpecialActions::currentData [protected]

Current joint data.

Definition at line 64 of file GT2003MotionNetSpecialActions.h.

Referenced by calculateJointData(), executeParameterized(), and getNextData().

short GT2003MotionNetSpecialActions::currentNode [protected]

Current motion net node

Definition at line 61 of file GT2003MotionNetSpecialActions.h.

Referenced by executeParameterized(), and getNextData().

OdometryEntry GT2003MotionNetSpecialActions::currentOdometry [protected]

Odometry of current motion

Definition at line 112 of file GT2003MotionNetSpecialActions.h.

Referenced by executeParameterized(), and getNextData().

long GT2003MotionNetSpecialActions::dataRepetitionCounter [protected]

Cycle counter for current data line.

Definition at line 76 of file GT2003MotionNetSpecialActions.h.

Referenced by calculateJointData(), executeParameterized(), and getNextData().

long GT2003MotionNetSpecialActions::dataRepetitionLength [protected]

Length of current data line in cycles.

Definition at line 74 of file GT2003MotionNetSpecialActions.h.

Referenced by calculateJointData(), and getNextData().

MotionRequest GT2003MotionNetSpecialActions::executedMotionRequestTable[SpecialActionRequest::numOfSpecialAction+1] [protected]

A table for the executed motion requests

Definition at line 109 of file GT2003MotionNetSpecialActions.h.

Referenced by readOdometryTable().

bool GT2003MotionNetSpecialActions::interpolationMode [protected]

True if values should be interpolated.

Definition at line 71 of file GT2003MotionNetSpecialActions.h.

Referenced by calculateJointData(), and getNextData().

JointData GT2003MotionNetSpecialActions::lastData [protected]

Last data for interpolation.

Definition at line 66 of file GT2003MotionNetSpecialActions.h.

Referenced by calculateJointData(), and executeParameterized().

bool GT2003MotionNetSpecialActions::lastDataValid [protected]

Last data was set.

Definition at line 69 of file GT2003MotionNetSpecialActions.h.

Referenced by calculateJointData(), and executeParameterized().

SpecialActionRequest::SpecialActionID GT2003MotionNetSpecialActions::lastSpecialActionType [protected]

type of last executed special action

Definition at line 118 of file GT2003MotionNetSpecialActions.h.

Referenced by executeParameterized(), and getNextData().

MotionInfo GT2003MotionNetSpecialActions::motionInfoTable[SpecialActionRequest::numOfSpecialAction+1] [protected]

Head states for each special action

Definition at line 106 of file GT2003MotionNetSpecialActions.h.

Referenced by getNextData(), and readOdometryTable().

MotionNetData GT2003MotionNetSpecialActions::motionNetData [protected]

The motion data array

Definition at line 58 of file GT2003MotionNetSpecialActions.h.

Referenced by getNextData(), and handleMessage().

OdometryEntry GT2003MotionNetSpecialActions::odometryTable[SpecialActionRequest::numOfSpecialAction+1] [protected]

Odometry data table Contains one entry for each motion describing robot movement per tick.

Definition at line 103 of file GT2003MotionNetSpecialActions.h.

Referenced by getNextData(), readOdometryTable(), and specialActionIsExecutableInWalkingCycle().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:32:48 2006 for DT2005.panorama by  doxygen 1.4.7