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

ArPose Class Reference

The class which represents a position. More...

#include <ariaUtil.h>

Inheritance diagram for ArPose:

ArPoseWithTime List of all members.

Public Member Functions

 ArPose (const ArPose &pose)
 Copy Constructor.
 ArPose (double x=0, double y=0, double th=0)
 Constructor, with optional initial values.
virtual double findAngleTo (ArPose position) const
 Finds the angle between this position and the given position.
virtual double findDistanceTo (ArPose position) const
 Finds the distance from this position to the given position.
void getPose (double *x, double *y, double *th=NULL) const
 Gets the whole position in one function call.
double getTh (void) const
 Gets the heading.
double getThRad (void) const
 Gets the heading, in radians.
double getX (void) const
 Gets the x position.
double getY (void) const
 Gets the y position.
virtual void log (void) const
 Logs the coordinates using ArLog.
virtual void setPose (ArPose position)
 Sets the position equal to the given position.
virtual void setPose (double x, double y, double th=0)
 Sets the position to the given values.
void setTh (double th)
 Sets the heading.
void setThRad (double th)
 Sets the heading, using radians.
void setX (double x)
 Sets the x position.
void setY (double y)
 Sets the y position.
virtual double squaredFindDistanceTo (ArPose position) const
 Finds the square distance from this position to the given position.
virtual ~ArPose ()
 Destructor.

Protected Attributes

double myTh
double myX
double myY

Detailed Description

The class which represents a position.

This class represents a robot position with heading. The heading defaults to 0, and so does not need to be used (this avoids having 2 types of positions). Everything in the class is inline so it should be fast.

Definition at line 456 of file ariaUtil.h.


Constructor & Destructor Documentation

ArPose::ArPose double  x = 0,
double  y = 0,
double  th = 0
[inline]
 

Constructor, with optional initial values.

Sets the position with the given values, can be used with no variables, with just x and y, or with x, y, and th

Parameters:
x the position to set the x position to, default of 0
y the position to set the y position to, default of 0
th the position to set the th position to, default of 0

Definition at line 467 of file ariaUtil.h.


Member Function Documentation

virtual double ArPose::findAngleTo ArPose  position  )  const [inline, virtual]
 

Finds the angle between this position and the given position.

Parameters:
position the position to find the angle to
Returns:
the angle to the given position from this instance, in degrees

Definition at line 560 of file ariaUtil.h.

References getX(), getY(), and ArMath::radToDeg().

Referenced by ArRobot::findAngleTo(), ArRobot::findDeltaHeadingTo(), ArActionTriangleDriveTo::findTriangle(), ArActionTriangleDriveTo::fire(), ArActionIRs::fire(), ArActionGotoStraight::fire(), ArActionGoto::fire(), ArRangeBuffer::getClosestPolarInList(), and ArForbiddenRangeDevice::processReadings().

virtual double ArPose::findDistanceTo ArPose  position  )  const [inline, virtual]
 

Finds the distance from this position to the given position.

Parameters:
position the position to find the distance to
Returns:
the distance to the position from this instance

Definition at line 534 of file ariaUtil.h.

References ArMath::distanceBetween(), getX(), and getY().

Referenced by ArAnalogGyro::encoderCorrect(), ArRobot::findDistanceTo(), ArActionTriangleDriveTo::findTriangle(), ArActionTriangleDriveTo::fire(), ArActionGotoStraight::fire(), ArActionGoto::fire(), ArRangeBuffer::getClosestBoxInList(), ArRangeBuffer::getClosestPolarInList(), ArLineSegment::getDistToLine(), ArLineSegment::getPerpDist(), ArRobot::isMoveDone(), ArForbiddenRangeDevice::processReadings(), ArActionGotoStraight::setEncoderGoal(), ArActionGotoStraight::setGoal(), and ArRobot::stateReflector().

void ArPose::getPose double *  x,
double *  y,
double *  th = NULL
const [inline]
 

Gets the whole position in one function call.

Gets the whole position at once, by giving it 2 or 3 pointers to doubles. If you give the function a null pointer for a value it won't try to use the null pointer, so you can pass in a NULL if you don't care about that value. Also note that th defaults to NULL so you can use this with just x and y.

Parameters:
x a pointer to a double to set the x position to
y a pointer to a double to set the y position to
th a pointer to a double to set the heading to, defaults to NULL

Definition at line 520 of file ariaUtil.h.

virtual void ArPose::setPose ArPose  position  )  [inline, virtual]
 

Sets the position equal to the given position.

Parameters:
position the position value this instance should be set to

Definition at line 487 of file ariaUtil.h.

References getTh(), getX(), getY(), setTh(), setX(), and setY().

virtual void ArPose::setPose double  x,
double  y,
double  th = 0
[inline, virtual]
 

Sets the position to the given values.

Sets the position with the given three values, but the theta does not need to be given as it defaults to 0.

Parameters:
x the position to set the x position to
y the position to set the y position to
th the position to set the th position to, default of 0

Definition at line 483 of file ariaUtil.h.

References setTh(), setX(), and setY().

Referenced by ArRangeBuffer::addReading(), ArRobot::ArRobot(), ArSensorReading::ArSensorReading(), ArRangeDevice::cumulativeReadingBox(), ArRangeDevice::cumulativeReadingPolar(), ArRangeDevice::currentReadingBox(), ArRangeDevice::currentReadingPolar(), ArActionTriangleDriveTo::findTriangle(), ArRangeBuffer::getClosestBoxInList(), ArLineSegment::intersects(), ArSensorReading::newData(), ArRobot::processMotorPacket(), ArForbiddenRangeDevice::processReadings(), ArRangeBuffer::redoReading(), ArSensorReading::resetSensorPosition(), ArRobot::setDeadReconPose(), and ArSick::setSensorPosition().

virtual double ArPose::squaredFindDistanceTo ArPose  position  )  const [inline, virtual]
 

Finds the square distance from this position to the given position.

This is only here for speed, if you aren't doing this thousands of times a second don't use this one use findDistanceTo

Parameters:
position the position to find the distance to
Returns:
the distance to the position from this instance

Definition at line 549 of file ariaUtil.h.

References getX(), getY(), and ArMath::squaredDistanceBetween().

Referenced by ArSick::filterAddAndCleanCumulative(), and ArForbiddenRangeDevice::processReadings().


The documentation for this class was generated from the following file:
Generated on Wed Oct 19 12:56:51 2005 for Aria by  doxygen 1.4.0