Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# GT2003MotionNetSpecialActions Class Reference

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

`#include <GT2003MotionNetSpecialActions.h>`

Inheritance diagram for GT2003MotionNetSpecialActions:

[legend]
Collaboration diagram for GT2003MotionNetSpecialActions:

[legend]
List of all members.

## Public Member Functions
| GT2003MotionNetSpecialActions (SpecialActionsInterfaces &interfaces)
virtual bool | executeParameterized (SpecialActionRequest specialActionRequest, JointData &jointData)
| Executes the special action.
virtual bool | specialActionIsExecutableInWalkingCycle (int specialActionID, double walkCycle)
virtual bool | handleMessage (InMessage &message)
| Called from a MessageQueue to distribute messages.
## Protected Member Functions
int | getMotionIndex (MotionRequest::MotionID motionType, SpecialActionRequest::SpecialActionID specialActionType)
| Get motion net motion index from motion type and special action id.
int | getMotionIndex (const SpecialActionRequest &request)
| Get motion net motion index from a MotionRequest.
bool | getNextData (const SpecialActionRequest &specialActionRequest)
| Get next motion node from motion net.
void | calculateJointData (JointData &jointData)
| Calculates the next joint data vector by interpolating if necessary.
void | readOdometryTable ()
| Read odometry table from file.
## Protected Attributes
MotionNetData | motionNetData
| The motion data array.
short | currentNode
| Current motion net node.
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]
| Odometry data table Contains one entry for each motion describing robot movement per tick.
MotionInfo | motionInfoTable [SpecialActionRequest::numOfSpecialAction+1]
| Head states for each special action.
MotionRequest | executedMotionRequestTable [SpecialActionRequest::numOfSpecialAction+1]
| A table for the executed motion requests.
OdometryEntry | currentOdometry
| Odometry of current motion.
SpecialActionRequest::SpecialActionID | lastSpecialActionType
| type of last executed special action

## 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 SpecialActionRequest::specialActionType.

## Member Function Documentation

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(), lastData, lastDataValid, lastSpecialActionType, GT2003MotionNetSpecialActions::OdometryEntry::o, and GT2003MotionNetSpecialActions::OdometryEntry::type.

Here is the call graph for this function:

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

| Implements SpecialActions. Definition at line 245 of file GT2003MotionNetSpecialActions.cpp. References GT2003MotionNetSpecialActions::OdometryEntry::leaveWalkCycleSections, odometryTable, and GT2003MotionNetSpecialActions::OdometryEntry::walkCycleDissection.

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.

Here is the call graph for this function:

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

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

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

| Get motion net motion index from a MotionRequest.

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, motionInfoTable, MotionInfo::motionIsStable, motionNetData, MotionRequest::motionType, MotionInfo::neckHeight, MotionNetData::nodeArray, odometryTable, MotionRequest::specialActionRequest, SpecialActionRequest::specialActionType, MotionNetNode::toExecutedMotionRequest(), MotionNetNode::toJointData(), and MotionNetNode::toPIDData(). Referenced by executeParameterized().

Here is the call graph for this function:

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, lastData, and lastDataValid. Referenced by executeParameterized().

void GT2003MotionNetSpecialActions::readOdometryTable | ( |  | ) | `[protected]`

| Read odometry table from file. Definition at line 31 of file GT2003MotionNetSpecialActions.cpp. References InStream< InFile, InConfig >::eof(), executedMotionRequestTable, InFile::exists(), getRobotConfiguration(), RobotConfiguration::getRobotDimensions(), idText, GT2003MotionNetSpecialActions::OdometryEntry::leaveWalkCycleSections, RobotDimensions::motionCycleTime, motionInfoTable, MotionRequest::motionType, MotionInfo::neckHeight, GT2003MotionNetSpecialActions::OdometryEntry::o, odometryTable, OUTPUT, MotionRequest::specialActionRequest, SpecialActionRequest::specialActionType, Pose2D::translation, GT2003MotionNetSpecialActions::OdometryEntry::type, GT2003MotionNetSpecialActions::OdometryEntry::walkCycleDissection, and Vector2< double >::x.

Here is the call graph for this function:

## Member Data Documentation

MotionNetData GT2003MotionNetSpecialActions::motionNetData`[protected]`

| The motion data array. Definition at line 58 of file GT2003MotionNetSpecialActions.h. Referenced by getNextData(), and handleMessage().

short GT2003MotionNetSpecialActions::currentNode`[protected]`

| Current motion net node. Definition at line 61 of file GT2003MotionNetSpecialActions.h. Referenced by executeParameterized(), and getNextData().

JointData GT2003MotionNetSpecialActions::currentData`[protected]`

| Current joint data. Definition at line 64 of file GT2003MotionNetSpecialActions.h. Referenced by calculateJointData(), executeParameterized(), 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().

bool GT2003MotionNetSpecialActions::interpolationMode`[protected]`

| True if values should be interpolated. Definition at line 71 of file GT2003MotionNetSpecialActions.h. Referenced by calculateJointData(), 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().

long GT2003MotionNetSpecialActions::dataRepetitionCounter`[protected]`

| Cycle counter for current data line. Definition at line 76 of file GT2003MotionNetSpecialActions.h. Referenced by calculateJointData(), executeParameterized(), and getNextData().

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

| Odometry data table Contains one entry for each motion describing robot movement per tick. Definition at line 107 of file GT2003MotionNetSpecialActions.h. Referenced by getNextData(), readOdometryTable(), and specialActionIsExecutableInWalkingCycle().

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

| Head states for each special action. Definition at line 110 of file GT2003MotionNetSpecialActions.h. Referenced by getNextData(), and readOdometryTable().

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

| A table for the executed motion requests. Definition at line 113 of file GT2003MotionNetSpecialActions.h. Referenced by readOdometryTable().

OdometryEntry GT2003MotionNetSpecialActions::currentOdometry`[protected]`

| Odometry of current motion. Definition at line 116 of file GT2003MotionNetSpecialActions.h. Referenced by executeParameterized(), and getNextData().

SpecialActionRequest::SpecialActionID GT2003MotionNetSpecialActions::lastSpecialActionType`[protected]`

| type of last executed special action Definition at line 122 of file GT2003MotionNetSpecialActions.h. Referenced by executeParameterized(), and getNextData().

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

- Modules/SpecialActions/GT2003MotionNetSpecialActions/GT2003MotionNetSpecialActions.h
- Modules/SpecialActions/GT2003MotionNetSpecialActions/GT2003MotionNetSpecialActions.cpp