GAMS  1.4.0
gams::utility Namespace Reference

Provides utility functions and classes for common tasks and needs. More...

Namespaces

 euler
 DEPRECATED: Provides classes here have been moved to gams::pose::euler.
 
 java
 Provides utility functions and classes for common Java tasks and needs.
 
 order
 DEPRECATED: Provides classes here have been moved to gams::pose::order.
 
 ros
 

Classes

class  ArgumentParser
 
class  Containerize
 A class meant to assist with retrieving information into GAMS containers. More...
 
class  GPSPosition
 A position in the global positioning system reference frame. More...
 
class  Joystick
 
class  JoystickEvent
 
class  Position
 A position in an x, y, z coordinate system. More...
 
class  RadixLess
 Compare object suitable for use with standard library. More...
 

Typedefs

using bad_coord_type = gams::pose::bad_coord_type
 Thrown when a reference frame function is called with a Coordinate type (e.g., Pose, Location, Orientation) that frame does not support. More...
 
typedef gams::pose::CartesianFrame CartesianFrame
 Locations represented as meters distance, in x, y, and z, from an origin Orientations represented in Axis Angle notation. More...
 
template<typename CoordType >
using Coordinate = gams::pose::Coordinate< CoordType >
 New coordinate types which are frame-dependant can inherit from this class. More...
 
typedef gams::pose::GPSFrame GPSFrame
 Locations represented as GPS coordinates, and an altitude, assuming a spherical planet (by default, Earth): x is Latitude y is Longitude z is Altitude (above assumed perfectly spherical surface) Orientations represented in Axis Angle notation Axis rx points towards north pole Axis ry points west at current location Axis rz points upwards (i.e, normal vector) More...
 
typedef std::vector< GPSPositionGpsPositions
 
typedef gams::pose::Position Location
 Represents a Location within a reference frame. More...
 
using LocationVector = gams::pose::LinearVector< gams::pose::Position >
 Container for Location information, not bound to a frame. More...
 
typedef gams::pose::Orientation Orientation
 Represents a orientation or orientation within a reference frame. More...
 
typedef gams::pose::AngularVector OrientationVector
 Container for Orientation information, not bound to a frame. More...
 
typedef gams::pose::Pose Pose
 Represents a combination of Location and Orientation within a single reference frame. More...
 
typedef gams::pose::PoseVector PoseVector
 Container for Pose information, not bound to a frame. More...
 
typedef std::vector< PositionPositions
 
typedef gams::pose::Quaternion Quaternion
 Used internally to implement angle operations. More...
 
typedef gams::pose::ReferenceFrame ReferenceFrame
 Base class for Reference Frames. More...
 
typedef gams::pose::undefined_transform undefined_transform
 Thrown when an attempt is made to transform between two frame types, and there's not transform defined. More...
 
typedef gams::pose::unrelated_frames unrelated_frames
 Thrown when an an attempt is made to transform between frames that do not belong to the same frame tree. More...
 

Functions

madara::knowledge::KnowledgeVector kmap2kvec (const madara::knowledge::KnowledgeMap &kmap)
 Converts a knowledge map into a knowledge vector by adding the values from the map in numerical order (as defined by radix order: shorter strings always come before longer strings, and equal length strings are sorted in lexicographicaly order) More...
 

Variables

static const gams::pose::detail::degrees_t degrees
 Degres unit flag; see Euler constructor Deprecated; use gams::pose::degrees instead. More...
 
static const gams::pose::detail::radians_t radians
 Radians unit flag; see Euler constructor Deprecated; use gams::pose::radians instead. More...
 
static const gams::pose::detail::revolutions_t revolutions
 Revolutions (i.e., 1 == 360 degrees) unit flag; see Euler constructor Deprecated; use gams::pose::revolutions instead. More...
 

Detailed Description

Provides utility functions and classes for common tasks and needs.

Typedef Documentation

◆ bad_coord_type

using gams::utility::bad_coord_type = typedef gams::pose::bad_coord_type

Thrown when a reference frame function is called with a Coordinate type (e.g., Pose, Location, Orientation) that frame does not support.

Template Parameters
CoordTypeThe kind of Coordinate the error was raised for.

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 72 of file ReferenceFrame.h.

◆ CartesianFrame

typedef gams::pose::CartesianFrame gams::utility::CartesianFrame

Locations represented as meters distance, in x, y, and z, from an origin Orientations represented in Axis Angle notation.

All conversions to/from child and parent CartesianFrames are supported. Conversions to/from a parent GPSFrame are supported, except converting GPSFrame to a child CartesianFrame that is orientd w.r.t. the GPSFrame Converting to GPSFrame from a orientd child Cartesian is supported.

Deprecated backwards compatibility typedef. Will be removed in v2

Definition at line 75 of file CartesianFrame.h.

◆ Coordinate

template<typename CoordType >
using gams::utility::Coordinate = typedef gams::pose::Coordinate<CoordType>

New coordinate types which are frame-dependant can inherit from this class.

Pass the type of the child class as CoordType

New coordinate types must: – Inherit from Coordinate, and pass itself as template parameter – Inherit from a base class which does not inherit from Coordinate – That base class must: – Have a typedef BaseType which refers to itself – Implement operator== – Implement the following methods: static std::string name() // return the type's name static int size() // return # of values in representation double get(int i) const // return ith value of representation bool operator==(const BaseType &rhs) const BaseType &as_vec() // return *this const BaseType &as_vec() const // return *this

Additionally, new coordinate types should either: – Specialize the ReferenceFrame::*_within_frame templates; OR – Add new overloads for transform_to_origin, transform_from_origin, do_normalize, and calc_distance virtual methods in ReferenceFrame, and add transformation logic for those methods in the various frames

