GAMS  1.4.0
gams::pose::Framed< Impl > Class Template Reference

Internal class implementing coordinates bound to reference frame. More...

#include <Framed.h>

Inheritance diagram for gams::pose::Framed< Impl >:
gams::pose::Stamped< Framed< BasicPose< StampedPose > > > gams::pose::Stamped< Framed< BasicVector< StampedAngularAcceleration, units::angular_acceleration > > > gams::pose::Stamped< Framed< BasicVector< StampedOrientation, units::absolute< units::plane_angle > > > > gams::pose::Stamped< Framed< BasicVector< StampedVelocity, units::velocity > > > gams::pose::Stamped< Framed< BasicVector< StampedRotation, units::plane_angle > > > gams::pose::Stamped< Framed< BasicVector< StampedPosition, units::absolute< units::length > > > > gams::pose::Stamped< Framed< BasicVector< StampedDisplacement, units::length > > > gams::pose::Stamped< Framed< BasicVector< StampedAcceleration, units::acceleration > > > gams::pose::Stamped< Framed< BasicVector< StampedAngularVelocity, units::angular_velocity > > >

Public Types

using derived_type = typename Impl::derived_type
 

Public Member Functions

 Framed ()=default
 Default Constructor. More...
 
template<typename... Args>
 Framed (Args &&... args)
 Construct without a ReferenceFrame object. More...
 
 Framed (ReferenceFrame frame)
 Construct using just a ReferenceFrame object. More...
 
template<typename... Args>
 Framed (ReferenceFrame frame, Args &&... args)
 Construct using a ReferenceFrame object. More...
 
template<typename Base2 >
bool approximately_equal (const Framed< Base2 > &other, double epsilon) const
 Tests if this Coordinate is within epsilon in distance (as defined by this Coordinate's reference frame's distance metric). More...
 
double distance_to (const derived_type &target) const
 Calculate distance from this Coordinate to a target. More...
 
const ReferenceFrameframe () const
 Getter for the ReferenceFrame this Coordinate belongs to. More...
 
ReferenceFrame frame (ReferenceFrame new_frame)
 Setter for the ReferenceFrame this Coordinate belongs to. More...
 
void normalize ()
 Reduces this Coordinate to it's normalized form, should one exist. More...
 
void transform_this_to (const ReferenceFrame &new_frame)
 Transform this coordinate, in place, to a new reference frame. More...
 
derived_type WARN_UNUSED transform_to (const ReferenceFrame &new_frame) const
 Copy and transform this coordinate to a new reference frame. More...
 

Private Attributes

ReferenceFrame frame_ = default_frame()
 

Detailed Description

template<typename Impl>
class gams::pose::Framed< Impl >

Internal class implementing coordinates bound to reference frame.

Do not use directly.

Definition at line 107 of file Framed.h.

Member Typedef Documentation

◆ derived_type

template<typename Impl >
using gams::pose::Framed< Impl >::derived_type = typename Impl::derived_type

Definition at line 111 of file Framed.h.

Constructor & Destructor Documentation

◆ Framed() [1/4]

template<typename Impl >
gams::pose::Framed< Impl >::Framed ( )
default

Default Constructor.

Initializes frame as empty

◆ Framed() [2/4]

template<typename Impl >
template<typename... Args>
gams::pose::Framed< Impl >::Framed ( Args &&...  args)

Construct without a ReferenceFrame object.

Initialized frame as empty, unless at least one argument is a type which includes a frame, in which case that frame will become the frame of this pose. If multiple do, the first such argument will be used.

This overload only participates if the first argument isn't ReferenceFrame

Parameters
argsarguments to pass through to base type

◆ Framed() [3/4]

template<typename Impl >
gams::pose::Framed< Impl >::Framed ( ReferenceFrame  frame)
inlineexplicit

Construct using just a ReferenceFrame object.

All coordinate values zero.

