48 #ifndef OCTOMATH_QUATERNION_H
49 #define OCTOMATH_QUATERNION_H
81 inline Quaternion() { u() = 1; x() = 0; y() = 0; z() = 0; }
94 Quaternion(
float u,
float x,
float y,
float z);
112 Quaternion(
double roll,
double pitch,
double yaw);
128 void toRotMatrix(std::vector <double>& rot_matrix_3_3)
const;
131 inline const float& operator() (
unsigned int i)
const {
return data[i]; }
132 inline float& operator() (
unsigned int i) {
return data[i]; }
139 void operator/= (
float x);
193 inline float&
u() {
return data[0]; }
194 inline float&
x() {
return data[1]; }
195 inline float&
y() {
return data[2]; }
196 inline float&
z() {
return data[3]; }
198 inline const float&
u()
const {
return data[0]; }
199 inline const float&
x()
const {
return data[1]; }
200 inline const float&
y()
const {
return data[2]; }
201 inline const float&
z()
const {
return data[3]; }
203 std::istream& read(std::istream &s);
204 std::ostream& write(std::ostream &s)
const;
205 std::istream& readBinary(std::istream &s);
206 std::ostream& writeBinary(std::ostream &s)
const;
Quaternion()
Default constructor.
OctoMap: A probabilistic, flexible, and compact 3D mapping library for robotic systems.
std::ostream MAPS_IMPEXP & operator<<(std::ostream &s, const Pose6D &p)
user friendly output in format (x y z, u x y z) which is (translation, rotation)
bool operator==(const CArray< T, N > &x, const CArray< T, N > &y)
void normalize(Scalar valMin, Scalar valMax)
Scales all elements such as the minimum & maximum values are shifted to the given values...
Quaternion inv() const
Inversion.
This class represents a Quaternion.
std::vector< T1 > operator*(const std::vector< T1 > &a, const std::vector< T2 > &b)
a*b (element-wise multiplication)
CONTAINER::Scalar norm(const CONTAINER &v)
This class represents a three-dimensional vector.