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

# GT2005SensorDataProcessor Class Reference

`#include <GT2005SensorDataProcessor.h>`

Inheritance diagram for GT2005SensorDataProcessor:

[legend]
Collaboration diagram for GT2005SensorDataProcessor:

[legend]
List of all members.

## Public Member Functions
| GT2005SensorDataProcessor (const SensorDataProcessorInterfaces &interfaces)
| Constructor.
virtual void | execute ()
| Executes the module.
double | getCameraVelocity ()
| Returns the angle speed of the camera [degrees/second].
double | getCameraVelocity (const SensorData::sensors joint)
double | getDistanceToSIFOC ()
| Calculates the distance to objects in front of the bodyPSD.
## Protected Member Functions
virtual void | buildCameraMatrix (const SensorData &sensorData, const BodyPosture &bP, CameraMatrix &cameraMatrix)
| calculates the offset and the rotation of the camera matrix
virtual bool | detectFallDown ()
| detects whether the robot fell down.
## Protected Attributes
Vector3< double > | gravity
| current averaged values from acceleration sensors, longer period for gravity
## Private Member Functions
void | buildPSDPercept (const SensorData &sensorData, const CameraMatrix &cameraMatrix, SinglePSDPercept &psdPercept)
| calculates a spot relative to the robot that was detected by the PSD sensor
int | detectSwitches ()
BodyPercept::MouthStates | detectMouthState ()
bool | detectPickup (const Vector3< double > &gravity, const Vector3< double > &acceleration)
void | calculateBodyPostureFromLegSensors (const SensorData &sensorData, BodyPosture &bP)
void | calculateBodyPostureFromAccelerationSensors (const SensorData &sensorData, BodyPosture &bP)
## Private Attributes
unsigned long | tempSysTime
Vector3< double > | accelerationWithGrav
| current averaged values from acceleration sensors, shorter period for acceleration
unsigned long | lastImageFrameNumber
| The frame number of the last received image.
double | previousAverage [3]
| The average neck tilt, head pan and tilt of the robot (used in this order).
double | actAverage [3]
| The average neck tilt, head pan and tilt of the robot (used in this order).
SensorDataRingBuffer | sensorDataRingBuffer
RingBuffer< CameraMatrix, gt2005SensorDataProcessorBufferSize > | cameraMatrixRingBuffer
RingBuffer< BodyPosture, gt2005SensorDataProcessorBufferSize > | bodyPostureRingBuffer
unsigned long | leftRollStartTime
unsigned long | rightRollStartTime

## Constructor & Destructor Documentation

GT2005SensorDataProcessor::GT2005SensorDataProcessor | ( | const SensorDataProcessorInterfaces & | interfaces | ) |

  | Constructor. Parameters:
  interfaces | The paramters of the HeadControl module.
Definition at line 16 of file GT2005SensorDataProcessor.cpp.

## Member Function Documentation

void GT2005SensorDataProcessor::execute | ( |  | ) | `[virtual]`

| Executes the module. Todo: copy data from "calculated from..." Reimplemented from Module. Definition at line 34 of file GT2005SensorDataProcessor.cpp. References BodyPercept::acceleration, accelerationWithGrav, RingBuffer< BodyPosture, gt2005SensorDataProcessorBufferSize >::add(), RingBuffer< CameraMatrix, gt2005SensorDataProcessorBufferSize >::add(), RingBuffer< SensorData, gt2005SensorDataProcessorBufferSize >::add(), bodyPostureRingBuffer, BodyPosture::bodyRollProvidedByMotionControl, MotionInfo::bodyTilt, BodyPosture::bodyTiltProvidedByMotionControl, buildCameraMatrix(), buildPSDPercept(), calculateBodyPostureFromAccelerationSensors(), calculateBodyPostureFromLegSensors(), cameraMatrixRingBuffer, SensorData::data, detectFallDown(), detectMouthState(), detectPickup(), detectSwitches(), SensorDataBuffer::frame, SensorData::frameNumber, BodyPosture::frameNumber, SystemCall::getCurrentSystemTime(), getDistanceToSIFOC(), RingBuffer< BodyPosture, gt2005SensorDataProcessorBufferSize >::getEntry(), RingBuffer< SensorData, gt2005SensorDataProcessorBufferSize >::getEntry(), RingBuffer< CameraMatrix, gt2005SensorDataProcessorBufferSize >::getEntry(), RingBuffer< SensorData, gt2005SensorDataProcessorBufferSize >::getNumberOfEntries(), SystemCall::getTimeSince(), gravity, gt2005SensorDataProcessorFalldownRollAngle, gt2005SensorDataProcessorRolledOnWallAngle, SensorDataBuffer::lastFrame(), lastImageFrameNumber, leftRollStartTime, MotionInfo::motionIsStable, MotionInfo::neckHeight, BodyPosture::neckHeightProvidedByMotionControl, SensorDataBuffer::numOfFrames, PSDPercept::numOfPercepts, rightRollStartTime, sensorDataRingBuffer, BodyPercept::setBodyPSDDistance(), BodyPercept::setBodyPSDHighValue(), BodyPercept::setFrameNumber(), BodyPercept::setMouthState(), BodyPercept::setState(), BodyPercept::setSwitches(), GT2005SensorDataProcessor::SensorDataRingBuffer::updateAverage(), Vector3< double >::x, Vector3< double >::y, and Vector3< double >::z.

