安装Galactic版本的rmf组件(traffic-editor等)
系统环境:Ubuntu20.04
参考:
CSDN@Ac君 Ubuntu20.04安装gazebo11报错
下载ROS2(Galactic)环境
- 查看是否为UTF-8,如果不是,进行下面的步骤 (可以不做,我没做也没影响)
$ locale # 查看是否为UTF-8
$ sudo apt update && sudo apt install locales
$ sudo locale-gen en_US en_US.UTF-8
$ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
$ export LANG=en_US.UTF-8
$ locale # verify settings
- 添加ROS2 的仓库地址
$ sudo apt update && sudo apt install curl
$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
$ sudo apt update
- 下载完整版(桌面版Galactic)
$ sudo apt install ros-galactic-desktop
$ sudo apt install ros-dev-tools
- 添加环境变量
# 永久添加,如果只装这一个版本的话,可以直接写进 .bashrc
$ echo "source /opt/ros/galactic/setup.bash" > ~/.bashrc
# 仅在当前终端使用galactic
$ source /opt/ros/galactic/setup.bash
- 查看是否安装完成
$ rosversion -d
安装RMF组件(折磨开始)
-
gazebo版本,一定要看清
# 首先查看gazebo的版本,确定是旧版本
dpkg -l | grep gazebo
# 卸载gazebo旧版本及其相关插件
sudo apt remove gazebo9 gazebo9-common gazebo9-plugin-base libgazebo9:amd64 libgazebo9-dev:amd64 ros-melodic-gazebo-*
# 清理缓存及安装包
sudo apt autoremove
sudo apt autoclean
-
安装gazebo11
Install Gazebo using Ubuntu packages
-
所有都默认
$ curl -sSL http://get.gazebosim.org | sh
-
完整步骤
$ sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' $ wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - $ sudo apt-get update $ sudo apt-get install gazebo11 $ sudo apt-get install libgazebo11-dev
-
-
安装RMF组件
-
galactic版本demo(可以不要)
$ sudo apt install ros-galactic-rmf-demos-gz
-
从源码安装
添加依赖
$ sudo apt update && sudo apt install \ git cmake python3-vcstool curl \ qt5-default \ -y $ python3 -m pip install flask-socketio $ sudo apt-get install python3-colcon*
下载rosdep(如果已经安装好了,无需理会)
sudo apt install python3-rosdep sudo rosdep init rosdep update
下载gazebo_ros包
$ sudo apt install ros-galactic-gazebo-ros-pkgs
下载源码(如果没有梯子可能会很慢,建议下载好源码)
$ mkdir -p ~/rmf_ws/src $ cd ~/rmf_ws $ wget https://raw.githubusercontent.com/open-rmf/rmf/release/21.09/rmf.repos $ vcs import src < rmf.repos
安装开始
$ cd ~/rmf_ws $ rosdep install --from-paths src --ignore-src --rosdistro galactic -y $ source /opt/ros/galactic/setup.bash $ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
如果要在当前终端使用rmf组件
$ source ~/rof_ws/install/setup.bash #测试使用traffic-editor $ traffic-editor
如果要在所有终端都能找到该组件
echo "source ~/rof_ws/install/setup.bash" > ~/.bashrc
-