Go to the documentation of this file.00001
00007
00008
00009
00010
00011 #include <iostream>
00012 #include <ecl/command_line.hpp>
00013 #include <ecl/linear_algebra.hpp>
00014
00015
00016
00017
00018
00019 using ecl::ArgException;
00020 using ecl::CmdLine;
00021 using ecl::UnlabeledValueArg;
00022
00023
00024
00025
00026 int main(int argc, char** argv) {
00027
00028
00029
00030
00031 bool hex(false);
00032 double yaw;
00033
00034 try {
00035 CmdLine cmd("Calculator for yaw to quaternion.",' ',"0.1");
00036 UnlabeledValueArg<double> arg_yaw("yaw","Yaw angle to convert",true,0.0,"float", cmd);
00037 cmd.parse(argc,argv);
00038 yaw = arg_yaw.getValue();
00039 } catch ( ArgException &e ) {
00040 std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl;
00041 }
00042 Eigen::Quaternion<double> q;
00043 q = Eigen::AngleAxis<double>(yaw, Eigen::Vector3d::UnitZ());
00044 std::cout << "Quaternion: [x: " << q.x() << " y: " << q.y() << " z: " << q.z() << " w: " << q.w() << "]" << std::endl;
00045
00046 return 0;
00047 }