#include <ariaUtil.h>
Inheritance diagram for ArPose:
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 525 of file ariaUtil.h.
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 ArPose | operator+ (const ArPose &other) |
Add the other pose's X, Y and theta to this pose's X, Y, and theta (sum in theta will be normalized to (-180,180)), and return the result. | |
virtual ArPose | operator- (const ArPose &other) |
Substract the other pose's X, Y, and theta from this pose's X, Y, and theta (difference in theta will be normalized to (-180,180)), and return the result. | |
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 |
|
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
Definition at line 536 of file ariaUtil.h. |
|
Finds the angle between this position and the given position.
Definition at line 629 of file ariaUtil.h. |
|
Finds the distance from this position to the given position.
Definition at line 603 of file ariaUtil.h. |
|
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.
Definition at line 589 of file ariaUtil.h. |
|
Sets the position equal to the given position.
Definition at line 556 of file ariaUtil.h. |
|
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.
Definition at line 552 of file ariaUtil.h. |
|
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
Definition at line 618 of file ariaUtil.h. |