GAMS
1.4.0
|
A position in an x, y, z coordinate system. More...
#include <Position.h>
Public Member Functions | |
Position (const pose::Position &pos) | |
Position (const Position &source) | |
Copy constructor. More... | |
Position (double init_x=DBL_MAX, double init_y=0.0, double init_z=0.0) | |
Constructor. More... | |
virtual | ~Position () |
Destructor. More... | |
bool | approximately_equal (const Position &rhs, const double &epsilon) const |
Approximate equality. More... | |
bool | approximately_equal_2d (const Position &rhs, const double &epsilon) const |
Approximate equality. More... | |
void | direction_to (const Position &rhs, double &phi, double &theta) const |
Get spherical direction to position. More... | |
double | distance_to (const Position &rhs) const |
Get distance between two positions. More... | |
virtual double | distance_to_2d (const Position &end, const Position &check) const |
Get distance between a point and a line segment. More... | |
virtual double | distance_to_2d (const Position &rhs) const |
virtual double | dot (const Position &p_2) const |
Dot product of two positions treated as vectors. More... | |
virtual void | from_container (madara::knowledge::containers::DoubleArray &source) |
Helper function for copying values to a MADARA double array. More... | |
virtual void | from_container (madara::knowledge::containers::NativeDoubleArray &source) |
Helper function for copying values to a MADARA double array. More... | |
virtual bool | is_between_2d (const Position &end, const Position &check) const |
Deterime if a third point is inline and between another two points. More... | |
bool | operator!= (const madara::knowledge::containers::DoubleArray &rhs) const |
Inequality operator. More... | |
bool | operator!= (const madara::knowledge::containers::NativeDoubleArray &rhs) const |
Inequality operator. More... | |
bool | operator!= (const Position &rhs) const |
Inequality operator. More... | |
bool | operator< (const Position &rhs) const |
Less than used for ordering in stl containers. More... | |
void | operator= (const Position &rhs) |
Assignment operator. More... | |
bool | operator== (const madara::knowledge::containers::DoubleArray &rhs) const |
Equality operator. More... | |
bool | operator== (const madara::knowledge::containers::NativeDoubleArray &rhs) const |
Equality operator. More... | |
bool | operator== (const Position &rhs) const |
Equality operator. More... | |
virtual bool | slope_2d (const Position &p, double &slope) const |
Get slope between two points. More... | |
virtual void | to_container (madara::knowledge::containers::DoubleArray &target) const |
Helper function for copying values to a MADARA double array. More... | |
virtual void | to_container (madara::knowledge::containers::NativeDoubleArray &target) const |
Helper function for copying values to a MADARA double array. More... | |
pose::Position | to_pos (const pose::ReferenceFrame &frame) const |
std::string | to_string (const std::string &delimiter=",") const |
Helper function for converting the position to a string. More... | |
Static Public Member Functions | |
static Position | from_record (const madara::knowledge::KnowledgeRecord &record) |
Helper function for creating a Position from a KnowledgeRecord. More... | |
static Position | from_string (const std::string &delimiter=",") |
Helper function for creating a Position from a string. More... | |
Public Attributes | |
double | x |
the x coordinate(e.g. latitude) More... | |
double | y |
the y coordinate(e.g. longitude) More... | |
double | z |
the z coordinate(e.g. altitude) More... | |
Protected Member Functions | |
Position | operator* (const double &scale) const |
Scale the position. More... | |
Position | operator+ (const Position &rhs) const |
Addition operator performs element-wise addition. More... | |
Position | operator- (const Position &rhs) const |
Subtraction operator performs element-wise subtraction. More... | |
A position in an x, y, z coordinate system.
DEPRECATED: use pose::Position instead. Will be removed in GAMS v2
Definition at line 77 of file Position.h.
gams::utility::Position::Position | ( | double | init_x = DBL_MAX , |
double | init_y = 0.0 , |
||
double | init_z = 0.0 |
||
) |
Constructor.
init_x | the x axis coordinate(e.g. latitude) |
init_y | the y axis coordinate(e.g. longitude) |
init_z | the z axis coordinate(e.g. altitude) |
gams::utility::Position::Position | ( | const Position & | source | ) |
Copy constructor.
source | the source to copy |
|
inline |
Definition at line 95 of file Position.h.
|
virtual |
Destructor.
bool gams::utility::Position::approximately_equal | ( | const Position & | rhs, |
const double & | epsilon | ||
) | const |
Approximate equality.
rhs | value to compare |
epsilon | approximation value |
bool gams::utility::Position::approximately_equal_2d | ( | const Position & | rhs, |
const double & | epsilon | ||
) | const |
Approximate equality.
rhs | value to compare |
epsilon | approximation value |
void gams::utility::Position::direction_to | ( | const Position & | rhs, |
double & | phi, | ||
double & | theta | ||
) | const |
Get spherical direction to position.
rhs | other position |
phi | direction in x/y plane |
theta | direction in z plane |
double gams::utility::Position::distance_to | ( | const Position & | rhs | ) | const |
Get distance between two positions.
rhs | second position |
|
virtual |
Get distance between a point and a line segment.
end | end of line segment including *this |
check | point to find distance for |
|
virtual |
rhs | second position |
|
virtual |
Dot product of two positions treated as vectors.
p_2 | other position |
|
virtual |
Helper function for copying values to a MADARA double array.
source | source container to copy values from |
Reimplemented in gams::utility::GPSPosition.
|
virtual |
Helper function for copying values to a MADARA double array.
source | source container to copy values from |
Reimplemented in gams::utility::GPSPosition.
|
static |
|
static |
Helper function for creating a Position from a string.
delimiter | characters to insert between position components |
|
virtual |
Deterime if a third point is inline and between another two points.
end | second endpoint |
check | point to check |
bool gams::utility::Position::operator!= | ( | const madara::knowledge::containers::DoubleArray & | rhs | ) | const |
Inequality operator.
rhs | value to compare |
bool gams::utility::Position::operator!= | ( | const madara::knowledge::containers::NativeDoubleArray & | rhs | ) | const |
Inequality operator.
rhs | value to compare |
bool gams::utility::Position::operator!= | ( | const Position & | rhs | ) | const |
Inequality operator.
rhs | value to compare |
|
protected |
Scale the position.
scale | factor to scale by |
Addition operator performs element-wise addition.
rhs | value to add to *this |
Subtraction operator performs element-wise subtraction.
rhs | value to subtract from *this |
bool gams::utility::Position::operator< | ( | const Position & | rhs | ) | const |
Less than used for ordering in stl containers.
rhs | comparing position |
void gams::utility::Position::operator= | ( | const Position & | rhs | ) |
Assignment operator.
rhs | values to copy |
bool gams::utility::Position::operator== | ( | const madara::knowledge::containers::DoubleArray & | rhs | ) | const |
Equality operator.
rhs | value to compare |
bool gams::utility::Position::operator== | ( | const madara::knowledge::containers::NativeDoubleArray & | rhs | ) | const |
Equality operator.
rhs | value to compare |
bool gams::utility::Position::operator== | ( | const Position & | rhs | ) | const |
Equality operator.
rhs | value to compare |
|
virtual |
Get slope between two points.
p | other point |
slope | location to store slope between two points |
|
virtual |
Helper function for copying values to a MADARA double array.
target | target container to copy values to |
Reimplemented in gams::utility::GPSPosition.
|
virtual |
Helper function for copying values to a MADARA double array.
target | target container to copy values to |
Reimplemented in gams::utility::GPSPosition.
|
inline |
Definition at line 98 of file Position.h.
std::string gams::utility::Position::to_string | ( | const std::string & | delimiter = "," | ) | const |
Helper function for converting the position to a string.
delimiter | characters to insert between position components |
double gams::utility::Position::x |
the x coordinate(e.g. latitude)
Definition at line 288 of file Position.h.
double gams::utility::Position::y |
the y coordinate(e.g. longitude)
Definition at line 291 of file Position.h.
double gams::utility::Position::z |
the z coordinate(e.g. altitude)
Definition at line 294 of file Position.h.