Control Libraries 6.3.4
Loading...
Searching...
No Matches
DualQuaternionState.hpp
1#pragma once
2
3#include "state_representation/space/SpatialState.hpp"
4
5namespace state_representation {
11private:
12 Eigen::Quaterniond primary;
13 Eigen::Quaterniond dual;
14
15public:
19 explicit DualQuaternionState();
20
26 explicit DualQuaternionState(const std::string& name, const std::string& reference = "world");
27
32
39 explicit DualQuaternionState(const std::string& name,
40 const Eigen::Quaterniond& primary,
41 const Eigen::Quaterniond& dual,
42 const std::string& reference = "world");
43
47 const Eigen::Quaterniond& get_primary() const;
48
52 const Eigen::Quaterniond& get_dual() const;
53
57 void set_primary(const Eigen::Quaterniond& primary);
58
62 void set_dual(const Eigen::Quaterniond& dual);
63
70
77
82 const DualQuaternionState conjugate() const;
83
87 virtual void initialize();
88
93 const DualQuaternionState copy() const;
94
100 friend const DualQuaternionState operator*(const float& lambda, const DualQuaternionState& state);
101
107 friend const DualQuaternionState exp(const DualQuaternionState& state);
108
115 friend std::ostream& operator<<(std::ostream& os, const DualQuaternionState& state);
116};
117
118inline const Eigen::Quaterniond& DualQuaternionState::get_primary() const {
119 return this->primary;
120}
121
122inline const Eigen::Quaterniond& DualQuaternionState::get_dual() const {
123 return this->dual;
124}
125
126inline void DualQuaternionState::set_primary(const Eigen::Quaterniond& primary) {
127 this->set_filled();
128 this->primary = primary;
129}
130
131inline void DualQuaternionState::set_dual(const Eigen::Quaterniond& dual) {
132 this->set_filled();
133 this->dual = dual;
134}
135}
Class to represent a state in Dual Quaternion space.
const Eigen::Quaterniond & get_dual() const
Getter of the dual attribute.
friend std::ostream & operator<<(std::ostream &os, const DualQuaternionState &state)
Overload the ostream operator for printing.
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.
DualQuaternionState & operator*=(const DualQuaternionState &q)
Overload the *= operator.
const DualQuaternionState copy() const
Return a copy of the DualQuaternionState.
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.
friend const DualQuaternionState exp(const DualQuaternionState &state)
overload exp function
const DualQuaternionState conjugate() const
compute the conjugate of the current DualQuaternion
void set_filled()
Setter of the empty attribute to false and also reset the timestamp.
Definition: State.cpp:31
Core state variables and objects.