Cheetah Software  1.0
OrientationEstimator.cpp
Go to the documentation of this file.
1 
14 
15 template <typename T>
17  this->_stateEstimatorData.result->orientation =
18  this->_stateEstimatorData.cheaterState->orientation.template cast<T>();
19  this->_stateEstimatorData.result->rBody = ori::quaternionToRotationMatrix(
20  this->_stateEstimatorData.result->orientation);
21  this->_stateEstimatorData.result->omegaBody =
22  this->_stateEstimatorData.cheaterState->omegaBody.template cast<T>();
23  this->_stateEstimatorData.result->omegaWorld =
24  this->_stateEstimatorData.result->rBody.transpose() *
25  this->_stateEstimatorData.result->omegaBody;
26  this->_stateEstimatorData.result->rpy =
27  ori::quatToRPY(this->_stateEstimatorData.result->orientation);
28  this->_stateEstimatorData.result->aBody =
29  this->_stateEstimatorData.cheaterState->acceleration.template cast<T>();
30  this->_stateEstimatorData.result->aWorld =
31  this->_stateEstimatorData.result->rBody.transpose() *
32  this->_stateEstimatorData.result->aBody;
33 }
34 
35 template <typename T>
37  this->_stateEstimatorData.result->orientation[0] =
38  this->_stateEstimatorData.vectorNavData->quat[3];
39  this->_stateEstimatorData.result->orientation[1] =
40  this->_stateEstimatorData.vectorNavData->quat[0];
41  this->_stateEstimatorData.result->orientation[2] =
42  this->_stateEstimatorData.vectorNavData->quat[1];
43  this->_stateEstimatorData.result->orientation[3] =
44  this->_stateEstimatorData.vectorNavData->quat[2];
45  this->_stateEstimatorData.result->rBody = ori::quaternionToRotationMatrix(
46  this->_stateEstimatorData.result->orientation);
47  this->_stateEstimatorData.result->omegaBody =
48  this->_stateEstimatorData.vectorNavData->gyro.template cast<T>();
49  this->_stateEstimatorData.result->omegaWorld =
50  this->_stateEstimatorData.result->rBody.transpose() *
51  this->_stateEstimatorData.result->omegaBody;
52  this->_stateEstimatorData.result->rpy =
53  ori::quatToRPY(this->_stateEstimatorData.result->orientation);
54  this->_stateEstimatorData.result->aBody =
55  this->_stateEstimatorData.vectorNavData->accelerometer.template cast<T>();
56  this->_stateEstimatorData.result->aWorld =
57  this->_stateEstimatorData.result->rBody.transpose() *
58  this->_stateEstimatorData.result->aBody;
59 }
60 
61 
64 
Vec3< typename T::Scalar > quatToRPY(const Eigen::MatrixBase< T > &q)
Mat3< typename T::Scalar > quaternionToRotationMatrix(const Eigen::MatrixBase< T > &q)
All Orientation Estimation Algorithms.