GT2004MotionControl Class Reference

#include <GT2004MotionControl.h>

Inheritance diagram for GT2004MotionControl:

MotionControl MotionStabilizer Module MotionControlInterfaces RobotDimensions MessageHandler List of all members.

Public Member Functions

 GT2004MotionControl (ModuleHandler &moduleHandler, const MotionControlInterfaces &interfaces)
 ~GT2004MotionControl ()
virtual void execute ()
virtual bool handleMessage (InMessage &message)

Protected Types

 stand
 walk
 specialAction
 getup
 wakeUp
 playDead
enum  {
  stand, walk, specialAction, getup,
  wakeUp, playDead
}

Protected Member Functions

void determineMotionControlState ()
void setMotionControlState ()
void wagTail (const MotionRequest &motionRequest, const SensorData &sensorData, JointData &jointData)

Protected Attributes

MotionRequest::MotionID lastMotionType
WalkingEnginepWalkingEngine [WalkRequest::numOfWalkType]
SpecialActionspSpecialActions
GetupEngineSelectorpGetupEngine
InvKinWalkingEnginepInvKinWalkingEngine
ModuleHandlermoduleHandler
int tailCount
long lastHeadTilt
long lastHeadPan
long lastHeadRoll
WakeUpEngine wakeUpEngine
bool wakingUp
bool changeOfMotionControlStatePossible
double positionInWalkCycle
WalkRequest latestWalkRequest
SpecialActionRequest latestSpecialActionRequest
enum GT2004MotionControl:: { ... }  motionControlState

Detailed Description

The default solution for the module MotionControl. Integrates head joint values from the head control, joint values from walking or special action engines and LED values from the LED control.

Definition at line 31 of file GT2004MotionControl.h.


Member Enumeration Documentation

anonymous enum [protected]

The state of the MotionControl

Enumerator:
stand 
walk 
specialAction 
getup 
wakeUp 
playDead 

Definition at line 123 of file GT2004MotionControl.h.


Constructor & Destructor Documentation

GT2004MotionControl::GT2004MotionControl ( ModuleHandler moduleHandler,
const MotionControlInterfaces interfaces 
)

Constructor

Parameters:
interfaces The paramters of the MotionControl module.
moduleHandler A reference to the ModuleHandler of the Process.

Definition at line 22 of file GT2004MotionControl.cpp.

References MotionControlInterfaces::bodyPosture, WalkRequest::dash, WalkRequest::debug, MotionControlInterfaces::gt2004Parameters, MotionControlInterfaces::invKinWalkingParameters, lastHeadPan, lastHeadRoll, lastHeadTilt, lastMotionType, moduleHandler, MotionControlInterfaces::motionInfo, MotionControlInterfaces::motionRequest, WalkRequest::normal, MotionControlInterfaces::odometryData, pGetupEngine, MotionControlInterfaces::pidData, pInvKinWalkingEngine, pSpecialActions, pWalkingEngine, MotionControlInterfaces::receivedNewSensorData, MotionControlInterfaces::sensorDataBuffer, WalkRequest::turnKick, WalkRequest::turnWithBall, WalkRequest::upsideDown, wakingUp, SolutionRequest::walkingEngineNormal, and MotionControlInterfaces::walkParameterTimeStamp.

GT2004MotionControl::~GT2004MotionControl (  ) 

Destructor

Definition at line 74 of file GT2004MotionControl.cpp.

References WalkRequest::dash, WalkRequest::debug, SolutionRequest::getupEngine, moduleHandler, WalkRequest::normal, pGetupEngine, pInvKinWalkingEngine, pSpecialActions, pWalkingEngine, ModuleHandler::setModuleSelector(), WalkRequest::turnKick, WalkRequest::turnWithBall, WalkRequest::upsideDown, and SolutionRequest::walkingEngineNormal.


Member Function Documentation

void GT2004MotionControl::determineMotionControlState (  )  [protected]

determines the state of the MotionControl

Definition at line 90 of file GT2004MotionControl.cpp.

References changeOfMotionControlStatePossible, getup, motionControlState, MotionControlInterfaces::motionRequest, MotionRequest::motionType, MotionRequest::playDead, playDead, positionInWalkCycle, pSpecialActions, setMotionControlState(), MotionRequest::specialAction, specialAction, SpecialActions::specialActionIsExecutableInWalkingCycle(), MotionRequest::specialActionRequest, SpecialActionRequest::specialActionType, stand, wakeUp, and walk.

Referenced by execute().

void GT2004MotionControl::execute (  )  [virtual]

