decomposition_test.cpp
Go to the documentation of this file.
00001 /*
00002  * eigen_test.cpp
00003  *
00004  *  Created on: Oct 16, 2013
00005  *      Author: dnad
00006  */
00007 #include <labust/tools/conversions.hpp>
00008 #include <iostream>
00009 
00010 int main(int argc, char* argv[])
00011 {
00012         using namespace Eigen;
00013         typedef double T;
00014         double roll = 0;
00015         double pitch = 0;
00016         double yaw = M_PI/3;
00017         Quaternion<double> q;
00018         labust::tools::quaternionFromEulerZYX(roll,pitch,yaw,q);
00019         std::cout<<"quat:"<<q.x()<<" "<<q.y()<<" "<<q.z()<<" "<<q.w()<<std::endl;
00020         roll = pitch = yaw = 0;
00021         labust::tools::eulerZYXFromQuaternion(q, roll,pitch,yaw);
00022 
00023         //Tait-Bryan angles (XYZ) local => body
00024         //The angle axis of Eigen are transposed matrices of what we expect
00025         //m = (Cz*Cy*Cx).transpose();
00026 
00027         std::cout<<roll<<std::endl;
00028         std::cout<<pitch<<std::endl;
00029         std::cout<<yaw<<std::endl;
00030 
00031         //std::cout<<q<<std::endl;
00032 
00033         //q = Quaternion<T>(m);
00034         return 0;
00035 }
00036 
00037 
00038 
00039 
00040 


labust_navigation
Author(s): Gyula Nagy
autogenerated on Fri Aug 28 2015 11:23:33