geo_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/GeoUtilities.hpp>
00008 #include <iostream>
00009 
00010 int main(int argc, char* argv[])
00011 {
00012   Eigen::Vector3d geoInit(16,42,1000);
00013 
00014   Eigen::Vector3d xyz = labust::tools::geodetic2ecef(geoInit);
00015   std::cout<<"Origin, GEO->ECEF:"<<xyz.transpose()<<std::endl;
00016   Eigen::Vector3d ned = labust::tools::ecef2ned(xyz, geoInit);
00017   std::cout<<"Origin, ECEF->NED:"<<ned.transpose()<<std::endl;
00018   Eigen::Vector3d xyz2 = labust::tools::ned2ecef(ned, geoInit);
00019   std::cout<<"Origin, NED->ECEF:"<<xyz2.transpose()<<std::endl;
00020   Eigen::Vector3d geoInit2 = labust::tools::ecef2geodetic(xyz2);
00021   std::cout<<"Origin, ECEF->GEO:"<<geoInit2.transpose()<<std::endl;
00022 
00023   std::cout<<std::endl;
00024   Eigen::Vector3d nedR(1000, 5000, 1000);
00025   std::cout<<"Random NED point: n="<<nedR(0)<<", e="<<nedR(1)<<", d="<<nedR(2)<<std::endl;
00026 
00027   Eigen::Vector3d xyz3 = labust::tools::ned2ecef(nedR, geoInit);
00028   std::cout<<"Random, NED->ECEF:"<<xyz3.transpose()<<std::endl;
00029   Eigen::Vector3d geo3 = labust::tools::ecef2geodetic(xyz3);
00030   std::cout<<"Random, ECEF->GEO:"<<geo3.transpose()<<std::endl;
00031   Eigen::Vector3d xyz4 = labust::tools::geodetic2ecef(geo3);
00032   std::cout<<"Random, GEO->ECEF:"<<xyz4.transpose()<<std::endl;
00033   Eigen::Vector3d ned4 = labust::tools::ecef2ned(xyz4, geoInit);
00034   std::cout<<"Random, ECEF->NED:"<<ned4.transpose()<<std::endl;
00035 
00036         return 0;
00037 }
00038 
00039 
00040 
00041 
00042 


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