Ubuntu20.04 noetic
ubuntu版本:20.04
webots版本:2021a
ros版本:noetic
前言
想得到python3的完美支持,笔者下定决心直接更新系统,少走弯路
1.安装配置webots
在ubuntu20.04安装webots步骤和使用Melodic写的教程ROS联合webots实战案例(一)安装配置webots类似,不过有一个点需要补充更新
srv数量从melodic的103个增加为106个。
1.1 安装对应版本webots_ros
$ sudo apt install ros-noetic-webots-ros
从webots_ros_noetic下载源代码。
1.2 配置WEBOTS_HOME环境
$ sudo gedit ~/.bashrc
在文件内的最后添加如下指令(笔者安装了webots-ros但是并没有自动帮我配置,所以需要自己配置一下)
export WEBOTS_HOME=/usr/local/webots/
1.3 测试
- 在catkin_ws下编译工作空间
$ catkin_make
- 跑官方例程pioneer3at机器人
$ roslaunch webots_ros pioneer3at.launch
成功跑通
2.安装amcl,gmapping导航包
2.1 安装amcl
$ sudo apt-get update
$ sudo apt-get install ros-noetic-amcl
2.1 安装gmapping
$ sudo apt-get update
$ sudo apt-get install ros-noetic-gmapping
2.2 安装move_base
$ sudo apt-get install ros-noetic-move-base
3.安装cartographer
安装方法和melodic有所不同,根据https://google-cartographer.readthedocs.io/en/latest/来安装
3.1 下载源码
$ git clone https://github.com/googlecartographer/cartographer.git
$ git clone https://github.com/ceres-solver/ceres-solver.git
$ git clone https://github.com/abseil/abseil-cpp.git
$ git clone https://github.com/google/protobuf.git
3.2 安装依赖
$ sudo apt-get update
$ sudo apt-get install -y \
clang \
cmake \
g++ \
git \
google-mock \
libboost-all-dev \
libcairo2-dev \
libcurl4-openssl-dev \
libeigen3-dev \
libgflags-dev \
libgoogle-glog-dev \
liblua5.2-dev \
libsuitesparse-dev \
lsb-release \
ninja-build \
stow
3.3 安装abseil
$ cd abseil-cpp
$ cd build
$ cmake -G Ninja -CMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/usr/local/stow/absl ..
$ ninja
$ sudo ninja install
$ cd /usr/local/stow
$ sudo stow absl
3.4 安装ceres-solver
$ cd ceres-solver
$ mkdir build
$ cd build
$ cmake .. -G Ninja -DCXX11=ON
$ ninja
$ sudo ninja install
3.5 安装cartograoger
$ cd cartographer
$ mkdir build
$ cd build
$ cmake ..
$ make -j8
$ sudo make install
3.6 安装cartographer_ros
$ cd ~/catkin_ws/src
$ git clone https://github.com/cartographer-project/cartographer_ros.git
然后到catkin_ws下运行catkin_make即可。
笔者出现的问题(以解决):编译 cartographer_ros 出现 CMake Error: The following variables are used in this project, but they are set to NOTFOUND…
cartographer 也能跑通
4.安装moveit
$ sudo apt-get install ros-noetic-moveit
$ sudo apt-get install ros-noetic-moveit-visual-tools
5.src目录
src
- cartographer_ros
- moveit
- universal_robot
- ur_e_webots
- volcano_moveit
- volcano_robotsim
- webots_ros
经过测试。配置好这些,案例都能正常跑。。。
结语
本文也是基于笔者的学习和使用经验总结的,主观性较强,如果有哪些不对的地方或者不明白的地方,欢迎评论区留言交流~
✌Bye