#include <BB2004InvKinWalkingEngine.h>
Inheritance diagram for BB2004InvKinWalkingEngine:
Public Member Functions | |
BB2004InvKinWalkingEngine (InvKinWalkingEngine *pEngine) | |
Constructor. | |
~BB2004InvKinWalkingEngine () | |
Destructor. | |
virtual bool | executeParameterized (JointData &jointData, const WalkRequest &walkRequest, double positionInWalkingCycle) |
The function executes the walking engine. | |
bool | handleMessage (InMessage &message) |
The function handles a message sent by the PC. | |
Private Types | |
enum | { numOfIndividuals = 15, numOfFramesPerIndividual = 625, ignoreFrames = 250, useFrames = numOfFramesPerIndividual - ignoreFrames } |
Private Member Functions | |
void | learn (const WalkRequest &walkRequest) |
The function optimizes the gait for the current motion request. | |
void | setParameters (const BBIndividual &p) |
The function sets a new parameter set using the individual specified. | |
void | loadParameters (InvKinWalkingParameters ¶meters, const char *name) |
The function loads a set of walking parameters. | |
double | stdV (SensorData::sensors s) const |
The function calculates the standard deviation of the last "useFrames" measurements of a certain sensor. | |
void | updateOdometry () |
The function updates the odometry. | |
Private Attributes | |
InvKinWalkingEngine * | pEngine |
The address of the actual walking engine. | |
ERS7EvolveWalkingParameters | parameters [2] |
Two parameter sets that are interchangingly used. | |
ERS7EvolveWalkingParameters | bestParameters |
The best parameters found so far. | |
ERS7EvolveWalkingParameters | forward |
Parameters for forward walking. | |
ERS7EvolveWalkingParameters | fastForward |
Parameters for fast forward walking. | |
ERS7EvolveWalkingParameters | backward |
Parameters for backward walking. | |
ERS7EvolveWalkingParameters | stand |
Parameters for standing. | |
int | currentParameters |
The index that defines which of the two "parameters" are currently used. | |
int | currentIndividual |
The index of the current individual in the population. | |
int | currentFrame |
The index of the current frame that measures the performance of the current individual. | |
int | evolutions |
The number of evolutions done so far. | |
double | bestFitness |
The best overall fitness found so far. | |
Pose2D | odometrySpeed |
The current speed of the robot. | |
double | odometryScaleX |
The scale factor for odometry in x direction. | |
double | odometryScaleY |
The scale factor for odometry in y direction. | |
double | odometryScaleRotation |
The scale factor for odometry rotation. | |
double | odometryCounterRotation |
A factor that compensates rotation resulting from sideward motion. | |
RingBuffer< Vector2< double >, 100 > | odometrySums [2] |
The current state of the odometers. | |
FootPositions | prevPositions |
The previous positions of the feet. | |
RingBuffer< SensorData, numOfFramesPerIndividual > | buffer |
A buffer for previous sensor readings. | |
Pose2D | measured |
Accumulated odometry for current individual. | |
Pose2D | target |
Accumulated request motion for current individual. | |
BBPopulation< BBInvKinIndividual > * | population |
The population of individuals. |
Definition at line 115 of file BB2004InvKinWalkingEngine.h.
|
Definition at line 154 of file BB2004InvKinWalkingEngine.h. |
|
Constructor.
Definition at line 189 of file BB2004InvKinWalkingEngine.cpp. References backward, bestParameters, InFile::exists(), fastForward, forward, getRobotConfiguration(), RingBuffer< SensorData, numOfFramesPerIndividual >::init(), loadParameters(), odometryCounterRotation, odometryScaleRotation, odometryScaleX, and odometryScaleY. |
Here is the call graph for this function:
|
Destructor.
Definition at line 212 of file BB2004InvKinWalkingEngine.h. |
|
Here is the call graph for this function:
|
The function sets a new parameter set using the individual specified.
Definition at line 214 of file BB2004InvKinWalkingEngine.cpp. References InvKinWalkingParameters::CorrectionValues::backward, InvKinWalkingParameters::correctionValues, currentParameters, InvKinWalkingParameters::CorrectionValues::forward, InvKinWalkingParameters::init(), InvKinWalkingParameters::leaveAnytime, MAX_SPEED, InvKinWalkingParameters::maxStepSizeR, InvKinWalkingParameters::maxStepSizeX, InvKinWalkingParameters::maxStepSizeY, InvKinWalkingEngine::setParameters(), InvKinWalkingParameters::CorrectionValues::sideward, and InvKinWalkingParameters::CorrectionValues::turning. Referenced by learn(). |
Here is the call graph for this function:
|
The function loads a set of walking parameters.
Definition at line 228 of file BB2004InvKinWalkingEngine.cpp. References InFile::exists(), getRobotConfiguration(), and InvKinWalkingParameters::init(). Referenced by BB2004InvKinWalkingEngine(). |
Here is the call graph for this function:
|
The function calculates the standard deviation of the last "useFrames" measurements of a certain sensor.
Definition at line 367 of file BB2004InvKinWalkingEngine.cpp. References numOfFramesPerIndividual, and useFrames. Referenced by learn(). |
|
The function updates the odometry.
Definition at line 380 of file BB2004InvKinWalkingEngine.cpp. References RingBuffer< Vector2< double >, 100 >::add(), Kinematics::calcNeckAndLegPositions(), SensorData::data, RobotVertices::footPosition, SensorDataBuffer::frame, getDebugKeyTable(), InvKinWalkingEngine::getParameters(), InvKinWalkingParameters::hindWidth, DebugKeyTable::isActive(), measured, SensorDataBuffer::numOfFrames, odometryCounterRotation, odometryScaleRotation, odometryScaleX, odometryScaleY, odometrySpeed, odometrySums, BB2004InvKinWalkingEngine::FootPositions::onGround, BB2004InvKinWalkingEngine::FootPositions::positions, prevPositions, Pose2D::rotation, InvKinWalkingParameters::stepLen, Pose2D::translation, Vector2< V >::x, Vector2< double >::x, Vector3< V >::x, Vector2< V >::y, Vector2< double >::y, and Vector3< V >::y. Referenced by executeParameterized(). |
Here is the call graph for this function:
|
The function executes the walking engine.
Implements WalkingEngine. Definition at line 252 of file BB2004InvKinWalkingEngine.cpp. References backward, bestParameters, currentIndividual, InvKinWalkingEngine::executeParameterized(), fastForward, getDebugKeyTable(), DebugKeyTable::isActive(), learn(), Pose2D::rotation, InvKinWalkingEngine::setParameters(), Pose2D::translation, updateOdometry(), WalkRequest::walkParams, Vector2< double >::x, and Vector2< double >::y. |
Here is the call graph for this function:
|
The function handles a message sent by the PC.
Reimplemented from Module. Definition at line 437 of file BB2004InvKinWalkingEngine.cpp. References InMessage::bin, GenericDebugData::data, InMessage::getMessageID(), InvKinWalkingEngine::handleMessage(), idOdometryScale, odometryCounterRotation, odometryScaleRotation, odometryScaleX, and odometryScaleY. |
Here is the call graph for this function:
|
The address of the actual walking engine.
Definition at line 135 of file BB2004InvKinWalkingEngine.h. |
|
Two parameter sets that are interchangingly used.
Definition at line 136 of file BB2004InvKinWalkingEngine.h. |
|
The best parameters found so far.
Definition at line 136 of file BB2004InvKinWalkingEngine.h. Referenced by BB2004InvKinWalkingEngine(), executeParameterized(), and learn(). |
|
Parameters for forward walking.
Definition at line 136 of file BB2004InvKinWalkingEngine.h. Referenced by BB2004InvKinWalkingEngine(). |
|
Parameters for fast forward walking.
Definition at line 136 of file BB2004InvKinWalkingEngine.h. Referenced by BB2004InvKinWalkingEngine(), and executeParameterized(). |
|
Parameters for backward walking.
Definition at line 136 of file BB2004InvKinWalkingEngine.h. Referenced by BB2004InvKinWalkingEngine(), and executeParameterized(). |
|
Parameters for standing.
Definition at line 136 of file BB2004InvKinWalkingEngine.h. |
|
The index that defines which of the two "parameters" are currently used.
Definition at line 142 of file BB2004InvKinWalkingEngine.h. Referenced by setParameters(). |
|
The index of the current individual in the population.
Definition at line 143 of file BB2004InvKinWalkingEngine.h. Referenced by executeParameterized(), and learn(). |
|
The index of the current frame that measures the performance of the current individual.
Definition at line 144 of file BB2004InvKinWalkingEngine.h. |
|
The number of evolutions done so far.
Definition at line 145 of file BB2004InvKinWalkingEngine.h. |
|
The best overall fitness found so far.
Definition at line 146 of file BB2004InvKinWalkingEngine.h. Referenced by learn(). |
|
The current speed of the robot.
Definition at line 147 of file BB2004InvKinWalkingEngine.h. Referenced by updateOdometry(). |
|
The scale factor for odometry in x direction.
Definition at line 148 of file BB2004InvKinWalkingEngine.h. Referenced by BB2004InvKinWalkingEngine(), handleMessage(), and updateOdometry(). |
|
The scale factor for odometry in y direction.
Definition at line 148 of file BB2004InvKinWalkingEngine.h. Referenced by BB2004InvKinWalkingEngine(), handleMessage(), and updateOdometry(). |
|
The scale factor for odometry rotation.
Definition at line 148 of file BB2004InvKinWalkingEngine.h. Referenced by BB2004InvKinWalkingEngine(), handleMessage(), and updateOdometry(). |
|
A factor that compensates rotation resulting from sideward motion.
Definition at line 148 of file BB2004InvKinWalkingEngine.h. Referenced by BB2004InvKinWalkingEngine(), handleMessage(), and updateOdometry(). |
|
The current state of the odometers.
Definition at line 152 of file BB2004InvKinWalkingEngine.h. Referenced by updateOdometry(). |
|
The previous positions of the feet.
Definition at line 153 of file BB2004InvKinWalkingEngine.h. Referenced by updateOdometry(). |
|
A buffer for previous sensor readings.
Definition at line 161 of file BB2004InvKinWalkingEngine.h. |
|
Accumulated odometry for current individual.
Definition at line 162 of file BB2004InvKinWalkingEngine.h. Referenced by learn(), and updateOdometry(). |
|
Accumulated request motion for current individual.
Definition at line 162 of file BB2004InvKinWalkingEngine.h. Referenced by learn(). |
|
The population of individuals.
Definition at line 164 of file BB2004InvKinWalkingEngine.h. |