GAMS  1.4.0
gams::pose::StampedPose Class Reference

#include <Pose.h>

Inheritance diagram for gams::pose::StampedPose:
gams::pose::Stamped< Framed< BasicPose< StampedPose > > > gams::pose::Framed< Impl >

Public Types

using derived_type = typename Impl::derived_type
 

Public Member Functions

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...
 
uint64_t nanos () const
 Get time as nanos since std::steady_clock epoch. More...
 
uint64_t nanos (uint64_t v)
 Set time as nanos since std::steady_clock epoch. More...
 
void normalize ()
 Reduces this Coordinate to it's normalized form, should one exist. More...
 
double secs () const
 Get time as seconds since std::steady_clock epoch. More...
 
double secs (double v)
 Set time as seconds since std::steady_clock epoch. More...
 
TimeValue time () const
 Get time as std::chrono based TimeValue. More...
 
TimeValue time (TimeValue v)
 Set time from std::chrono based TimeValue. 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 Types

using Base = Stamped< Framed< BasicPose< StampedPose > >>
 

Private Member Functions

 StampedPose ()=default
 
 StampedPose (const Orientation &ori)
 
 StampedPose (const Position &pos)
 
 StampedPose (const Position &pos, const Orientation &ori)
 
 StampedPose (const StampedOrientation &ori)
 
 StampedPose (const StampedPosition &pos)
 
 StampedPose (const StampedPosition &pos, const StampedOrientation &ori)
 
 operator StampedOrientation () const
 Castig operator to extract StampedOrientation from this Pose. More...
 
 operator StampedPosition () const
 Casting operator to extract StampedPosition from this Pose. More...
 

Private Attributes

ReferenceFrame frame_ = default_frame()
 
TimeValue time_
 

Static Private Attributes

static constexpr const char * type_name = "StampedPose"
 

Detailed Description

Definition at line 473 of file Pose.h.

Member Typedef Documentation

◆ Base

Definition at line 476 of file Pose.h.

◆ derived_type

using gams::pose::Stamped< Framed< BasicPose< StampedPose > > >::derived_type = typename Impl::derived_type
inherited

Definition at line 107 of file Stamped.h.

Constructor & Destructor Documentation

◆ StampedPose() [1/7]

gams::pose::StampedPose::StampedPose ( )
privatedefault

◆ StampedPose() [2/7]

gams::pose::StampedPose::StampedPose ( const Position pos)
inlineprivate

Definition at line 483 of file Pose.h.

◆ StampedPose() [3/7]

gams::pose::StampedPose::StampedPose ( const StampedPosition pos)
inlineprivate

Definition at line 486 of file Pose.h.

◆ StampedPose() [4/7]

gams::pose::StampedPose::StampedPose ( const Orientation ori)
inlineprivate

Definition at line 489 of file Pose.h.

◆ StampedPose() [5/7]

gams::pose::StampedPose::StampedPose ( const StampedOrientation ori)
inlineprivate

Definition at line 492 of file Pose.h.

◆ StampedPose() [6/7]

gams::pose::StampedPose::StampedPose ( const Position pos,
const Orientation ori 
)
inlineprivate

Definition at line 495 of file Pose.h.

◆ StampedPose() [7/7]

gams::pose::StampedPose::StampedPose ( const StampedPosition pos,
const StampedOrientation ori 
)
inlineprivate

Definition at line 498 of file Pose.h.

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
inlineinherited

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
inherited

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
inlineinherited

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)
inlineinherited

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.

◆ nanos() [1/2]

uint64_t gams::pose::Stamped< Framed< BasicPose< StampedPose > > >::nanos ( ) const
inlineinherited

Get time as nanos since std::steady_clock epoch.

Definition at line 174 of file Stamped.h.

◆ nanos() [2/2]

uint64_t gams::pose::Stamped< Framed< BasicPose< StampedPose > > >::nanos ( uint64_t  v)
inlineinherited

Set time as nanos since std::steady_clock epoch.

Definition at line 181 of file Stamped.h.

◆ normalize()

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

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

Typically useful for Coordinate types which incorporate angles.

Requres "ReferenceFrame.h"

◆ operator StampedOrientation()

gams::pose::StampedPose::operator StampedOrientation ( ) const
inlineprivate

Castig operator to extract StampedOrientation from this Pose.

Returns
StampedOrientation with same frame and timestamp as this pose, and same rx/ry/rz values

Definition at line 520 of file Pose.h.

◆ operator StampedPosition()

gams::pose::StampedPose::operator StampedPosition ( ) const
inlineprivate

Casting operator to extract StampedPosition from this Pose.

Returns
Position with same frame as this pose, and same x/y/z values
StampedPosition with same frame and timestamp as this pose, and same x/y/z values

Definition at line 509 of file Pose.h.

◆ secs() [1/2]

double gams::pose::Stamped< Framed< BasicPose< StampedPose > > >::secs ( ) const
inlineinherited

Get time as seconds since std::steady_clock epoch.

Definition at line 188 of file Stamped.h.

◆ secs() [2/2]

double gams::pose::Stamped< Framed< BasicPose< StampedPose > > >::secs ( double  v)
inlineinherited

Set time as seconds since std::steady_clock epoch.

Definition at line 195 of file Stamped.h.

◆ time() [1/2]

TimeValue gams::pose::Stamped< Framed< BasicPose< StampedPose > > >::time ( ) const
inlineinherited

Get time as std::chrono based TimeValue.

Definition at line 167 of file Stamped.h.

◆ time() [2/2]

TimeValue gams::pose::Stamped< Framed< BasicPose< StampedPose > > >::time ( TimeValue  v)
inlineinherited

Set time from std::chrono based TimeValue.

Returns
the new time

Definition at line 171 of file Stamped.h.

◆ transform_this_to()

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

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
inherited

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()
privateinherited

Definition at line 278 of file Framed.h.

◆ time_

TimeValue gams::pose::Stamped< Framed< BasicPose< StampedPose > > >::time_
privateinherited

Definition at line 204 of file Stamped.h.

◆ type_name

constexpr const char* gams::pose::StampedPose::type_name = "StampedPose"
staticconstexprprivate

Definition at line 479 of file Pose.h.


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