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

# GT2005HeadPathPlanner Class Reference

`#include <GT2005HeadPathPlanner.h>`

Collaboration diagram for GT2005HeadPathPlanner:

[legend]
List of all members.

## Public Member Functions
void | init (const Vector3< double > *vectors=0, long *durations=0, int numberOfVectors=0, bool optimizeTimings=true)
| Initializes a set of points to visit in a certain time.
void | oldInit (const Vector3< double > *vectors=0, int numberOfVectors=0, long duration=0)
| GT2005HeadPathPlanner (const SensorDataBuffer &sensorDataBuffer)
| default constructor
bool | getAngles (double &neckTilt, double &headPan, double &headTilt)
| Calculates the angles for tilt pan and roll.
bool | isLastPathFinished ()
| Return whether the last initialized path is already finished.
long | calculateHeadTiming (Vector3< double > &pos1, Vector3< double > &pos2)
bool | headPositionReached (Vector3< double > pos)
## Public Attributes
double | lastNeckTilt
| The tilt calculated in the last frame.
double | lastHeadPan
| The pan calculated in the last frame.
double | lastHeadTilt
| The roll calculated in the last frame.
double | headPathSpeedNeckTilt
| the maximum speed of all angles
double | headPathSpeedHeadPan
| the maximum speed of all angles
double | headPathSpeedHeadTilt
| the maximum speed of all angles
const SensorDataBuffer & | sensorDataBuffer
| the sensordatabuffer
## Static Public Attributes
const double | minimumHeadSpeed = 0.004
| The minimum head speed in rad per frame: 0.004 = 28.6°/s.
## Private Types
enum | { maxNumberOfPoints = 20 }
| maximum number of allowed points in head path More...
## Private Member Functions
long | calculateDurationsSum (long *duration, int durations)
| Return the whole Duration of the Headpath.
## Private Attributes
long | currentPoint
| index of the most recently reached point in head path, so the head is between points[currentPoint] and points[currentPoint+1]
long | currentFrame
| number of frames (a 8ms) since start of head path
long | numberOfFrames
| requested duration of head path in frames (a 8ms)
long | numberOfPoints
| number of points in requested path
Vector3< double > | points [maxNumberOfPoints]
| the points the head shall visit during the head path
double | firstFrame [maxNumberOfPoints]
| number of the first frame after head path start for a certain point in head path

## Member Enumeration Documentation

anonymous enum`[private]`

  | maximum number of allowed points in head path Enumeration values:
  maxNumberOfPoints |
Definition at line 124 of file GT2005HeadPathPlanner.h.

## Constructor & Destructor Documentation

GT2005HeadPathPlanner::GT2005HeadPathPlanner | ( | const SensorDataBuffer & | sensorDataBuffer | ) | `[inline]`

| default constructor Definition at line 62 of file GT2005HeadPathPlanner.h. References currentFrame, lastHeadPan, lastHeadTilt, lastNeckTilt, and numberOfFrames.

## Member Function Documentation

void GT2005HeadPathPlanner::init | ( | const Vector3< double > * | vectors = 0,
|  | long * | durations = 0,
|  | int | numberOfVectors = 0,
|  | bool | optimizeTimings = true
| ) |

  | Initializes a set of points to visit in a certain time. Parameters:
  vectors | set of arcs to visit
  durations | a set of timings which described the time between the arcs
  numberOfVectors | number of Vector3s in param vectors
  optimizeTimings | the timings will be optimized by the distance in angles for optimal moving speed
Definition at line 16 of file GT2005HeadPathPlanner.cpp. References calculateDurationsSum(), calculateHeadTiming(), currentFrame, firstFrame, getRobotConfiguration(), RobotConfiguration::getRobotDimensions(), RobotDimensions::jointLimitHeadPanN, RobotDimensions::jointLimitHeadPanP, RobotDimensions::jointLimitHeadTiltN, RobotDimensions::jointLimitHeadTiltP, RobotDimensions::jointLimitNeckTiltN, RobotDimensions::jointLimitNeckTiltP, lastHeadPan, lastHeadTilt, lastNeckTilt, Range< T >::limit(), numberOfFrames, Vector3< double >::x, Vector3< double >::y, and Vector3< double >::z. Referenced by GT2005HeadControl::beginBallSearchAt(), GT2005HeadControl::calibrateHeadSpeed(), oldInit(), GT2005HeadControl::searchForBallLeft(), and GT2005HeadControl::searchForBallRight().

Here is the call graph for this function:

void GT2005HeadPathPlanner::oldInit | ( | const Vector3< double > * | vectors = 0,
|  | int | numberOfVectors = 0,
|  | long | duration = 0
| ) | `[inline]`

| Definition at line 34 of file GT2005HeadPathPlanner.h. References init().

Here is the call graph for this function:

bool GT2005HeadPathPlanner::getAngles | ( | double & | neckTilt,
|  | double & | headPan,
|  | double & | headTilt
| ) |

| Calculates the angles for tilt pan and roll. Returns: true if the last point is reached. Definition at line 101 of file GT2005HeadPathPlanner.cpp. References currentFrame, firstFrame, numberOfFrames, and Vector3< double >::x.

bool GT2005HeadPathPlanner::isLastPathFinished | ( |  | ) | `[inline]`

| Return whether the last initialized path is already finished. Returns: true if last path is finished. Definition at line 75 of file GT2005HeadPathPlanner.h. References currentFrame, and numberOfFrames. Referenced by GT2005HeadControl::calibrateHeadSpeed(), and GT2005HeadControlSymbols::getLastHeadPathIsFinished().

