ROS(8)Navigation安装

8. ROS-Navigation安装

官方链接:http://wiki.ros.org/navigation

8.1. 安装方式

注意,如果通过turtlebot来仿真,当用apt-get安装时它会自动下载导航包。这里因为可能会研究源码,利用源码进行安装。

方式一,通过apt-get安装编译好的包;
方式二,通过源码编译安装–推荐。会安装如下包:

navigation (metapackage)   map_server  amcl  fake_localization  voxel_grid  costmap_2d  nav_core  base_local_planner   carrot_planner  clear_costmap_recovery  dwa_local_planner  move_slow_and_clear  navfn  global_planner  rotate_recovery  move_base

8.2. 源码安装

  • 下载地址
    https://github.com/ros-planning/navigation/tree/melodic-devel
  • 拷贝到~/catkin_ws/src下面
  • 执行安装
    cd ~/catkin_ws/
    catkin_make
    编译报错“Could NOT find SDL”,执行指令sudo apt-get install libsdl1.2-dev
    编译报错“Could NOT find SDL_image”,执行指令sudo apt-get install libsdl-image1.2-dev
    编译报错“Could NOT find tf2_sensor_msgs”,需要下载该包进行编译,地址https://github.com/ros/geometry2/tree/melodic-devel,拷贝到~/catkin_ws/src下面继续安装。
    编译报错“Could NOT find move_base_msgs”,需下载该包进行编译,地址https://github.com/ros-planning/navigation_msgs,拷贝到~/catkin_ws/src下面继续安装。
    编译报错“mmap: Cannot allocate memory”,(这是因为编译的时候开了6个进程,最后申请的虚拟内存爆了)方法一重新编译即可,方法二echo 1 > /proc/sys/vm/overcommit_memory,表示内核允许分配所有的物理内存,而不管当前的内存状态如何。

8.3. 安装teb_local_planner插件

传统的navigation里的路径规划策略性能不佳。在尝试了teb_local_planner后,发现机器人导航性能得到非常大的提升。
为了编译时不再检查前面装的包,可以在前面包源码目录下新建CATKIN_IGNORE文件夹。

  • 下载链接https://github.com/rst-tu-dortmund/teb_local_planner

  • 拷贝到~/catkin_ws/src,执行catkin_make"进行编译。
    a. 编译报错“Could NOT find costmap_converter”,下载链接https://github.com/rst-tu-dortmund/costmap_converter,拷贝到~/catkin_ws/src下面继续安装。
    b. 编译报错“Could NOT find mbf_costmap_core”,下载链接https://github.com/magazino/move_base_flex/tree/melodic,拷贝到~/catkin_ws/src下面继续安装。
    c. 编译报错“unable to find SuiteSparse”,执行sudo apt-get install libsuitesparse-dev
    e. 编译报错“Could not find libg2o!”,这里选择源码安装libg2o图优化库:

    首先下载该库:https://github.com/RainerKuemmerle/g2o
    安装依赖:(cmake已经安装) sudo apt-get install libeigen3-dev libeigen3-doc
    编译:
    cd g2o-master
    mkdir build
    cd build
    cmake ../
    make && make install

    f.继续编译catkin_make

  • 注意,teb_local_planner源码中关于plugin的配置文件均已写好,直接编译源码就能完成plugin的注册及插入,非常方便。

8.4. 安装cartographer_ros模块

参考链接https://google-cartographer-ros.readthedocs.io/en/latest/compilation.html

8.4.1. 安装wstool和rosdep以及Ninjia

sudo apt-get update
sudo apt-get install -y python3-wstool python3-rosdep ninja-build stow
这里会报错缺少依赖包,因为之前装的都是python2的包,按照提示添加上依赖包后会导致ROS重新安装(我擦),所以用下面的指令代替:
sudo apt-get install -y python-wstool python-rosdep ninja-build stow

8.4.2. 安装cartographer_ros

mkdir catkin_ws
cd catkin_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src

这里最后一步速度很慢,对hosts文件进行如下配置,然后重启网卡(结果不太明显):

#解决git clone 速度慢的问题
192.30.253.112 github.com
151.101.185.194 github.global.ssl.fastly.net
#解决浏览器下载master-zip包的问题
192.30.253.120 codeload.github.com
#解决github不能查看图片的问题
199.232.68.133 raw.githubusercontent.com

8.4.3. 安装依赖

rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

发现依赖了下面的包:libatlas3-base libgflags2.2 libgoogle-glog0v5 libceres1 libgflags-dev libgoogle-glog-dev libceres-dev

8.4.4. 手动安装abseil-cpp library

src/cartographer/scripts/install_abseil.sh
执行后下载了https://github.com/abseil/abseil-cpp.git,并编译该库。该库是google开源的内部通用库。

8.4.5. 构建cartographer_ros

catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash
编译构建过程中可能出现内存不足的问题,参考上面ROS-Navigation解决办法。

 介绍如何为机器人整合导航包,实现有效控制和自主导航等功能 目录:  ROSnavigation 教程-目录  ROSnavigation 教程-设置机器人使用 TF  ROSnavigation 教程-基本导航调试指南  ROSnavigation 教程-安装和配置导航包  ROSnavigation 教程-结合 RVIZ 与导航包  ROSnavigation 教程-发布里程计消息  ROSnavigation 教程-发布传感器数据  ROSnavigation 教程-编写自定义全局路径规划  ROSnavigation 教程-stage 仿真  ROSnavigation 教程-示例-激光发布(C++)  ROSnavigation 教程-示例-里程发布(C++)  ROSnavigation 教程-示例-点云发布(C++)  ROSnavigation 教程-示例-机器人 TF 设置(C++)  ROSnavigation 教程-示例-导航目标设置(C++)  ROSnavigation 教程-turtlebot-整合导航包简明指南  ROSnavigation 教程-turtlebot-SLAM 地图构建  ROSnavigation 教程-turtlebot-现有地图的自主导航  ROSnavigation 教程-map_server 介绍  ROSnavigation 教程-move_base 介绍  ROSnavigation 教程-move_base_msgs 介绍  ROSnavigation 教程-fake_localization 介绍  ROSnavigation 教程-voel_grid 介绍  ROSnavigation 教程-global_planner 介绍  ROSnavigation 教程-base_local_planner 介绍2  ROSnavigation 教程-carrot_planner 介绍  ROSnavigation 教程-teb_local_planner 介绍  ROSnavigation 教程-dwa_local_planner(DWA)介绍  ROSnavigation 教程-nav_core 介绍  ROSnavigation 教程-robot_pose_ekf 介绍  ROSnavigation 教程-amcl 介绍  ROSnavigation 教程-move_slow_and_clear 介绍  ROSnavigation 教程-clear_costmap_recovery 介绍  ROSnavigation 教程-rotate_recovery 介绍  ROSnavigation 教程-costmap_2d 介绍  ROSnavigation 教程-costmap_2d-range_sensor_layer 介绍  ROSnavigation 教程-costmap_2d-social_navigation_layers 介绍  ROSnavigation 教程-costmap_2d-staticmap 介绍  ROSnavigation 教程-costmap_2d-inflation 介绍  ROSnavigation 教程-obstacle 层介绍  ROSnavigation 教程-Configuring Layered Costmaps
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值