Parameters
framethe ReferenceFrame this Coordinate will belong to

Definition at line 152 of file Framed.h.

◆ Framed() [4/4]

template<typename Impl >
template<typename... Args>
gams::pose::Framed< Impl >::Framed ( ReferenceFrame  frame,
Args &&...  args 
)

Construct using a ReferenceFrame object.

Parameters
framethe ReferenceFrame this Coordinate will belong to
argsarguments to pass through to base type. Any types that have a reference frame associated will be transformed into frame first. To avoid this, use the non-framed *Vector types.

Member Function Documentation

◆ approximately_equal()

template<typename Impl >
template<typename Base2 >
bool gams::pose::Framed< Impl >::approximately_equal ( const Framed< Base2 > &  other,
double  epsilon 
) const
inline

Tests if this Coordinate is within epsilon in distance (as defined by this Coordinate's reference frame's distance metric).

If the other Coordinate is in a different reference frame, it is first copied, and converted to this Coordinate's reference frame.

Parameters
otherthe other Coordinate to test against
epsilonthe maximum distance permitted to return true
Returns
true if the distance is less than or equal to epsilon

Definition at line 208 of file Framed.h.

◆ distance_to()

template<typename Impl >
double gams::pose::Framed< Impl >::distance_to ( const derived_type target) const

Calculate distance from this Coordinate to a target.

If the target is in another reference frame, this and the target will be copied, and converted to their closest common frame.

Requres "ReferenceFrame.h"

Parameters
targetthe target Coordinate to calculate distance to
Returns
the distance according to the distance metric in the common frame, for CoordType. Typically, return will be meters or degrees.
Exceptions
unrelated_framesthrown if the target's reference frame is not part of the same tree as the current one.
undefined_transformthrown if no conversion between two frames along the conversion path has been defined.

◆ frame() [1/2]

template<typename Impl >
const ReferenceFrame& gams::pose::Framed< Impl >::frame ( ) const
inline

Getter for the ReferenceFrame this Coordinate belongs to.

Returns
the frame

Definition at line 179 of file Framed.h.

◆ frame() [2/2]

template<typename Impl >
ReferenceFrame gams::pose::Framed< Impl >::frame ( ReferenceFrame  new_frame)
inline

Setter for the ReferenceFrame this Coordinate belongs to.

Any further calculations using this Coordinate will use this frame.

Not thread-safe.

Parameters
new_framethe frame the Coordinate will now belong to
Returns
the old frame

Definition at line 190 of file Framed.h.

◆ normalize()

template<typename Impl >
void gams::pose::Framed< Impl >::normalize ( )

Reduces this Coordinate to it's normalized form, should one exist.

Typically useful for Coordinate types which incorporate angles.

Requres "ReferenceFrame.h"

◆ transform_this_to()

template<typename Impl >
void gams::pose::Framed< Impl >::transform_this_to ( const ReferenceFrame new_frame)

Transform this coordinate, in place, to a new reference frame.

Requres "ReferenceFrame.h"

Parameters
new_framethe frame to transform to
Exceptions
unrelated_framesthrown if the new reference frame is not part of the same tree as the current one.
undefined_transformthrown if no conversion between two frames along the conversion path has been defined.

◆ transform_to()

template<typename Impl >
derived_type WARN_UNUSED gams::pose::Framed< Impl >::transform_to ( const ReferenceFrame new_frame) const

Copy and transform this coordinate to a new reference frame.

Requres "ReferenceFrame.h"

Parameters
new_framethe frame to transform to
Returns
the new coordinate in the new frame
Exceptions
unrelated_framesthrown if the new reference frame is not part of the same tree as the current one.
undefined_transformthrown if no conversion between two frames along the conversion path has been defined.

Member Data Documentation

◆ frame_

template<typename Impl >
ReferenceFrame gams::pose::Framed< Impl >::frame_ = default_frame()
private

Definition at line 278 of file Framed.h.


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