Definition at line 137 of file Coordinate.h.

◆ GPSFrame

typedef gams::pose::GPSFrame gams::utility::GPSFrame

Locations represented as GPS coordinates, and an altitude, assuming a spherical planet (by default, Earth): x is Latitude y is Longitude z is Altitude (above assumed perfectly spherical surface) Orientations represented in Axis Angle notation Axis rx points towards north pole Axis ry points west at current location Axis rz points upwards (i.e, normal vector)

Note that under this scheme, change in x and/or y position, while maintaining the same orientation angles, implies a orientation relative to the planet.

Distances at same altitude calculated as distance along great circle of sphere of radius planet_radius plus altitude. If altitude differs, great circle distance first calculated using lower of two altitudes, then distance calculated as follows: distance = sqrt(circle_distance ^ 2 + altitude_difference ^ 2)

This frame can have cartesian frames embedded within it, but cannot be embedded within any other frames at this time.

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 90 of file GPSFrame.h.

◆ GpsPositions

Definition at line 284 of file GPSPosition.h.

◆ Location

Represents a Location within a reference frame.

This location always has x, y, and z coordinates, but interpretation of those coordinates can vary according to the reference frame.

Provides accessor methods to support non-cartesian coordinate systems:

lng/lat/alt for GPS-style systems rho/phi/r for Cylindrical systems theta/phi/r for Spherical systems northing/easting/zone/hemi/alt for UTM/USP systems

Each of the above are bound to x/y/z respectively.

Note that no checking is done to ensure that the correct accessors are used based on the actual ReferenceFrame type this Location is bound to. In particular, the UTM/USP accessors may produce strange values if the Location is not actually bound to a UTMFrame, but will not cause exceptions.

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 103 of file Location.h.

◆ LocationVector

using gams::utility::LocationVector = typedef gams::pose::LinearVector<gams::pose::Position>

Container for Location information, not bound to a frame.

Stores a 3-tuple, for x, y, and z.

Provides accessor methods to support non-cartesian coordinate systems:

lng/lat/alt for GPS-style systems rho/phi/r for Cylindrical systems theta/phi/r for Spherical systems northing/easting/zone/hemi/alt for UTM/USP systems

Each of the above are bound to x/y/z respectively

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 79 of file Location.h.

◆ Orientation

Represents a orientation or orientation within a reference frame.

Uses axis-angle notation: a orientation is represented by a vector whose direction forms the axis of orientation, with angle of orientation equal to length of the vector.

All orientations about an axis follow the right hand role; if the origin is the center of your right hand, and your thumb is pointing in the positive direction of the orientation axis, orientations curve in the direction your fingers are pointing.

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 94 of file Orientation.h.

◆ OrientationVector

typedef gams::pose::AngularVector gams::utility::OrientationVector

Container for Orientation information, not bound to a frame.

Uses axis-angle notation: a orientation is represented by a vector whose direction forms the axis of orientation, with angle of orientation equal to length of the vector.

All orientations about an axis follow the right hand role; if the origin is the center of your right hand, and your thumb is pointing in the positive direction of the orientation axis, orientations curve in the direction your fingers are pointing.

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 79 of file Orientation.h.

◆ Pose

Represents a combination of Location and Orientation within a single reference frame.

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 79 of file Pose.h.

◆ PoseVector

Container for Pose information, not bound to a frame.

See LocationVector and OrientationVector for representation deatils

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 71 of file Pose.h.

◆ Positions

typedef std::vector<Position> gams::utility::Positions

Definition at line 320 of file Position.h.

◆ Quaternion

Used internally to implement angle operations.

Not reference-frame aware.

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 72 of file Quaternion.h.

◆ ReferenceFrame

Base class for Reference Frames.

Inherit from this class if implementing a new reference frame. Otherwise, do not use directly.

If implementing a new reference frame, you will need to modify the transform_to_origin and transform_from_origin methods of the reference frames the new reference frame should be able to transform to and from.

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 108 of file ReferenceFrame.h.

◆ undefined_transform

Thrown when an attempt is made to transform between two frame types, and there's not transform defined.

Note that between two frame types A and B, there are four different kinds of transforms, which must be defined individually: 1) From A as parent to B as its child 2) From A as child to B as its parent 3) From B as parent to A as its child 4) From B as child to A as its parent

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 95 of file ReferenceFrame.h.

◆ unrelated_frames

Thrown when an an attempt is made to transform between frames that do not belong to the same frame tree.

Deprecated backwards compatibility aliases. Will be removed in v2

Definition at line 80 of file ReferenceFrame.h.

Function Documentation

◆ kmap2kvec()

madara::knowledge::KnowledgeVector gams::utility::kmap2kvec ( const madara::knowledge::KnowledgeMap &  kmap)
inline

Converts a knowledge map into a knowledge vector by adding the values from the map in numerical order (as defined by radix order: shorter strings always come before longer strings, and equal length strings are sorted in lexicographicaly order)

keys which don't start with a digit are ignored

Definition at line 98 of file ArgumentParser.h.

Variable Documentation

◆ degrees

const gams::pose::detail::degrees_t gams::utility::degrees
static

Degres unit flag; see Euler constructor Deprecated; use gams::pose::degrees instead.

Definition at line 69 of file AngleUnits.h.

◆ radians

const gams::pose::detail::radians_t gams::utility::radians
static

Radians unit flag; see Euler constructor Deprecated; use gams::pose::radians instead.

Definition at line 65 of file AngleUnits.h.

◆ revolutions

const gams::pose::detail::revolutions_t gams::utility::revolutions
static

Revolutions (i.e., 1 == 360 degrees) unit flag; see Euler constructor Deprecated; use gams::pose::revolutions instead.

Definition at line 73 of file AngleUnits.h.