1. https://www.mrpt.org/Building_and_Installing_Instructions#1_Prerequisites

P1. error C2371: “int32_t”: 重定义;不同的基类型  或“int8_t”

解决办法:因为两个.h文件所定义的int32_t和int8_t的类型不同。错误会提示哪两个.h文件冲突,打开pstdint.h文件,找到对应的定义,并修改为另一个.h文件的定义类型。

P2. Miscellaneous.h文件 error C2719: “p1”: 具有 __declspec(align('16')) 的形参将不被对齐 ,这个问题是编译时候包含了对PCL的支持

问题分析参考:https://stackoverflow.com/questions/28488986/formal-parameter-with-declspecalign16-wont-be-aligned/28489103

//Miscellaneous.h 修改为
struct Segment
{
Segment(const PointT& p0, const PointT& p1)
{
P0 = p0;
P1 = p1;
}; PointT P0, P1;
}; /*! Square of the distance between two segments */
float PBMAP_IMPEXP dist3D_Segment_to_Segment2(const Segment& S1, const Segment& S2); //对应的 Miscellaneous.cpp 修改为
float PBMAP_IMPEXP dist3D_Segment_to_Segment2(const Segment& S1, const Segment& S2)
{} //同时注释掉 PbMapMaker.h
typedef pcl::PointXYZRGBA PointT;

2. Visula Studio 2013 测试

1、先将D:\Apps\MRPT\include\mrpt\mrpt-config\mrpt目录下的config.h和version.h复制到D:\Apps\MRPT\include\mrpt目录下。

2、打开VS2013,建立mrptTest项目:新建项目——C++——设置文件名mrptTest, WIN32控制台应用程序

3、打开工程属性——VC++目录——包含目录 :添加目录D:\Apps\MRPT\include和 D:\Apps\MRPT\libs\XXXX\include

第二个包含选项众多,我是将所有libs目录下所有的mrpt和otherlibs文件夹复制到D:\Apps\MRPT\include\,然后再添加该目录。需要用wxWidgets,则添加D:\Apps\wxWidgets-3.0.4\include

4、打开工程属性——VC++ 目录——库目录:在配置Debug中添加目录D:\Apps\MRPT\lib 并链接库 libmrpt-base130.lib

三、编写代码 这里采用MRPT的例子,参考 https://raw.githubusercontent.com/MRPT/mrpt/master/doc/mrpt_example1/test.cpp

#include "stdafx.h"
#include <mrpt/poses/CPoint3D.h>
#include <mrpt/poses/CPose2D.h>
#include <mrpt/poses/CPose3D.h>
#include <mrpt/utils/CTicTac.h> using namespace mrpt::utils;
using namespace mrpt::poses;
using namespace std; int _tmain(int argc, _TCHAR* argv[])
{
try
{
// The landmark (global) position: 3D (x,y,z)
CPoint3D L(0, 4, 2); // Robot pose: 2D (x,y,phi)
CPose2D R(2, 1, DEG2RAD(45.0f)); // Camera pose relative to the robot: 6D (x,y,z,yaw,pitch,roll).
CPose3D C(0.5f, 0.5f, 1.5f, DEG2RAD(-90.0f), DEG2RAD(0), DEG2RAD(-90.0f)); // TEST 1. Relative position L' of the landmark wrt the camera
// --------------------------------------------------------------
cout << "L: " << L << endl;
cout << "R: " << R << endl;
cout << "C: " << C << endl;
cout << "R+C:" << (R + C) << endl;
//cout << (R+C).getHomogeneousMatrix(); CPoint3D L2;
CTicTac tictac;
tictac.Tic();
size_t i, N = 10000;
for (i = 0; i<N; i++)
L2 = L - (R + C);
cout << "Computation in: " << 1e6 * tictac.Tac() / ((double)N) << " us" << endl; cout << "L': " << L2 << endl; // TEST 2. Reconstruct the landmark position:
// --------------------------------------------------------------
CPoint3D L3 = R + C + L2;
cout << "R(+)C(+)L' = " << L3 << endl;
cout << "Should be equal to L = " << L << endl; // TEST 3. Distance from the camera to the landmark
// --------------------------------------------------------------
cout << "|(R(+)C)-L|= " << (R + C).distanceTo(L) << endl;
cout << "|L-(R(+)C)|= " << (R + C).distanceTo(L) << endl; return 0;
}
catch (exception &e)
{
cerr << "EXCEPCTION: " << e.what() << endl;
return -1;
}
catch (...)
{
cerr << "Untyped excepcion!!";
return -1;
}
}

输出如下结果则表示安装正常

最新文章

  1. Discuz 7.0版块横排显示版块图标和版块简介的方法
  2. 回忆读windows 核心编程
  3. Java性能优化权威指南-读书笔记(三)-JVM性能调优-内存占用
  4. Java 任务调度
  5. Android Bundle传递简单数据、对象数据
  6. python之socket编程
  7. Eclipse Velocity插件安装
  8. ubuntu自动登录tty1(shell,text)配置
  9. LOJ #2978「THUSCH 2017」杜老师
  10. Java 处理word文档后在前端展示
  11. rabbit原理及项目应用
  12. 聚宽投资研究获取A股05年至今全部数据
  13. CentOS MariaDB 安装和配置
  14. 【MM系列】SAP MM 非限制/可用库存
  15. jquery正则表达式
  16. 【Android】ImageView ScaleType属性值
  17. python自动化测试入门篇-jemter
  18. CentOS7 YUM安装与配置 MySQL5.7
  19. Python 全栈开发十 socket网络编程
  20. linux实现开机自启动脚本

热门文章

  1. Python之json文件
  2. JQuery 提示用户名密码不为空
  3. LG5055 【模板】可持久化文艺平衡树
  4. 列表推导式,两个for循环的例子
  5. 初识用.NET Remoting来开发分布式应用
  6. 搭建基于hyperledger fabric的联盟社区(一) --前言
  7. Unidac手工安装
  8. (转)pipe row的用法, Oracle split 函数写法.
  9. Java-Maven-Runoob:Maven构建生命周期
  10. 小程序App方法