一、编译安装
??????? 系统ubuntu16.04、ros-kinetic、gird_map 1.6.0-1.6.2。
1.1 官方github
?????? GitHub - ANYbotics/grid_map: Universal grid map library for mobile robotic mappingUniversal grid map library for mobile robotic mapping - GitHub - ANYbotics/grid_map: Universal grid map library for mobile robotic mappinghttps://github.com/ANYbotics/grid_map
???????? ros-kinetic适用grid_map版本:1.6.0--1.6.2
https://github.com/ANYbotics/grid_map/issues/279https://github.com/ANYbotics/grid_map/issues/279
1.2 安装编译
sudo apt-get install ros-kinetic-grid-map
##安装依赖
sudo apt-get install libeigen3-dev
##创建工作空间编译
mkdir -p xxx/grid_map_ws/src
cd grid_map_ws/src
git clone -b 1.6.0 https://github.com/anybotics/grid_map.git
cd ..
catkin_make
#或以Release模式编译
#catkin_make -DCMAKE_BUILD_TYPE=Release
??????? 使用1.6.0版本的grid_map编译,不会报错。
??????? 下面是按照官方github的readme.md进行编译的一些报错
1.3 编译踩坑
##git clone默认版本,会报错
git clone https://github.com/anybotics/grid_map.git
1.3.1 编译报错----fatal error: filters/filter_base.hpp: 没有那个文件或目录
??????? 相应修改:
grid_map_ws/src/grid_map/grid_map_cv/include/grid_map_cv/InpaintFilter.hpp 的第十行
#include <filters/filter_base.hpp> 为 #include <filters/filter_base.h>
??????? 此外,结合上次经验,还需要修改:
文件夹grid_map_ws/src/grid_map/grid_map_filters/include/grid_map_filters下几乎所有文件
#include <filters/filter_base.hpp> 或 #include <filters/filter_base.h>
文件grid_map_ws/src/grid_map/grid_map_demos/include/grid_map_demos/FiltersDemo.hpp
#include <filters/filter_chain.hpp> 为#include <filters/filter_chain.h>
文件grid_map_ws/src/grid_map/grid_map_demos/src/normal_filter_comparison_node.cpp
#include <filters/filter_chain.hpp> 为 #include <filters/filter_chain.h>
1.3.2 编译报错----error: ‘class rviz::DisplayContext’ has no member named ‘getTF2BufferPtr’
https://github.com/ANYbotics/grid_map/issues/279https://github.com/ANYbotics/grid_map/issues/279??????? 参考上面的链接,说的是grid_map github仓的默认版本为ubuntu18.04的melodic,上面直接git clone 的版本不适用ubuntu16.04的ros-kinetic。参考链接,将原来git clone的删掉,git clone 1.6.0-1.6.2版本的.
git clone -b 1.6.0 https://github.com/anybotics/grid_map.git
1.4 安装测试
??????? 适用catkin_make编译的(我用的)
source devel/setup.bash
catkin_make run_tests_grid_map_core run_tests_grid_map_ros
??????? 测试成功:
???????? 适用catkin tools的
catkin build grid_map --no-deps --verbose --catkin-make-args run_tests
二、应用demo
##进入工作空间,并source一下
cd grid_map_ws/
source devel/setup.bash
2.1 simple demo
roslaunch grid_map_demos simple_demo.launch
?2.2 tutorial demo
roslaunch grid_map_demos tutorial_demo.launch
2.3 iterators_demo
roslaunch grid_map_demos iterators_demo.launch
?2.4 image to gridmap demo
roslaunch grid_map_demos image_to_gridmap_demo.launch
?2.5 opencv demo
roslaunch grid_map_demos opencv_demo.launch
?
??????? 视频链接:
|