MRPT - Mobile Robot Programming Toolkit
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的支持
//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的更多相关文章
- 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 ...
- Uva 12569 Planning mobile robot on Tree (EASY Version)
基本思路就是Bfs: 本题的一个关键就是如何判段状态重复. 1.如果将状态用一个int型数组表示,即假设为int state[17],state[0]代表机器人的位置,从1到M从小到大表示障碍物的位置 ...
- UVA-12569 Planning mobile robot on Tree (EASY Version) (BFS+状态压缩)
题目大意:一张无向连通图,有一个机器人,若干个石头,每次移动只能移向相连的节点,并且一个节点上只能有一样且一个东西(机器人或石头),找出一种使机器人从指定位置到另一个指定位置的最小步数方案,输出移动步 ...
- UVA Planning mobile robot on Tree树上的机器人(状态压缩+bfs)
用(x,s)表示一个状态,x表示机器人的位置,s表示其他位置有没有物体.用个fa数组和act数组记录和打印路径,转移的时候判断一下是不是机器人在动. #include<bits/stdc++.h ...
- Awesome C/C++
Awesome C/C++ A curated list of awesome C/C++ frameworks, libraries, resources, and shiny things. In ...
- awesome cpp
https://github.com/fffaraz/awesome-cpp Awesome C/C++ A curated list of awesome C/C++ frameworks, lib ...
- 【干货】国外程序员整理的 C++ 资源大全【转】
来自 https://github.com/fffaraz/awesome-cpp A curated list of awesome C/C++ frameworks, libraries, res ...
- SLAM学习--开源测试数据集合
Tum RGB-D SLAM Dataset and Benchmark https://vision.in.tum.de/data/datasets/rgbd-dataset Kitti http: ...
- [转]awsome c++
原文链接 Awesome C++ A curated list of awesome C++ (or C) frameworks, libraries, resources, and shiny th ...
随机推荐
- Python之contextlib库及源码分析
Utilities for with-statement contexts __all__ = ["contextmanager", "closing", &q ...
- plsql基本操作 复制表 导出表 导出表结构 及其导入
上一片中介绍了安装instantclient +plsql取代庞大客户端的安装,这里说下plsql的基本操作 plsql操作界面图: 1.复制表 语句:create table IGIS_COPY a ...
- UGUI 分页渐变居中效果
代码相当冗长,仅作自己记录 在此分页上修改的https://blog.csdn.net/qinyuanpei/article/details/49781133 using UnityEngine;us ...
- C#中Cache的使用
公共方法Add 将指定项添加到 Cache 对象,该对象具有依赖项.过期和优先级策略以及一个委托(可用于在从 Cache 移除插入项时通知应用程序). Equals(从 Object 继承) 已重载. ...
- 8 函数类型——《Swift3.0从入门到出家
Swift语言中每一个函数都有它特定的数据类型,称其为函数类型 函数类型和基本数据类型一样,可以定义变量或者常量,可以定义函数形参,也可以做为函数的返回值类型 函数类型的格式为:参数列表的数据类型—& ...
- VUE API 重点
VUE API 重点 生命周期方法 每个组件都有生命周期,是向 ReactJs 学习的. computed 在一个组件声明一个人,人有名,人有姓,输入姓和名.((&--&%--& ...
- Linux 简单字符设备驱动
1.hello_drv.c (1) 初始化和卸载函数的格式是固定的,函数名自定义 (2) printk是内核的打印函数,用法与printf一致 (3) MODULE_LICENSE:模块代码支持开源协 ...
- DataGrid方法标注
在VS2010中无法增加了CColumn和Ccolumns类 解决方案,方案名->右击->添加类->ActiveX控件中的MFC类->添加弹出了“从ActiveX控件添加类向导 ...
- HDOJ5876(补图的最短路)
Sparse Graph Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)To ...
- Ubuntu apt-get卸载小记
过sudo apt-get install xxxx 安装软件后,总是无法卸载干净,这里以Apache 为例,提供方法:首先sudo apt-get remove apache2再sudo apt-g ...