Here is the call graph for this function:

double GT2005SensorDataProcessor::getCameraVelocity | ( |  | ) | `[inline]`

| Returns the angle speed of the camera [degrees/second]. Definition at line 41 of file GT2005SensorDataProcessor.h.

double GT2005SensorDataProcessor::getCameraVelocity | ( | const SensorData::sensors | joint | ) |

| Definition at line 338 of file GT2005SensorDataProcessor.cpp. References actAverage, fromMicroRad(), previousAverage, sensorDataRingBuffer, toDegrees(), and GT2005SensorDataProcessor::SensorDataRingBuffer::updateAverage().

Here is the call graph for this function:

double GT2005SensorDataProcessor::getDistanceToSIFOC | ( |  | ) |

| Calculates the distance to objects in front of the bodyPSD. Definition at line 368 of file GT2005SensorDataProcessor.cpp. References PSDPercept::numOfPercepts. Referenced by execute().

void GT2005SensorDataProcessor::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 GT2005SensorDataProcessor.cpp. References BodyPosture::bodyTiltCalculatedFromLegSensors, Kinematics::calculateCameraMatrix(), SensorData::data, SensorData::frameNumber, fromMicroRad(), CameraMatrix::isValid, MotionInfo::motionIsStable, BodyPosture::neckHeightCalculatedFromLegSensors, and CameraMatrix::setFrameNumber(). Referenced by execute().

Here is the call graph for this function:

bool GT2005SensorDataProcessor::detectFallDown | ( |  | ) | `[protected, virtual]`

| detects whether the robot fell down. Definition at line 247 of file GT2005SensorDataProcessor.cpp. References gravity, gt2005SensorDataProcessorFalldownRollAngle, gt2005SensorDataProcessorFalldownTiltAngle, Vector3< double >::x, Vector3< double >::y, and Vector3< double >::z. Referenced by execute().

void GT2005SensorDataProcessor::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 GT2005SensorDataProcessor.cpp. References SinglePSDPercept::body, SensorData::data, SensorData::frameNumber, fromMicroRad(), CameraMatrix::isValid, SinglePSDPercept::isValid, SinglePSDPercept::neckTilt, Pose3D::rotation, SinglePSDPercept::setFrameNumber(), SinglePSDPercept::tooFarAway, Pose3D::translation, Vector3< V >::x, Vector3< V >::y, and Vector3< V >::z. Referenced by execute().

Here is the call graph for this function:

int GT2005SensorDataProcessor::detectSwitches | ( |  | ) | `[private]`

| Definition at line 201 of file GT2005SensorDataProcessor.cpp. References SensorData::data, DEBUG_RESPONSE, SensorDataBuffer::frame, GT2005SensorDataProcessor::SensorDataRingBuffer::getAverage(), and sensorDataRingBuffer. Referenced by execute().

Here is the call graph for this function:

BodyPercept::MouthStates GT2005SensorDataProcessor::detectMouthState | ( |  | ) | `[private]`