Executes the module

Todo:
: wagTail(sensorDataBuffer.lastFrame(), currentFrame);

Implements Module.

Definition at line 162 of file GT2004MotionControl.cpp.

References changeOfMotionControlStatePossible, PIDData::d, determineMotionControlState(), WakeUpEngine::execute(), MotionInfo::executedMotionRequest, SpecialActions::executeParameterized(), WalkingEngine::executeParameterized(), GetupEngineSelector::executeParameterized(), SensorDataBuffer::frame, JointDataBuffer::frame, MotionControlInterfaces::frameNumber, MotionRequest::getup, getup, MotionControlInterfaces::headIsBlockedBySpecialActionOrWalk, MotionControlInterfaces::headMotionRequest, JointData::headPan, JointData::headTilt, PIDData::i, MotionControlInterfaces::jointDataBuffer, jointDataBufferNumOfFrames, jointDataInvalidValue, lastHeadPan, lastHeadRoll, lastHeadTilt, lastMotionType, latestSpecialActionRequest, latestWalkRequest, motionControlState, MotionControlInterfaces::motionInfo, MotionControlInterfaces::motionRequest, MotionRequest::motionType, HeadMotionRequest::mouth, JointData::mouth, JointData::neckTilt, WalkRequest::normal, JointData::numOfJoint, MotionControlInterfaces::odometryData, PIDData::p, HeadMotionRequest::pan, pGetupEngine, MotionControlInterfaces::pidData, MotionRequest::playDead, playDead, MotionInfo::positionInWalkCycle, positionInWalkCycle, pSpecialActions, pWalkingEngine, HeadMotionRequest::roll, MotionControlInterfaces::sensorDataBuffer, specialAction, MotionRequest::specialAction, MotionRequest::specialActionRequest, MotionStabilizer::stabilize(), MotionRequest::stand, stand, HeadMotionRequest::tilt, wakeUp, wakeUpEngine, walk, MotionRequest::walk, WalkRequest::walkParams, MotionRequest::walkRequest, and WalkRequest::walkType.

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

Called from a MessageQueue to distribute messages. Use message.getMessageID to decide if the message is relavant for the MesssageHandler derivate. Use message.bin, message.text or message.config as In streams to get the data from.

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

Reimplemented from Module.

Definition at line 613 of file GT2004MotionControl.cpp.

References InMessage::bin, d, WalkRequest::debug, InMessage::getMessageID(), Module::handleMessage(), idGenericDebugData, idInvKinWalkingParameters, idMotionNet, idOdometryScale, idText, GenericDebugData::motionStabilizer, WalkRequest::normal, OUTPUT, pSpecialActions, pWalkingEngine, PIDsmoothedValue::setWeightP(), MotionStabilizer::stabilizerScale, text, MotionStabilizer::xFore, MotionStabilizer::xHind, MotionStabilizer::yLeft, and MotionStabilizer::yRight.

void GT2004MotionControl::setMotionControlState (  )  [protected]

sets the MotionControlState accordingly

Definition at line 141 of file GT2004MotionControl.cpp.

References getup, MotionRequest::getup, motionControlState, MotionControlInterfaces::motionRequest, MotionRequest::motionType, playDead, MotionRequest::playDead, specialAction, MotionRequest::specialAction, stand, MotionRequest::stand, walk, and MotionRequest::walk.

Referenced by determineMotionControlState().

void GT2004MotionControl::wagTail ( const MotionRequest motionRequest,
const SensorData sensorData,
JointData jointData 
) [protected]

executes the tail wag requested by motion request

Definition at line 319 of file GT2004MotionControl.cpp.

References SensorData::data, JointData::data, TailRequest::eightPositionSwitch, TailRequest::fivePositionSwitch, TailRequest::fourPositionSwitchCorners, TailRequest::fourPositionSwitchUpDownLeftRight, SensorData::headPan, jointDataInvalidValue, RobotDimensions::jointLimitTailPanN, RobotDimensions::jointLimitTailPanP, RobotDimensions::jointLimitTailTiltN, RobotDimensions::jointLimitTailTiltP, MotionControlInterfaces::motionRequest, SensorData::neckTilt, TailRequest::noTailWag, pi, sgn, TailRequest::stayAsForced, TailRequest::stayAsForcedPan, TailRequest::stayAsForcedTilt, TailRequest::tailCenterBottom, TailRequest::tailCenterCenter, TailRequest::tailCenterTop, tailCount, TailRequest::tailFollowsHead, TailRequest::tailLeftBottom, TailRequest::tailLeftCenter, TailRequest::tailLeftTop, SensorData::tailPan, JointData::tailPan, TailRequest::tailParallelToGround, MotionRequest::tailRequest, TailRequest::tailRequestID, TailRequest::tailRightBottom, TailRequest::tailRightCenter, TailRequest::tailRightTop, SensorData::tailTilt, JointData::tailTilt, TailRequest::threePositionSwitchHorizontal, TailRequest::threePositionSwitchVertical, toMicroRad(), TailRequest::twoPositionSwitchHorizontal, TailRequest::twoPositionSwitchVertical, TailRequest::wagHorizontal, TailRequest::wagHorizontalFast, TailRequest::wagLeftRightHorizontal, TailRequest::wagLeftRightVertical, TailRequest::wagUpDownLeft, TailRequest::wagUpDownRight, TailRequest::wagVertical, and TailRequest::wagVerticalFast.


