56 #ifndef _GAMS_UTILITY_GPS_POSITION_H_
57 #define _GAMS_UTILITY_GPS_POSITION_H_
60 #include "madara/knowledge/containers/DoubleVector.h"
61 #include "madara/knowledge/containers/NativeDoubleVector.h"
87 double init_lat = 0.0,
double init_lon = 0.0,
double init_alt = 0.0);
100 :
Position(pos.lat(), pos.lng(), pos.alt()) {}
104 longitude(), latitude(), altitude());
136 madara::knowledge::containers::DoubleArray & rhs)
const;
144 madara::knowledge::containers::NativeDoubleArray & rhs)
const;
159 madara::knowledge::containers::DoubleArray & rhs)
const;
167 madara::knowledge::containers::NativeDoubleArray & rhs)
const;
176 const GPSPosition & rhs,
const double & epsilon)
const;
197 std::string
to_string (
const std::string & delimiter =
",",
198 const unsigned int precision = 8)
const;
227 madara::knowledge::containers::DoubleArray & target)
const;
234 madara::knowledge::containers::DoubleArray & source);
241 madara::knowledge::containers::NativeDoubleArray & target)
249 madara::knowledge::containers::NativeDoubleArray & source);
A position in the global positioning system reference frame.
double latitude() const
Returns the latitude of the GPS coordinate.
void latitude(double input)
Sets the latitude to the input.
virtual void from_container(madara::knowledge::containers::DoubleArray &source)
Helper function for copying values to a MADARA double array.
double altitude() const
Returns the altitude of the GPS coordinate.
void longitude(double input)
Sets the longitude to the input.
double longitude() const
Returns the longitude of the GPS coordinate.
bool approximately_equal(const GPSPosition &rhs, const double &epsilon) const
Approximate equality.
static GPSPosition to_gps_position(const Position &source, const GPSPosition &ref)
Convert source to a GPSPosition.
pose::Position to_gps_pos() const
GPSPosition(const GPSPosition &position)
Constructor.
double distance_to(const GPSPosition &rhs) const
Get distance between two positions.
GPSPosition(const pose::Position &pos)
void direction_to(const GPSPosition &rhs, double &phi) const
Get spherical direction to position.
virtual ~GPSPosition()
Destructor.
virtual void to_container(madara::knowledge::containers::NativeDoubleArray &target) const
Helper function for copying values to a MADARA double array.
virtual void to_container(madara::knowledge::containers::DoubleArray &target) const
Helper function for copying values to a MADARA double array.
virtual void from_container(madara::knowledge::containers::NativeDoubleArray &source)
Helper function for copying values to a MADARA double array.
std::string to_string(const std::string &delimiter=",", const unsigned int precision=8) const
Helper function for converting the position to a string.
virtual Position to_position(const GPSPosition &ref) const
Convert to position using reference location.
GPSPosition(double init_lat=0.0, double init_lon=0.0, double init_alt=0.0)
Constructor.
void altitude(double input)
Sets the altitude to the input.
GPSPosition(const Position &position)
Constructor.
static GPSPosition from_string(const std::string &delimiter=",")
Helper function for creating a GPSPosition from a string.
A position in an x, y, z coordinate system.
GAMS_EXPORT const ReferenceFrame & gps_frame(void)
Returns the canonical GPS frame representing Earth.
bool operator==(const BasicVector< LDerived, Units > &lhs, const BasicVector< RDerived, Units > &rhs)
Equality operator for coordinates.
bool operator<(const BasicVector< LDerived, Units > &lhs, const BasicVector< RDerived, Units > &rhs)
bool operator!=(const BasicVector< LDerived, Units > &lhs, const BasicVector< RDerived, Units > &rhs)
Inequality operator for coordinates.
std::vector< GPSPosition > GpsPositions
Contains all GAMS-related tools, classes and code.
Copyright (c) 2015 Carnegie Mellon University.
Copyright (c) 2015-2018 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.