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

GT2004SensorDataProcessor Class Reference

The default SensorDataProcessor in the GT2004 project. More...

#include <GT2004SensorDataProcessor.h>

Inheritance diagram for GT2004SensorDataProcessor:

Inheritance graph
[legend]
Collaboration diagram for GT2004SensorDataProcessor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GT2004SensorDataProcessor (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,
gt2004SensorDataProcessorBufferSize
cameraMatrixRingBuffer
RingBuffer< BodyPosture, gt2004SensorDataProcessorBufferSizebodyPostureRingBuffer
unsigned long leftRollStartTime
unsigned long rightRollStartTime

Detailed Description

The default SensorDataProcessor in the GT2004 project.

Definition at line 28 of file GT2004SensorDataProcessor.h.


Constructor & Destructor Documentation

GT2004SensorDataProcessor::GT2004SensorDataProcessor const SensorDataProcessorInterfaces interfaces  ) 
 

Constructor.

Parameters:
interfaces The paramters of the HeadControl module.

Definition at line 16 of file GT2004SensorDataProcessor.cpp.


Member Function Documentation

void GT2004SensorDataProcessor::execute  )  [virtual]
 

Executes the module.

Todo:
copy data from "calculated from..."

Implements Module.

Definition at line 34 of file GT2004SensorDataProcessor.cpp.

References BodyPercept::acceleration, accelerationWithGrav, RingBuffer< BodyPosture, gt2004SensorDataProcessorBufferSize >::add(), RingBuffer< CameraMatrix, gt2004SensorDataProcessorBufferSize >::add(), RingBuffer< SensorData, gt2004SensorDataProcessorBufferSize >::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, gt2004SensorDataProcessorBufferSize >::getEntry(), RingBuffer< SensorData, gt2004SensorDataProcessorBufferSize >::getEntry(), RingBuffer< CameraMatrix, gt2004SensorDataProcessorBufferSize >::getEntry(), RingBuffer< SensorData, gt2004SensorDataProcessorBufferSize >::getNumberOfEntries(), SystemCall::getTimeSince(), gravity, gt2004SensorDataProcessorFalldownRollAngle, gt2004SensorDataProcessorRolledOnWallAngle, 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(), GT2004SensorDataProcessor::SensorDataRingBuffer::updateAverage(), Vector3< double >::x, Vector3< double >::y, and Vector3< double >::z.

Here is the call graph for this function:

double GT2004SensorDataProcessor::getCameraVelocity  )  [inline]
 

Returns the angle speed of the camera [degrees/second].

Definition at line 41 of file GT2004SensorDataProcessor.h.

double GT2004SensorDataProcessor::getCameraVelocity const SensorData::sensors  joint  ) 
 

Definition at line 309 of file GT2004SensorDataProcessor.cpp.

References actAverage, fromMicroRad(), previousAverage, sensorDataRingBuffer, toDegrees(), and GT2004SensorDataProcessor::SensorDataRingBuffer::updateAverage().

Here is the call graph for this function:

double GT2004SensorDataProcessor::getDistanceToSIFOC  ) 
 

Calculates the distance to objects in front of the bodyPSD.

Definition at line 339 of file GT2004SensorDataProcessor.cpp.

References PSDPercept::numOfPercepts.

Referenced by execute().

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(), 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 GT2004SensorDataProcessor::detectFallDown  )  [protected, virtual]
 

detects whether the robot fell down.

Definition at line 218 of file GT2004SensorDataProcessor.cpp.

References gravity, gt2004SensorDataProcessorFalldownRollAngle, gt2004SensorDataProcessorFalldownTiltAngle, Vector3< double >::x, Vector3< double >::y, and Vector3< double >::z.

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 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 GT2004SensorDataProcessor::detectSwitches  )  [private]
 

Definition at line 201 of file GT2004SensorDataProcessor.cpp.

References SensorData::data, SensorDataBuffer::frame, GT2004SensorDataProcessor::SensorDataRingBuffer::getAverage(), and sensorDataRingBuffer.

Referenced by execute().

Here is the call graph for this function:

BodyPercept::MouthStates GT2004SensorDataProcessor::detectMouthState  )  [private]
 

Definition at line 238 of file GT2004SensorDataProcessor.cpp.

References SensorData::data, and SensorDataBuffer::lastFrame().

Referenced by execute().

Here is the call graph for this function:

bool GT2004SensorDataProcessor::detectPickup const Vector3< double > &  gravity,
const Vector3< double > &  acceleration
[private]
 

Definition at line 230 of file GT2004SensorDataProcessor.cpp.

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, and BodyPosture::neckHeightCalculatedFromLegSensors.

Referenced by execute().

Here is the call graph for this function:

void GT2004SensorDataProcessor::calculateBodyPostureFromAccelerationSensors const SensorData sensorData,
BodyPosture bP
[private]
 

Definition at line 299 of file GT2004SensorDataProcessor.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> GT2004SensorDataProcessor::gravity [protected]
 

current averaged values from acceleration sensors, longer period for gravity

Definition at line 58 of file GT2004SensorDataProcessor.h.

Referenced by detectFallDown(), and execute().

unsigned long GT2004SensorDataProcessor::tempSysTime [private]
 

Definition at line 61 of file GT2004SensorDataProcessor.h.

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().

unsigned long GT2004SensorDataProcessor::lastImageFrameNumber [private]
 

The frame number of the last received image.

Definition at line 76 of file GT2004SensorDataProcessor.h.

Referenced by execute().

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().

double GT2004SensorDataProcessor::actAverage[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().

SensorDataRingBuffer GT2004SensorDataProcessor::sensorDataRingBuffer [private]
 

Definition at line 102 of file GT2004SensorDataProcessor.h.

Referenced by detectSwitches(), execute(), and getCameraVelocity().

RingBuffer<CameraMatrix,gt2004SensorDataProcessorBufferSize> GT2004SensorDataProcessor::cameraMatrixRingBuffer [private]
 

Definition at line 103 of file GT2004SensorDataProcessor.h.

Referenced by execute().

RingBuffer<BodyPosture,gt2004SensorDataProcessorBufferSize> GT2004SensorDataProcessor::bodyPostureRingBuffer [private]
 

Definition at line 104 of file GT2004SensorDataProcessor.h.

Referenced by execute().

unsigned long GT2004SensorDataProcessor::leftRollStartTime [private]
 

Definition at line 105 of file GT2004SensorDataProcessor.h.

Referenced by execute().

unsigned long GT2004SensorDataProcessor::rightRollStartTime [private]
 

Definition at line 106 of file GT2004SensorDataProcessor.h.

Referenced by execute().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:08:04 2004 for GT2004 by doxygen 1.3.6