grid_map(二):ubuntu16.04安装测试grid_map 1.6.0-1.6.2

一、编译安装

        系统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 -DCMAKE_BUILD_TYPE=Release

#catkin_make
#或以Release模式编译(建议以Release模式编译,下面2.7会说明原因)
#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

 

        视频链接:https://www.bilibili.com/video/BV1gF411J78D/https://www.bilibili.com/video/BV1gF411J78D/


2.6 resolution change demo

  roslaunch grid_map_demos resolution_change_demo.launch

        视频链接:

https://www.bilibili.com/video/BV1oL4y1W7rc/https://www.bilibili.com/video/BV1oL4y1W7rc/

2.7 filter demo

  roslaunch grid_map_demos filters_demo.launch

filters_demo uses a chain of ROS Filters to process a grid map. Starting from the elevation of a terrain map, the demo uses several filters to show how to compute surface normals, use inpainting to fill holes, smoothen/blur the map, and use math expressions to detect edges, compute roughness and traversability. The filter chain setup is configured in the filters_demo_filter_chain.yaml file。

filters_demo使用一系列的ros过滤器来处理栅格地图。

这个演示从地形图的高程图开始,使用一些列的过滤器来展示,如何计算曲面法线、修补填充孔洞、平滑/模糊地图、使用数学表达式来检测边缘、计算粗糙度和可通行度。

过滤器链设置配置在filters_demo_filter_chain.yaml文件中

        第一次直接正在终端roslaunch,rviz中会显示空白,如下;大概是需要在

         查看readme.md的grid_map_filters篇幅,好像是需要在filters_demo_filter_chain.yaml里面配置不同的过滤器,所以这里显示空白。

        查看系统情况,如下图:8核cpu只有两个满了,16GB运存用了20%多一些,应该不是cpu和内存的问题。

        查看话题:

[meng@meng ~/my_learning/grid_map_ws]$ rostopic list 
/clicked_point
/grid_map_filter_demo/filtered_map
/grid_map_visualization/surface_normals
/grid_map_visualization/traversability_grid
/image_publisher/image
/image_to_gridmap_demo/grid_map
/initialpose
/move_base_simple/goal
/rosout
/rosout_agg
/tf
/tf_static

        其中图像话题可以用:rqt_image_view直接查看:

        唉,可能就是下面链接说的rviz 插件可视化的问题、没有用RELEASE MODE编译问题等等。

https://github.com/ANYbotics/grid_map/issues/167https://github.com/ANYbotics/grid_map/issues/167https://github.com/ANYbotics/grid_map/issues/184https://github.com/ANYbotics/grid_map/issues/184

         这里先尝试最简单的方法,删除原来使用catkin_make编译的文件夹,使用RELEASE MODE编译,就通过了~

catkin_make -DCMAKE_BUILD_TYPE=Release 

         normal mapping:正常建图

       Elevation:高程图,立视图 

        Edge:边缘

        roughness:粗糙度

        traversability:可通行度

         surface normal:表面法向量

  • 8
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
Ray casting grid map是一种基于光线投射的方法,用于生成场景的维或三维地图。在这种方法中,场景被划分为一个网格,每个网格单元都包含了与之相关的信息,比如该网格是否可见或者是否被遮挡。通过从摄像机位置发射光线,并检测光线与网格单元的相交,可以确定光线在场景中的路径和可见性。 在Ray casting grid map中,光线从摄像机位置出发,经过每个网格单元,直到遇到物体或者到达场景边界。当光线与物体相交时,可以根据相交点的属性进行光照计算,比如反射、折射等。通过追踪光线的路径,可以生成场景的可视化效果。 这种方法的优点是简单直观,易于实现。然而,由于需要对每个网格单元进行光线相交测试,计算量较大,因此在复杂场景中可能会导致性能问题。为了解决这个问题,可以使用加速结构,如轴对齐包围盒(Axis-Aligned Bounding Box)、均匀网格(Uniform Grids)或KD-Tree等,来减少相交测试的数量,提高渲染效率。 总的来说,Ray casting grid map是一种基于光线投射的方法,用于生成场景的地图,并可以通过追踪光线的路径来实现渲染效果。 #### 引用[.reference_title] - *1* *2* *3* [计算机图形学六:光线追踪-Ray Tracing](https://blog.csdn.net/lbwnbnbnbnbnbnbn/article/details/125784434)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值