#include <GT2004SensorDataProcessor.h>
Inheritance diagram for GT2004SensorDataProcessor:
Definition at line 28 of file GT2004SensorDataProcessor.h.
GT2004SensorDataProcessor::GT2004SensorDataProcessor | ( | const SensorDataProcessorInterfaces & | interfaces | ) |
Constructor
interfaces | The paramters of the HeadControl module. |
Definition at line 16 of file GT2004SensorDataProcessor.cpp.
void GT2004SensorDataProcessor::buildCameraMatrix | ( | const SensorData & | sensorData, | |
const BodyPosture & | bP, | |||
CameraMatrix & | cameraMatrix | |||
) | [protected, virtual] |
calculates the offset and the rotation of the camera matrix
Definition at line 152 of file GT2004SensorDataProcessor.cpp.
References BodyPosture::bodyTiltCalculatedFromLegSensors, Kinematics::calculateCameraMatrix(), SensorDataProcessorInterfaces::cameraMatrix, SensorData::data, SensorData::frameNumber, fromMicroRad(), SensorData::headPan, SensorData::headTilt, CameraMatrix::isValid, SensorDataProcessorInterfaces::motionInfo, MotionInfo::motionIsStable, BodyPosture::neckHeightCalculatedFromLegSensors, SensorData::neckTilt, and CameraMatrix::setFrameNumber().
Referenced by execute().
void GT2004SensorDataProcessor::buildPSDPercept | ( | const SensorData & | sensorData, | |
const CameraMatrix & | cameraMatrix, | |||
SinglePSDPercept & | psdPercept | |||
) | [private] |
calculates a spot relative to the robot that was detected by the PSD sensor
Definition at line 163 of file GT2004SensorDataProcessor.cpp.
References SensorData::bodyPsd, SensorDataProcessorInterfaces::cameraMatrix, SensorData::data, SensorData::frameNumber, fromMicroRad(), SensorData::headPsdFar, CameraMatrix::isValid, SensorData::neckTilt, SensorData::psd, SensorDataProcessorInterfaces::psdPercept, Pose3D::rotation, Pose3D::translation, Vector3< V >::x, Vector3< V >::y, and Vector3< V >::z.
Referenced by execute().
void GT2004SensorDataProcessor::calculateBodyPostureFromAccelerationSensors | ( | const SensorData & | sensorData, | |
BodyPosture & | bP | |||
) | [private] |
Definition at line 299 of file GT2004SensorDataProcessor.cpp.
References SensorData::accelerationX, SensorData::accelerationY, SensorData::accelerationZ, BodyPosture::bodyRollCalculatedFromAccelerationSensors, BodyPosture::bodyTiltCalculatedFromAccelerationSensors, SensorData::data, SensorDataBuffer::lastFrame(), and SensorDataProcessorInterfaces::sensorDataBuffer.
Referenced by execute().
void GT2004SensorDataProcessor::calculateBodyPostureFromLegSensors | ( | const SensorData & | sensorData, | |
BodyPosture & | bP | |||
) | [private] |
Definition at line 289 of file GT2004SensorDataProcessor.cpp.
References RobotVertices::bodyRoll, BodyPosture::bodyRollCalculatedFromLegSensors, RobotVertices::bodyTilt, BodyPosture::bodyTiltCalculatedFromLegSensors, Kinematics::calcNeckAndLegPositions(), SensorDataBuffer::lastFrame(), RobotVertices::neckHeight, BodyPosture::neckHeightCalculatedFromLegSensors, and SensorDataProcessorInterfaces::sensorDataBuffer.
Referenced by execute().
bool GT2004SensorDataProcessor::detectFallDown | ( | ) | [protected, virtual] |
detects whether the robot fell down.
Definition at line 218 of file GT2004SensorDataProcessor.cpp.
References gravity, gt2004SensorDataProcessorFalldownRollAngle, gt2004SensorDataProcessorFalldownTiltAngle, Vector3< V >::x, Vector3< V >::y, and Vector3< V >::z.
Referenced by execute().
BodyPercept::MouthStates GT2004SensorDataProcessor::detectMouthState | ( | ) | [private] |
Definition at line 238 of file GT2004SensorDataProcessor.cpp.
References SensorData::data, SensorDataBuffer::lastFrame(), SensorData::mouth, BodyPercept::mouthClosed, BodyPercept::mouthOpen, and SensorDataProcessorInterfaces::sensorDataBuffer.
Referenced by execute().
bool GT2004SensorDataProcessor::detectPickup | ( | const Vector3< double > & | gravity, | |
const Vector3< double > & | acceleration | |||
) | [private] |
Definition at line 230 of file GT2004SensorDataProcessor.cpp.
References gravity.
Referenced by execute().
int GT2004SensorDataProcessor::detectSwitches | ( | ) | [private] |
Definition at line 201 of file GT2004SensorDataProcessor.cpp.
References SensorData::back, BodyPercept::backBack, SensorData::backF, BodyPercept::backFront, BodyPercept::backMiddle, SensorData::backR, BodyPercept::chin, SensorData::chin, SensorData::data, SensorDataBuffer::frame, GT2004SensorDataProcessor::SensorDataRingBuffer::getAverage(), BodyPercept::head, SensorData::head, int(), BodyPercept::mouth, SensorData::mouth, SensorDataProcessorInterfaces::sensorDataBuffer, and sensorDataRingBuffer.
Referenced by execute().
void GT2004SensorDataProcessor::execute | ( | ) | [virtual] |
Executes the module
Implements Module.
Definition at line 34 of file GT2004SensorDataProcessor.cpp.
References BodyPercept::acceleration, accelerationWithGrav, SensorData::accelerationX, SensorData::accelerationY, SensorData::accelerationZ, RingBuffer< V, n >::add(), SensorDataProcessorInterfaces::bodyPercept, SensorDataProcessorInterfaces::bodyPosture, bodyPostureRingBuffer, SensorData::bodyPsd, BodyPosture::bodyRollProvidedByMotionControl, MotionInfo::bodyTilt, BodyPosture::bodyTiltProvidedByMotionControl, buildCameraMatrix(), buildPSDPercept(), calculateBodyPostureFromAccelerationSensors(), calculateBodyPostureFromLegSensors(), SensorDataProcessorInterfaces::cameraMatrix, cameraMatrixRingBuffer, BodyPercept::crashed, SensorData::data, detectFallDown(), detectMouthState(), detectPickup(), detectSwitches(), SensorDataBuffer::frame, SensorData::frameNumber, BodyPosture::frameNumber, SystemCall::getCurrentSystemTime(), getDistanceToSIFOC(), RingBuffer< V, n >::getEntry(), RingBuffer< V, n >::getNumberOfEntries(), SystemCall::getTimeSince(), gravity, gt2004SensorDataProcessorFalldownRollAngle, gt2004SensorDataProcessorRolledOnWallAngle, SensorDataProcessorInterfaces::imageFrameNumber, SensorDataBuffer::lastFrame(), lastImageFrameNumber, leftRollStartTime, SensorDataProcessorInterfaces::motionInfo, MotionInfo::motionIsStable, MotionInfo::neckHeight, BodyPosture::neckHeightProvidedByMotionControl, SensorDataBuffer::numOfFrames, PSDPercept::numOfPercepts, BodyPercept::pickedUp, SensorDataProcessorInterfaces::psdPercept, rightRollStartTime, BodyPercept::rollLeft, BodyPercept::rollRight, SensorDataProcessorInterfaces::sensorDataBuffer, sensorDataRingBuffer, BodyPercept::setBodyPSDDistance(), BodyPercept::setBodyPSDHighValue(), BodyPercept::setFrameNumber(), BodyPercept::setMouthState(), BodyPercept::setState(), BodyPercept::setSwitches(), BodyPercept::standing, GT2004SensorDataProcessor::SensorDataRingBuffer::updateAverage(), Vector3< V >::x, Vector3< V >::y, and Vector3< V >::z.
double GT2004SensorDataProcessor::getCameraVelocity | ( | const SensorData::sensors | joint | ) |
Definition at line 309 of file GT2004SensorDataProcessor.cpp.
References actAverage, fromMicroRad(), SensorData::headPan, SensorData::headTilt, RobotDimensions::motionCycleTime, SensorData::neckTilt, previousAverage, sensorDataRingBuffer, toDegrees(), and GT2004SensorDataProcessor::SensorDataRingBuffer::updateAverage().
double GT2004SensorDataProcessor::getCameraVelocity | ( | ) | [inline] |
Returns the angle speed of the camera [degrees/second]
Definition at line 41 of file GT2004SensorDataProcessor.h.
References SensorData::headPan.
double GT2004SensorDataProcessor::getDistanceToSIFOC | ( | ) |
Calculates the distance to objects in front of the bodyPSD
Definition at line 339 of file GT2004SensorDataProcessor.cpp.
References PSDPercept::numOfPercepts, and SensorDataProcessorInterfaces::psdPercept.
Referenced by execute().
Vector3<double> GT2004SensorDataProcessor::accelerationWithGrav [private] |
current averaged values from acceleration sensors, shorter period for acceleration
Definition at line 65 of file GT2004SensorDataProcessor.h.
Referenced by execute().
double GT2004SensorDataProcessor::actAverage[3] [private] |
Vector3<double> GT2004SensorDataProcessor::gravity [protected] |
current averaged values from acceleration sensors, longer period for gravity
Definition at line 58 of file GT2004SensorDataProcessor.h.
Referenced by detectFallDown(), detectPickup(), and execute().
unsigned long GT2004SensorDataProcessor::lastImageFrameNumber [private] |
The frame number of the last received image
Definition at line 76 of file GT2004SensorDataProcessor.h.
Referenced by execute().
unsigned long GT2004SensorDataProcessor::leftRollStartTime [private] |
double GT2004SensorDataProcessor::previousAverage[3] [private] |
The average neck tilt, head pan and tilt of the robot (used in this order)
Definition at line 79 of file GT2004SensorDataProcessor.h.
Referenced by getCameraVelocity().
unsigned long GT2004SensorDataProcessor::rightRollStartTime [private] |
Definition at line 102 of file GT2004SensorDataProcessor.h.
Referenced by detectSwitches(), execute(), and getCameraVelocity().
unsigned long GT2004SensorDataProcessor::tempSysTime [private] |
Definition at line 61 of file GT2004SensorDataProcessor.h.