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. [Luogu3769][CH弱省胡策R2]TATT

    luogu 题意 其实就是四维偏序. sol 第一维排序,然后就只需要写个\(3D-tree\)了. 据说\(kD-tree\)的单次查询复杂度是\(O(n^{1-\frac{1}{k}})\).所以 ...

  2. matlab的fda工具使用方法

    MATLAB中用FDATool设计滤波器及使用 该文章讲述了MATLAB中用FDATool设计滤波器及使用. 1. 在Matlab中键入fdatool运行Filter Design and Analy ...

  3. 转载 matlab矩阵数组常用操作

    一. length             返回矩阵最长维的的长度    ndims       返回维数          numel      返回矩阵元素个数size               ...

  4. 6 字典和集合——《Swift3.0从入门到出家》

    字典和集合 字典 字典是集合类型存放多个键值对,其中键是唯一的,不能重复 字典中存放的键值对是无序的,写入的顺序和读取的顺序可能不同 字典中存放的数据是任意类型 字典可以分为可变字典和不可变字典 创建 ...

  5. git身份验证失败清除密码缓存

    git config --system --unset credential.helper

  6. mysql各种集群的优缺点

    mysql各种集群的优缺点 1.主从架构:只是有数据备份的功能: 2.主主互备+keepalived:实现数据备份加高可用: 3.主主互备,主主下面分别挂个从: 4.A和B主主互备,把从库都挂到B下, ...

  7. Tair 分布式K-V存储方案

    tair 是淘宝的一个开源项目,它是一个分布式的key/value结构数据的解决方案. 作为一个分布式系统,Tair由一个中心控制节点(config server)和一系列的服务节点(data ser ...

  8. Train-Alypay-Cloud:蚂蚁金融云知识点

    ylbtech-Train-Alypay-Cloud:蚂蚁金融云知识点 1.返回顶部 1. 1.数据库与缓存结合使用https://www.cloud.alipay.com/docs/2/47337 ...

  9. JavaScript笔记——事件

    事件一般是用于浏览器和用户操作进行交互.最早是 IE 和 Netscape Navigator 中出现, 作为分担服务器端运算负载的一种手段.直到几乎所有的浏览器都支持事件处理.而 DOM2 级规范开 ...

  10. String to Integer (atoi) ???

    #define INT_MAX 2147483647 #define INT_MIN -2147483648 class Solution { public: int atoi(const char ...