long GT2005HeadPathPlanner::calculateHeadTiming | ( | Vector3< double > & | pos1,
|  | Vector3< double > & | pos2
| ) |

| Definition at line 141 of file GT2005HeadPathPlanner.cpp. References headPathSpeedHeadPan, headPathSpeedHeadTilt, headPathSpeedNeckTilt, max, Vector3< V >::x, Vector3< V >::y, and Vector3< V >::z. Referenced by init().

bool GT2005HeadPathPlanner::headPositionReached | ( | Vector3< double > | pos | ) |

| Definition at line 84 of file GT2005HeadPathPlanner.cpp. References SensorData::data, SensorDataBuffer::lastFrame(), pi, toMicroRad(), Vector3< V >::x, Vector3< V >::y, and Vector3< V >::z. Referenced by GT2005HeadControl::headPositionReached(), and GT2005HeadControl::setJoints().

Here is the call graph for this function:

long GT2005HeadPathPlanner::calculateDurationsSum | ( | long * | duration,
|  | int | durations
| ) | `[private]`

| Return the whole Duration of the Headpath. Returns: the sum of duration of the headpath Definition at line 71 of file GT2005HeadPathPlanner.cpp. Referenced by init().

## Member Data Documentation

const double GT2005HeadPathPlanner::minimumHeadSpeed = 0.004`[static]`

| The minimum head speed in rad per frame: 0.004 = 28.6°/s. Definition at line 14 of file GT2005HeadPathPlanner.cpp.

double GT2005HeadPathPlanner::lastNeckTilt

| The tilt calculated in the last frame. Definition at line 89 of file GT2005HeadPathPlanner.h. Referenced by GT2005HeadControl::execute(), GT2005HeadControl::GT2005HeadControl(), GT2005HeadPathPlanner(), init(), GT2005HeadControl::setJoints(), and GT2005HeadControl::setJointsDirect().

double GT2005HeadPathPlanner::lastHeadPan

| The pan calculated in the last frame. Definition at line 92 of file GT2005HeadPathPlanner.h. Referenced by GT2005BasicBehaviorDirectedScanForObstacles::execute(), GT2005BasicBehaviorDirectedScanForLandmarks::execute(), GT2005HeadControl::execute(), GT2005HeadControl::GT2005HeadControl(), GT2005HeadPathPlanner(), init(), GT2005HeadControl::setJoints(), and GT2005HeadControl::setJointsDirect().

double GT2005HeadPathPlanner::lastHeadTilt

| The roll calculated in the last frame. Definition at line 95 of file GT2005HeadPathPlanner.h. Referenced by GT2005HeadControl::execute(), GT2005HeadControl::GT2005HeadControl(), GT2005HeadPathPlanner(), init(), GT2005HeadControl::setJoints(), and GT2005HeadControl::setJointsDirect().

double GT2005HeadPathPlanner::headPathSpeedNeckTilt

| the maximum speed of all angles Definition at line 98 of file GT2005HeadPathPlanner.h. Referenced by calculateHeadTiming(), GT2005HeadControl::calibrateHeadSpeed(), and GT2005HeadControl::GT2005HeadControl().

double GT2005HeadPathPlanner::headPathSpeedHeadPan

| the maximum speed of all angles Definition at line 98 of file GT2005HeadPathPlanner.h. Referenced by calculateHeadTiming(), GT2005HeadControl::calibrateHeadSpeed(), and GT2005HeadControl::GT2005HeadControl().

double GT2005HeadPathPlanner::headPathSpeedHeadTilt

| the maximum speed of all angles Definition at line 98 of file GT2005HeadPathPlanner.h. Referenced by calculateHeadTiming(), GT2005HeadControl::calibrateHeadSpeed(), and GT2005HeadControl::GT2005HeadControl().

const SensorDataBuffer& GT2005HeadPathPlanner::sensorDataBuffer

| the sensordatabuffer Definition at line 101 of file GT2005HeadPathPlanner.h.

long GT2005HeadPathPlanner::currentPoint`[private]`

| index of the most recently reached point in head path, so the head is between points[currentPoint] and points[currentPoint+1] Definition at line 114 of file GT2005HeadPathPlanner.h.

long GT2005HeadPathPlanner::currentFrame`[private]`

| number of frames (a 8ms) since start of head path Definition at line 117 of file GT2005HeadPathPlanner.h. Referenced by getAngles(), GT2005HeadPathPlanner(), init(), and isLastPathFinished().

long GT2005HeadPathPlanner::numberOfFrames`[private]`

| requested duration of head path in frames (a 8ms) Definition at line 120 of file GT2005HeadPathPlanner.h. Referenced by getAngles(), GT2005HeadPathPlanner(), init(), and isLastPathFinished().

long GT2005HeadPathPlanner::numberOfPoints`[private]`

| number of points in requested path Definition at line 127 of file GT2005HeadPathPlanner.h.

Vector3<double> GT2005HeadPathPlanner::points[maxNumberOfPoints]`[private]`

| the points the head shall visit during the head path Definition at line 130 of file GT2005HeadPathPlanner.h.

double GT2005HeadPathPlanner::firstFrame[maxNumberOfPoints]`[private]`

| number of the first frame after head path start for a certain point in head path Definition at line 133 of file GT2005HeadPathPlanner.h. Referenced by getAngles(), and init().

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

- Modules/HeadControl/GT2005HeadControl/GT2005HeadPathPlanner.h
- Modules/HeadControl/GT2005HeadControl/GT2005HeadPathPlanner.cpp