GAMS  1.4.0
gams::pose::BasicVector< Derived, Units > Class Template Reference

For internal use. The underlying template for all coordinate types. More...

#include <Coordinate.h>

Inheritance diagram for gams::pose::BasicVector< Derived, Units >:
gams::pose::Framed< BasicVector< AngularVelocity, units::angular_velocity > > gams::pose::Framed< BasicVector< Acceleration, units::acceleration > > gams::pose::Framed< BasicVector< Velocity, units::velocity > > gams::pose::Framed< BasicVector< Rotation, units::plane_angle > > gams::pose::Framed< BasicVector< Position, units::absolute< units::length > > > gams::pose::Framed< BasicVector< Displacement, units::length > > gams::pose::Framed< BasicVector< Orientation, units::absolute< units::plane_angle > > > gams::pose::Framed< BasicVector< AngularAcceleration, units::angular_acceleration > >

Public Types

using derived_type = Derived
 
using units_type = Units
 

Public Member Functions

 BasicVector ()=default
 
template<typename Derived2 >
 BasicVector (const BasicVector< Derived2, Units > &v)
 Construct from a vector of same units, but different derived type. More...
 
template<typename Other >
Derived cross (const BasicVector< Other, Units > &other) const
 Passthrough to Eigen vector cross method. More...
 
template<typename Other >
double dot (const BasicVector< Other, Units > &other) const
 Passthrough to Eigen vector dot method. More...
 
template<typename ContainType >
void from_array (const ContainType &in)
 Overwrites this Coordinate's values with those pulled from the referenced array. More...
 
void from_container (const madara::knowledge::containers::NativeDoubleVector &container)
 Assign values from a NativeDoubleVector container. More...
 
double get (size_t i) const
 Get i'th value in this Coordinate. More...
 
bool is_set () const
 Does this coordinate have any values not INVAL_COORD? More...
 
bool is_zero () const
 Does this coordinate have values all zeroes? More...
 
double norm () const
 Passthrough to Eigen vector norm method. More...
 
Derived normalized () const
 Passthrough to Eigen vector normalized method. More...
 
double set (size_t i, double v)
 Set i'th value in this Coordinate. More...
 
size_t size () const
 Get number of values in this coordinate. More...
 
double squaredNorm () const
 Passthrough to Eigen vector squaredNorm method. More...
 
template<typename ContainType >
void to_array (ContainType &out) const
 Outputs this Coordinates values to the referenced container. More...
 
void to_container (madara::knowledge::containers::NativeDoubleVector &container) const
 Assign values into a NativeDoubleVector container. More...
 
std::string to_string (const std::string &delimiter=",", const std::string &unset_identifier="<unset>") const
 Returns a string of the values x, y, z. More...
 

Static Public Member Functions

static constexpr bool fixed ()
 Is this coordinate a fixed vector? More...
 
static constexpr bool free ()
 Is this coordinate a free vector? More...
 
static constexpr bool positional ()
 Is this coordinate a positional one? More...
 
static constexpr bool rotational ()
 Is this coordinate a rotational one? More...
 

Private Types

using mixin = typename unit_traits< Units >::template mixin< Derived >
 
using storage_mixin = typename unit_traits< Units >::storage_mixin
 
using traits = unit_traits< Units >
 

Private Attributes

Eigen::Vector3d vec_
 

Detailed Description

template<typename Derived, typename Units>
class gams::pose::BasicVector< Derived, Units >

For internal use. The underlying template for all coordinate types.

Definition at line 525 of file Coordinate.h.

Member Typedef Documentation

◆ derived_type

template<typename Derived , typename Units >
using gams::pose::BasicVector< Derived, Units >::derived_type = Derived

Definition at line 542 of file Coordinate.h.

◆ mixin

template<typename Derived , typename Units >
using gams::pose::BasicVector< Derived, Units >::mixin = typename unit_traits<Units>::template mixin<Derived>
private

Definition at line 534 of file Coordinate.h.

◆ storage_mixin

template<typename Derived , typename Units >
using gams::pose::BasicVector< Derived, Units >::storage_mixin = typename unit_traits<Units>::storage_mixin
private

Definition at line 533 of file Coordinate.h.

◆ traits

template<typename Derived , typename Units >
using gams::pose::BasicVector< Derived, Units >::traits = unit_traits<Units>
private

Definition at line 532 of file Coordinate.h.

◆ units_type

template<typename Derived , typename Units >
using gams::pose::BasicVector< Derived, Units >::units_type = Units

Definition at line 543 of file Coordinate.h.

Constructor & Destructor Documentation

◆ BasicVector() [1/2]

template<typename Derived , typename Units >
gams::pose::BasicVector< Derived, Units >::BasicVector ( )
default

◆ BasicVector() [2/2]

template<typename Derived , typename Units >
template<typename Derived2 >
gams::pose::BasicVector< Derived, Units >::BasicVector ( const BasicVector< Derived2, Units > &  v)
inline

Construct from a vector of same units, but different derived type.

Definition at line 549 of file Coordinate.h.

Member Function Documentation

◆ cross()

template<typename Derived , typename Units >
template<typename Other >
Derived gams::pose::BasicVector< Derived, Units >::cross ( const BasicVector< Other, Units > &  other) const
inline

Passthrough to Eigen vector cross method.

Definition at line 714 of file Coordinate.h.

◆ dot()

template<typename Derived , typename Units >
template<typename Other >
double gams::pose::BasicVector< Derived, Units >::dot ( const BasicVector< Other, Units > &  other) const
inline

Passthrough to Eigen vector dot method.

