1#include "state_representation/space/dual_quaternion/DualQuaternionPose.hpp"
18 const Eigen::Vector3d& position,
19 const Eigen::Quaterniond& orientation,
20 const std::string& reference) :
43 Eigen::Quaterniond dual =
61 Eigen::Quaterniond dual =
86 this->position = Eigen::Vector3d(0, 0, 0);
96 Eigen::AngleAxisd axis_angle(state.get_primary());
97 Eigen::Vector3d rotation = (axis_angle.angle() * axis_angle.axis()) / 2;
98 Eigen::Vector3d position = state.get_position() / 2;
99 result.
set_primary(Eigen::Quaterniond(0, rotation(0), rotation(1), rotation(2)));
100 result.
set_dual(Eigen::Quaterniond(0, position(0), position(1), position(2)));
105 if (state.is_empty()) {
106 os <<
"Empty DualQuaternionPose";
108 os << state.get_name() <<
" DualQuaternionPose expressed in " << state.get_reference_frame() <<
" frame"
110 os <<
"primary/orientation: (" << state.get_primary().w() <<
", ";
111 os << state.get_primary().x() <<
", ";
112 os << state.get_primary().y() <<
", ";
113 os << state.get_primary().z() <<
")";
114 Eigen::AngleAxisd axis_angle(state.get_primary());
115 os <<
" <=> theta: " << axis_angle.angle() <<
", ";
116 os <<
"axis: (" << axis_angle.axis()(0) <<
", ";
117 os << axis_angle.axis()(1) <<
", ";
118 os << axis_angle.axis()(2) <<
")" << std::endl;
119 os <<
"dual: (" << state.get_dual().w() <<
", ";
120 os << state.get_dual().x() <<
", ";
121 os << state.get_dual().y() <<
", ";
122 os << state.get_dual().z() <<
")";
123 Eigen::Vector3d position = state.get_position();
124 os <<
" => position: (" << position(0) <<
", ";
125 os << position(1) <<
", ";
126 os << position(2) <<
")";
Class to represent a Pose in Dual Quaternion space.
void set_orientation(const Eigen::Quaterniond &orientation)
Setter of the orientation.
const DualQuaternionPose inverse() const
compute the inverse of the current DualQuaternionPose
void set_position(const Eigen::Vector3d &position)
Setter of the psotion from a vector.
void initialize()
Initialize the DualQuaternionPose to a zero value.
DualQuaternionPose & operator*=(const DualQuaternionPose &q)
Overload the *= operator.
void operator=(const DualQuaternionState &s)
Overload the = operator with a DualQuaternionState.
const DualQuaternionPose conjugate() const
compute the conjugate of the current DualQuaternionPose
DualQuaternionPose(const std::string &name, const std::string &reference="world")
Constructor with name and reference frame provided.
const DualQuaternionPose copy() const
Return a copy of the DualQuaternionPose.
Class to represent a state in Dual Quaternion space.
const Eigen::Quaterniond & get_dual() const
Getter of the dual attribute.
const Eigen::Quaterniond & get_primary() const
Getter of the primary attribute.
void set_primary(const Eigen::Quaterniond &primary)
Setter of the primary attribute.
void set_dual(const Eigen::Quaterniond &dual)
Setter of the dual attribute.
virtual void initialize()
Initialize the DualQuaternionState to a zero value.
friend const DualQuaternionState operator*(const float &lambda, const DualQuaternionState &state)
Overload the * operator with a scalar.
const DualQuaternionState conjugate() const
compute the conjugate of the current DualQuaternion
virtual void set_reference_frame(const std::string &reference_frame)
Setter of the reference frame.
const std::string & get_reference_frame() const
Getter of the reference frame as const reference.
const std::string & get_name() const
Getter of the name as const reference.
virtual void set_name(const std::string &name)
Setter of the name.
Core state variables and objects.
std::ostream & operator<<(std::ostream &os, const Ellipsoid &ellipsoid)
const DualQuaternionState log(const DualQuaternionPose &state)