Member Data Documentation

bool GT2004MotionControl::changeOfMotionControlStatePossible [protected]

the last executed Motion indicated, that itīs possible to execute the motionRequest from Cognition

Definition at line 111 of file GT2004MotionControl.h.

Referenced by determineMotionControlState(), and execute().

long GT2004MotionControl::lastHeadPan [protected]

Previous head pan.

Definition at line 95 of file GT2004MotionControl.h.

Referenced by execute(), and GT2004MotionControl().

long GT2004MotionControl::lastHeadRoll [protected]

Previous head roll.

Definition at line 95 of file GT2004MotionControl.h.

Referenced by execute(), and GT2004MotionControl().

long GT2004MotionControl::lastHeadTilt [protected]

Previous head tilt.

Definition at line 95 of file GT2004MotionControl.h.

Referenced by execute(), and GT2004MotionControl().

MotionRequest::MotionID GT2004MotionControl::lastMotionType [protected]

which module was used before

Definition at line 69 of file GT2004MotionControl.h.

Referenced by execute(), and GT2004MotionControl().

SpecialActionRequest GT2004MotionControl::latestSpecialActionRequest [protected]

The latest SpecialActionRequest

Definition at line 120 of file GT2004MotionControl.h.

Referenced by execute().

WalkRequest GT2004MotionControl::latestWalkRequest [protected]

The latest WalkRequest

Definition at line 117 of file GT2004MotionControl.h.

Referenced by execute().

ModuleHandler& GT2004MotionControl::moduleHandler [protected]

A reference to the ModuleHandler of the Process. Needed to create new solutions.

Definition at line 90 of file GT2004MotionControl.h.

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

enum { ... } GT2004MotionControl::motionControlState [protected]

The state of the MotionControl

Referenced by determineMotionControlState(), execute(), and setMotionControlState().

GetupEngineSelector* GT2004MotionControl::pGetupEngine [protected]

a pointer to the GetupEngine module

Definition at line 78 of file GT2004MotionControl.h.

Referenced by execute(), GT2004MotionControl(), and ~GT2004MotionControl().

InvKinWalkingEngine* GT2004MotionControl::pInvKinWalkingEngine [protected]

a point to the single instance of the InvKinWalkingEngine this is called by all different walk types using different parameter sets

Definition at line 84 of file GT2004MotionControl.h.

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

double GT2004MotionControl::positionInWalkCycle [protected]

the last cycle we were in

Definition at line 114 of file GT2004MotionControl.h.

Referenced by determineMotionControlState(), and execute().

SpecialActions* GT2004MotionControl::pSpecialActions [protected]

a pointer to the SpecialActions module

Definition at line 75 of file GT2004MotionControl.h.

Referenced by determineMotionControlState(), execute(), GT2004MotionControl(), handleMessage(), and ~GT2004MotionControl().

WalkingEngine* GT2004MotionControl::pWalkingEngine[WalkRequest::numOfWalkType] [protected]

pointer to the WalkingEngine modules one for each walking type

Definition at line 72 of file GT2004MotionControl.h.

Referenced by execute(), GT2004MotionControl(), handleMessage(), and ~GT2004MotionControl().

int GT2004MotionControl::tailCount [protected]

counter used in wagTail

Definition at line 93 of file GT2004MotionControl.h.

Referenced by wagTail().

WakeUpEngine GT2004MotionControl::wakeUpEngine [protected]

Definition at line 106 of file GT2004MotionControl.h.

Referenced by execute().

bool GT2004MotionControl::wakingUp [protected]

Definition at line 108 of file GT2004MotionControl.h.

Referenced by GT2004MotionControl().


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