3#include "state_representation/space/dual_quaternion/DualQuaternionState.hpp"
12 Eigen::Vector3d position;
20 explicit DualQuaternionPose(
const std::string& name,
const std::string& reference =
"world");
36 const Eigen::Vector3d& position,
37 const Eigen::Quaterniond& rotation,
38 const std::string& reference =
"world");
147 Eigen::Quaterniond temp = orientation;
148 if (orientation.norm() - 1 < 1e-4) { temp.normalize(); }
149 if (orientation.w() < 0) {
150 temp = Eigen::Quaterniond(-orientation.w(),
156 this->
set_dual(Eigen::Quaterniond(0.5 * (Eigen::Quaterniond(0,
159 this->position(2)) * this->
get_primary()).coeffs()));
163 this->position = position;
164 this->
set_dual(Eigen::Quaterniond(0.5 * (Eigen::Quaterniond(0,
167 this->position(2)) * this->
get_primary()).coeffs()));
172 this->position = 2 * (dual * this->
get_primary().conjugate()).vec();
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.
friend std::ostream & operator<<(std::ostream &os, const DualQuaternionPose &state)
Overload the ostream operator for printing.
DualQuaternionPose & operator*=(const DualQuaternionPose &q)
Overload the *= operator.
friend const DualQuaternionState log(const DualQuaternionPose &state)
Calculate the log of a dual quaternion.
void operator=(const DualQuaternionState &s)
Overload the = operator with a DualQuaternionState.
const DualQuaternionPose conjugate() const
compute the conjugate of the current DualQuaternionPose
const Eigen::Quaterniond & get_orientation() const
Getter of the orientation from the primary.
const Eigen::Vector3d get_position() const
Getter of the position attribute.
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.
friend const DualQuaternionState operator*(const float &lambda, const DualQuaternionState &state)
Overload the * operator with a scalar.
Core state variables and objects.