56 #ifndef _GAMS_POSE_FRAMED_H_
57 #define _GAMS_POSE_FRAMED_H_
64 #include "madara/knowledge/containers/DoubleVector.h"
65 #include "madara/knowledge/containers/NativeDoubleVector.h"
69 namespace gams {
namespace pose {
73 typename std::enable_if<supports_transform_to<T>::value, T>::type
75 return v.transform_to(frame);
80 typename std::enable_if<!supports_transform_to<T>::value,
const T &>::type
90 template<
typename T,
typename... Args>
92 typename std::enable_if<supports_transform_to<T>::value,
ReferenceFrame>::type
97 template<
typename T,
typename... Args>
99 typename std::enable_if<!supports_transform_to<T>::value,
ReferenceFrame>::type
106 template<
typename Impl>
129 template<
typename... Args>
132 template<
typename Arg,
typename... Args,
133 typename std::enable_if<!std::is_same<typename std::decay<Arg>::type,
134 ReferenceFrame>::value &&
sizeof...(Args) >= 1,
void*>::type =
nullptr>
135 Framed(Arg&& arg, Args&&... args)
136 : Impl((Arg &)arg, ((Args &)args)...),
139 template<
typename Arg,
140 typename std::enable_if<
141 !std::is_same<typename std::decay<Arg>::type,
143 explicit Framed(Arg&& arg)
164 template<
typename... Args>
167 template<
typename... Args,
168 typename std::enable_if<(
sizeof...(Args) >= 1),
void*>::type =
nullptr>
207 template<
typename Base2>
209 double epsilon)
const
211 return std::fabs(
self().
distance_to(other.self())) < epsilon;
Internal class implementing coordinates bound to reference frame.
ReferenceFrame frame(ReferenceFrame new_frame)
Setter for the ReferenceFrame this Coordinate belongs to.
void transform_this_to(const ReferenceFrame &new_frame)
Transform this coordinate, in place, to a new reference frame.
Framed(ReferenceFrame frame, Args &&... args)
Construct using a ReferenceFrame object.
derived_type WARN_UNUSED transform_to(const ReferenceFrame &new_frame) const
Copy and transform this coordinate to a new reference frame.
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 fra...
const ReferenceFrame & frame() const
Getter for the ReferenceFrame this Coordinate belongs to.
Framed(ReferenceFrame frame)
Construct using just a ReferenceFrame object.
Framed()=default
Default Constructor.
Framed(Args &&... args)
Construct without a ReferenceFrame object.
void normalize()
Reduces this Coordinate to it's normalized form, should one exist.
typename Impl::derived_type derived_type
double distance_to(const derived_type &target) const
Calculate distance from this Coordinate to a target.
Provides Reference Frame (i.e., coordinate systemm) transforms.
GAMS_EXPORT const ReferenceFrame & default_frame(void)
Default frame.
ReferenceFrame try_get_frame()
auto try_transform_to(const T &v, const ReferenceFrame &frame) -> typename std::enable_if< supports_transform_to< T >::value, T >::type
gams::pose::ReferenceFrame ReferenceFrame
Base class for Reference Frames.
Contains all GAMS-related tools, classes and code.
Copyright (c) 2015 Carnegie Mellon University.
Copyright (c) 2015 Carnegie Mellon University.