| Definition at line 267 of file GT2005SensorDataProcessor.cpp. References SensorData::data, and SensorDataBuffer::lastFrame(). Referenced by execute().

Here is the call graph for this function:

bool GT2005SensorDataProcessor::detectPickup | ( | const Vector3< double > & | gravity,
|  | const Vector3< double > & | acceleration
| ) | `[private]`

| Definition at line 259 of file GT2005SensorDataProcessor.cpp. Referenced by execute().

void GT2005SensorDataProcessor::calculateBodyPostureFromLegSensors | ( | const SensorData & | sensorData,
|  | BodyPosture & | bP
| ) | `[private]`

| Definition at line 318 of file GT2005SensorDataProcessor.cpp. References RobotVertices::bodyRoll, BodyPosture::bodyRollCalculatedFromLegSensors, RobotVertices::bodyTilt, BodyPosture::bodyTiltCalculatedFromLegSensors, Kinematics::calcNeckAndLegPositions(), SensorDataBuffer::lastFrame(), RobotVertices::neckHeight, and BodyPosture::neckHeightCalculatedFromLegSensors. Referenced by execute().

Here is the call graph for this function:

void GT2005SensorDataProcessor::calculateBodyPostureFromAccelerationSensors | ( | const SensorData & | sensorData,
|  | BodyPosture & | bP
| ) | `[private]`

| Definition at line 328 of file GT2005SensorDataProcessor.cpp. References BodyPosture::bodyRollCalculatedFromAccelerationSensors, BodyPosture::bodyTiltCalculatedFromAccelerationSensors, SensorData::data, and SensorDataBuffer::lastFrame(). Referenced by execute().

Here is the call graph for this function:

## Member Data Documentation

Vector3<double> GT2005SensorDataProcessor::gravity`[protected]`

| current averaged values from acceleration sensors, longer period for gravity Definition at line 58 of file GT2005SensorDataProcessor.h. Referenced by detectFallDown(), and execute().

unsigned long GT2005SensorDataProcessor::tempSysTime`[private]`

| Definition at line 61 of file GT2005SensorDataProcessor.h.

Vector3<double> GT2005SensorDataProcessor::accelerationWithGrav`[private]`

| current averaged values from acceleration sensors, shorter period for acceleration Definition at line 65 of file GT2005SensorDataProcessor.h. Referenced by execute().

unsigned long GT2005SensorDataProcessor::lastImageFrameNumber`[private]`

| The frame number of the last received image. Definition at line 76 of file GT2005SensorDataProcessor.h. Referenced by execute().

double GT2005SensorDataProcessor::previousAverage[3]`[private]`

| The average neck tilt, head pan and tilt of the robot (used in this order). Definition at line 79 of file GT2005SensorDataProcessor.h. Referenced by getCameraVelocity().

double GT2005SensorDataProcessor::actAverage[3]`[private]`

| The average neck tilt, head pan and tilt of the robot (used in this order). Definition at line 79 of file GT2005SensorDataProcessor.h. Referenced by getCameraVelocity().

SensorDataRingBuffer GT2005SensorDataProcessor::sensorDataRingBuffer`[private]`

| Definition at line 102 of file GT2005SensorDataProcessor.h. Referenced by detectSwitches(), execute(), and getCameraVelocity().

RingBuffer<CameraMatrix,gt2005SensorDataProcessorBufferSize> GT2005SensorDataProcessor::cameraMatrixRingBuffer`[private]`

| Definition at line 103 of file GT2005SensorDataProcessor.h. Referenced by execute().

RingBuffer<BodyPosture,gt2005SensorDataProcessorBufferSize> GT2005SensorDataProcessor::bodyPostureRingBuffer`[private]`

| Definition at line 104 of file GT2005SensorDataProcessor.h. Referenced by execute().

unsigned long GT2005SensorDataProcessor::leftRollStartTime`[private]`

| Definition at line 105 of file GT2005SensorDataProcessor.h. Referenced by execute().

unsigned long GT2005SensorDataProcessor::rightRollStartTime`[private]`

| Definition at line 106 of file GT2005SensorDataProcessor.h. Referenced by execute().

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

- Modules/SensorDataProcessor/GT2005SensorDataProcessor.h
- Modules/SensorDataProcessor/GT2005SensorDataProcessor.cpp