56 #ifndef _GAMS_POSE_POSE_H_
57 #define _GAMS_POSE_POSE_H_
65 namespace gams {
namespace pose {
72 template<
typename Derived>
109 double rx,
double ry,
double rz);
147 Derived &
self() {
return static_cast<Derived&
>(*this); }
148 const Derived &
self()
const {
return static_cast<const Derived&
>(*this); }
150 template<
typename Derived2>
156 template<
typename Derived2>
168 const madara::knowledge::containers::DoubleVector &vec);
176 const madara::knowledge::containers::NativeDoubleVector &vec);
184 const madara::knowledge::containers::DoubleVector &vec_loc,
185 const madara::knowledge::containers::DoubleVector &vec_rot);
193 const madara::knowledge::containers::NativeDoubleVector &vec_loc,
194 const madara::knowledge::containers::NativeDoubleVector &vec_rot);
280 double set(
int i,
double val);
338 template<
typename Derived2>
340 double epsilon)
const
342 (void)other;(void)epsilon;
343 throw "unimplemented";
348 template<
typename Derived2>
351 throw "unimplemented";
363 const std::string & delimiter =
", ",
364 const std::string & unset_identifier =
"<unset>")
const;
371 madara::knowledge::containers::NativeDoubleVector &container)
const;
378 const madara::knowledge::containers::NativeDoubleVector &container);
385 const std::vector <double> &container);
398 public Framed<BasicPose<Pose>>
474 public Stamped<Framed<BasicPose<StampedPose>>>
526 template<
typename Derived>
529 o << Derived::type_name <<
"(";
Underlying template for all Pose types, including PoseVector, Pose, and StampedPose See PositionVecto...
double get(int i) const
Retrives i'th coordinate, 0-indexed, in order x, y, z, rx, ry, rz.
PositionVector & as_position_vec()
Gets a reference to this object's Position part.
BasicPose()
Default constructor.
void to_container(madara::knowledge::containers::NativeDoubleVector &container) const
Saves the pose to a MADARA container.
BasicPose(const madara::knowledge::containers::DoubleVector &vec_loc, const madara::knowledge::containers::DoubleVector &vec_rot)
Constructor from two MADARA DoubleVectors, for position and orientation.
static constexpr bool positional()
Is this coordinate a positional one?
BasicPose(const madara::knowledge::containers::DoubleVector &vec)
Constructor from MADARA DoubleVector.
PositionVector & as_location_vec()
double set(int i, double val)
Sets i'th coordinate, 0-indexed, in order x, y, z, rx, ry, rz.
double distance_to(const BasicPose< Derived2 > &target) const
bool operator==(const BasicPose &rhs) const
Tests for exact equality.
const OrientationVector & as_orientation_vec() const
Gets a const reference to this object's Orientation part.
std::string to_string(const std::string &delimiter=", ", const std::string &unset_identifier="<unset>") const
Returns a string of the values x, y, z, rx, ry, rz.
bool is_orientation_set() const
Tests if the orientation/orientation has been set.
bool is_location_set() const
const PositionVector & as_location_vec() const
void from_container(const std::vector< double > &container)
Imports the pose from a STL vector container.
const BaseType & as_vec() const
Gets a const reference to this object.
static std::string name()
Get the name of this coordinate type.
BasicPose(double x, double y)
Constructs a BasicPose from individual position values.
BaseType & as_vec()
Gets a reference to this object.
bool is_location_zero() const
bool is_set() const
Tests if this Pose is invalid; i.e., any values are INVAL_COORD.
BasicPose(double x, double y, double z, double rx, double ry, double rz)
Constructs a BasicPose from individual position and orientation values.
BasicPose(const madara::knowledge::containers::NativeDoubleVector &vec)
Constructor from MADARA NativeDoubleVector.
bool is_position_set() const
Tests if the position is set(valid).
bool is_zero() const
Tests if all pose information is zero.
BasicPose(const PositionVector &pos)
Construct a BasicPose from a PositionVector.
BasicPose(const madara::knowledge::containers::NativeDoubleVector &vec_loc, const madara::knowledge::containers::NativeDoubleVector &vec_rot)
Constructor from two MADARA NativeDoubleVector, for position/orientation.
bool approximately_equal(const BasicPose< Derived2 > &other, double epsilon) const
Tests if this Coordinate is within epsilon in distance(as defined by this Coordinate's reference fram...
int size() const
Get the number of values this coordinate type uses.
BasicPose(const OrientationVector &rot)
Construct a BasicPose from a OrientationVector.
static constexpr bool rotational()
Is this coordinate a rotational one?
OrientationVector & as_orientation_vec()
Gets a reference to this object's Orientation part.
bool is_orientation_zero() const
Tests if all orientation information is zero.
BasicPose(double x, double y, double z)
Constructs a BasicPose from individual position values.
BasicPose(const PositionVector &pos, const OrientationVector &rot)
Construct from individual PositionVector and OrientationVector.
const PositionVector & as_position_vec() const
Gets a const reference to this object's Position part.
void from_container(const madara::knowledge::containers::NativeDoubleVector &container)
Imports the pose from a MADARA container.
bool is_position_zero() const
Tests if all position information is zero.
For internal use. The underlying template for all coordinate types.
Internal class implementing coordinates bound to reference frame.
const ReferenceFrame & frame() const
Getter for the ReferenceFrame this Coordinate belongs to.
static constexpr const char * type_name
Pose(const Position &pos, const Orientation &ori)
double angle_to(const Orientation &target) const
Finds angle to the target; transforms target to this frame if needed.
double angle_to(const Pose &target, U u) const
Finds angle to the target; transforms target to this frame if needed.
Pose(const StampedOrientation &ori)
Pose(const Position &pos)
double angle_to(const Orientation &target, U u) const
Finds angle to the target; transforms target to this frame if needed.
static constexpr const char * type_name
double angle_to(const Pose &target) const
Finds angle to the target; transforms target to this frame if needed.
Pose(const Orientation &ori)
Pose(const StampedPosition &pos)
Pose(const StampedPosition &pos, const StampedOrientation &ori)
BasicVector< PositionVector, units::absolute< units::length > > Base
StampedPose(const Position &pos)
StampedPose(const Orientation &ori)
StampedPose(const StampedOrientation &ori)
static constexpr const char * type_name
StampedPose(const StampedPosition &pos, const StampedOrientation &ori)
StampedPose(const Position &pos, const Orientation &ori)
StampedPose(const StampedPosition &pos)
Internal class implementing coordinates stamped with timestamp.
TimeValue time() const
Get time as std::chrono based TimeValue.
std::ostream & operator<<(std::ostream &o, const Eigen::Vector3d &v)
gams::pose::Orientation Orientation
Represents a orientation or orientation within a reference frame.
Contains all GAMS-related tools, classes and code.
Copyright (c) 2015 Carnegie Mellon University.
Copyright (c) 2015-2018 Carnegie Mellon University.
Copyright (c) 2015 Carnegie Mellon University.