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;
}
}

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

MRPT - Mobile Robot Programming Toolkit的更多相关文章

  1. UVA12569-Planning mobile robot on Tree (EASY Version)(BFS+状态压缩)

    Problem UVA12569-Planning mobile robot on Tree (EASY Version) Accept:138  Submit:686 Time Limit: 300 ...

  2. Uva 12569 Planning mobile robot on Tree (EASY Version)

    基本思路就是Bfs: 本题的一个关键就是如何判段状态重复. 1.如果将状态用一个int型数组表示,即假设为int state[17],state[0]代表机器人的位置,从1到M从小到大表示障碍物的位置 ...

  3. UVA-12569 Planning mobile robot on Tree (EASY Version) (BFS+状态压缩)

    题目大意:一张无向连通图,有一个机器人,若干个石头,每次移动只能移向相连的节点,并且一个节点上只能有一样且一个东西(机器人或石头),找出一种使机器人从指定位置到另一个指定位置的最小步数方案,输出移动步 ...

  4. UVA Planning mobile robot on Tree树上的机器人(状态压缩+bfs)

    用(x,s)表示一个状态,x表示机器人的位置,s表示其他位置有没有物体.用个fa数组和act数组记录和打印路径,转移的时候判断一下是不是机器人在动. #include<bits/stdc++.h ...

  5. Awesome C/C++

    Awesome C/C++ A curated list of awesome C/C++ frameworks, libraries, resources, and shiny things. In ...

  6. awesome cpp

    https://github.com/fffaraz/awesome-cpp Awesome C/C++ A curated list of awesome C/C++ frameworks, lib ...

  7. 【干货】国外程序员整理的 C++ 资源大全【转】

    来自 https://github.com/fffaraz/awesome-cpp A curated list of awesome C/C++ frameworks, libraries, res ...

  8. SLAM学习--开源测试数据集合

    Tum RGB-D SLAM Dataset and Benchmark https://vision.in.tum.de/data/datasets/rgbd-dataset Kitti http: ...

  9. [转]awsome c++

    原文链接 Awesome C++ A curated list of awesome C++ (or C) frameworks, libraries, resources, and shiny th ...

随机推荐

  1. 深入理解java虚拟机-第十章-早期(编译期)优化

    第10章  早期(编译期)优化 javac编译过程: 1.解析与填充符号表过程 词法.语法分析 将源代码的字条流转变为标记(Token)集合.如“int a = b + 2”这名代码包含了6个标记,分 ...

  2. Java关闭线程的安全方法

    Java之前有一个api方法可以直接关闭线程,stop(),由于这个方法是强制性地关闭线程,有的时候会发生错误,之后就取消了,现在可用的方法主要有两种: 1.  在线程中加入一个成员变量,当一个fla ...

  3. YII缓存之数据缓存

    1.开启缓存组件 2. ================ 二 先在配置文件components数组中加上: 'cache'=>array( 'class'=>'CFileCache'), ...

  4. as3随机数

    for(var i:int = 0;i<100;i++){    trace(Math.floor(Math.random()*3)); } Math.floor(Math.random()*3 ...

  5. JDBC预编译语句表名占位异常

    有时候,我们有这样的需求,需要清空多个表的内容,这样我们有两种做法,可用delete from table 或 truncate table table,两种方法视情况而定,前者只是一条条的删除表数据 ...

  6. bzoj 4032 [HEOI2015]最短不公共子串——后缀自动机

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4032 不是 b 的子串的话就对 b 建后缀自动机,在 a 上枚举从每个位置开始的子串或者找子 ...

  7. zabbix 3.0.2自定义脚本

    http://blog.51cto.com/xiao987334176/1769766 有一个通知队列,如果超过了一定的值,就需要报警一下 查询接口可以返回队列的数量,格式是json,data后面的数 ...

  8. nginx config的多个config配置

    在我们的一台服务器上,一个nginx服务器下面可能跑着许多许多的项目; 那么就需要配置多个对应的配置 端口号 已经文件入库目录等等 那么项目多了以后,把这些项目都写到一个文件里 到后期难以查看与管理 ...

  9. FIR滤波器和IIR滤波器的区别

    数字滤波器广泛应用于硬件电路设计,在离散系统中尤为常见,一般可以分为FIR滤波器和IIR滤波器,那么他们有什么区别和联系呢. FIR滤波器 定义: FIR滤波器是有限长单位冲激响应滤波器,又称为非递归 ...

  10. SpringBoot中通过SpringBootServletInitializer如何实现容器初始化

    相关文章 <Servlet3.0之四:动态注册和Servlet容器初始化> <SpringBoot中通过SpringBootServletInitializer如何实现组件加载> ...