camke(10) 多工程集合
作者:互联网
工程代码
CMakeLists.txt
cmake_minimum_required(VERSION 2.8) project(chapter3) set(CMAKE_CXX_FLAGS "-std=c++11") # 加入各子工程 add_subdirectory(examples)
子工程
x下面有两个exe
CMakeLists.txt
include_directories("/usr/include/eigen3") add_executable(coordinateTransform coordinateTransform.cpp) find_package(Pangolin REQUIRED) include_directories(${Pangolin_INCLUDE_DIRS}) add_executable(plotTrajectory plotTrajectory.cpp) target_link_libraries(plotTrajectory ${Pangolin_LIBRARIES})
工程代码
子工程1exe
四元数转换
#include <iostream> #include <vector> #include <algorithm> #include <Eigen/Core> #include <Eigen/Geometry> using namespace std; using namespace Eigen; int main(int argc, char** argv) { Quaterniond q1(0.35, 0.2, 0.3, 0.1), q2(-0.5, 0.4, -0.1, 0.2); q1.normalize(); q2.normalize(); Vector3d t1(0.3, 0.1, 0.1), t2(-0.1, 0.5, 0.3); Vector3d p1(0.5, 0, 0.2); Isometry3d T1w(q1), T2w(q2); T1w.pretranslate(t1); T2w.pretranslate(t2); Vector3d p2 = T2w * T1w.inverse() * p1; cout << endl << p2.transpose() << endl; return 0; }
子工程2exe
plotTrajectory.cpp
标签:10,plotTrajectory,工程,0.1,0.3,0.2,集合,include,camke 来源: https://www.cnblogs.com/gooutlook/p/16357168.html