Definition at line 705 of file Coordinate.h.

◆ fixed()

template<typename Derived , typename Units >
static constexpr bool gams::pose::BasicVector< Derived, Units >::fixed ( )
inlinestaticconstexpr

Is this coordinate a fixed vector?

Definition at line 561 of file Coordinate.h.

◆ free()

template<typename Derived , typename Units >
static constexpr bool gams::pose::BasicVector< Derived, Units >::free ( )
inlinestaticconstexpr

Is this coordinate a free vector?

Definition at line 558 of file Coordinate.h.

◆ from_array()

template<typename Derived , typename Units >
template<typename ContainType >
void gams::pose::BasicVector< Derived, Units >::from_array ( const ContainType &  in)
inline

Overwrites this Coordinate's values with those pulled from the referenced array.

These values will be within this object's current reference frame. The container must support operator[],

If the array's size is smaller than the cardinality of this coordinate type, the behavior is undefined. If it is larger, the extra elements are ignored.

Template Parameters
ContainTypethe type of the container; must support operator[]
Parameters
inthe container to pull new values from.

Definition at line 637 of file Coordinate.h.

◆ from_container()

template<typename Derived , typename Units >
void gams::pose::BasicVector< Derived, Units >::from_container ( const madara::knowledge::containers::NativeDoubleVector &  container)
inline

Assign values from a NativeDoubleVector container.

Parameters
containerthe container

Definition at line 693 of file Coordinate.h.

◆ get()

template<typename Derived , typename Units >
double gams::pose::BasicVector< Derived, Units >::get ( size_t  i) const
inline

Get i'th value in this Coordinate.

No range checking!

Definition at line 569 of file Coordinate.h.

◆ is_set()

template<typename Derived , typename Units >
bool gams::pose::BasicVector< Derived, Units >::is_set ( ) const
inline

Does this coordinate have any values not INVAL_COORD?

Definition at line 581 of file Coordinate.h.

◆ is_zero()

template<typename Derived , typename Units >
bool gams::pose::BasicVector< Derived, Units >::is_zero ( ) const
inline

Does this coordinate have values all zeroes?

Definition at line 592 of file Coordinate.h.

◆ norm()

template<typename Derived , typename Units >
double gams::pose::BasicVector< Derived, Units >::norm ( ) const
inline

Passthrough to Eigen vector norm method.

Definition at line 724 of file Coordinate.h.

◆ normalized()

template<typename Derived , typename Units >
Derived gams::pose::BasicVector< Derived, Units >::normalized ( ) const
inline

Passthrough to Eigen vector normalized method.

Definition at line 740 of file Coordinate.h.

◆ positional()

template<typename Derived , typename Units >
static constexpr bool gams::pose::BasicVector< Derived, Units >::positional ( )
inlinestaticconstexpr

Is this coordinate a positional one?

Definition at line 552 of file Coordinate.h.

◆ rotational()

template<typename Derived , typename Units >
static constexpr bool gams::pose::BasicVector< Derived, Units >::rotational ( )
inlinestaticconstexpr

Is this coordinate a rotational one?

Definition at line 555 of file Coordinate.h.

◆ set()

template<typename Derived , typename Units >
double gams::pose::BasicVector< Derived, Units >::set ( size_t  i,
double  v 
)
inline

Set i'th value in this Coordinate.

No range checking!

Parameters
ithe index of the coordinate
vthe value to set to
Returns
the new value

Definition at line 578 of file Coordinate.h.

◆ size()

template<typename Derived , typename Units >
size_t gams::pose::BasicVector< Derived, Units >::size ( void  ) const
inline

Get number of values in this coordinate.

Definition at line 564 of file Coordinate.h.

◆ squaredNorm()

template<typename Derived , typename Units >
double gams::pose::BasicVector< Derived, Units >::squaredNorm ( ) const
inline

Passthrough to Eigen vector squaredNorm method.

Definition at line 732 of file Coordinate.h.

◆ to_array()

template<typename Derived , typename Units >
template<typename ContainType >
void gams::pose::BasicVector< Derived, Units >::to_array ( ContainType &  out) const
inline

Outputs this Coordinates values to the referenced container.

This container type must support operator[] for setting by index.

If the array's size is smaller than the cardinality of this coordinate type, the behavior is undefined. If it is larger, the extra elements are not changed.

The MADARA DoubleVector and NativeDoubleVector types are supported.

Template Parameters
ContainTypethe type of the container; must support "set"
Parameters
outthe container to put this Coordinate's values into.

Definition at line 616 of file Coordinate.h.

◆ to_container()

template<typename Derived , typename Units >
void gams::pose::BasicVector< Derived, Units >::to_container ( madara::knowledge::containers::NativeDoubleVector &  container) const
inline

Assign values into a NativeDoubleVector container.

Parameters
containerthe container

Definition at line 681 of file Coordinate.h.

◆ to_string()

template<typename Derived , typename Units >
std::string gams::pose::BasicVector< Derived, Units >::to_string ( const std::string &  delimiter = ",",
const std::string &  unset_identifier = "<unset>" 
) const
inline

Returns a string of the values x, y, z.

Parameters
delimiterdelimiter between values
unset_identifiervalue to print if unset
Returns
stringified version of the Linear

Definition at line 651 of file Coordinate.h.

Member Data Documentation

◆ vec_

template<typename Derived , typename Units >
Eigen::Vector3d gams::pose::BasicVector< Derived, Units >::vec_
private

Definition at line 530 of file Coordinate.h.


The documentation for this class was generated from the following file: