Ubuntu 16.04(Xenia) 下 ROS2 Ardent 安装

1、编辑源列表文件,添加ROS软件源

sudo apt update && sudo apt install curl
curl http://repo.ros2.org/repos.key | sudo apt-key add -

sudo sh -c 'echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'

2、安装包

export ROS_DISTRO=ardent

sudo apt update


sudo apt install `apt list "ros-$ROS_DISTRO-*" 2> /dev/null | \
  grep '/' | awk -F/ '{print $1}' | \
  grep -v -e ros-$ROS_DISTRO-ros1-bridge \
  -e ros-$ROS_DISTRO-turtlebot2- \
  -e "ros-$ROS_DISTRO.*-dbgsym" \
  -e "ros-$ROS_DISTRO-.*opensplice" \
  -e "ros-$ROS_DISTRO-.*connext" | tr '\n' ' '`

3、环境设置

source /opt/ros/$ROS_DISTRO/setup.bash


source /opt/ros/$ROS_DISTRO/share/ros2cli/environment/ros2-argcomplete.bash


echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc

source  ~/.bashrc

echo "source /opt/ros/$ROS_DISTRO/share/ros2cli/environment/ros2-argcomplete.bash" >> ~/.bashrc

source  ~/.bashrc

4、(可选)安装argcomplete >= 0.8.5 on Ubuntu 16.04

sudo apt install python3-pip
sudo pip3 install argcomplete

5、安装其他RMW实现

sudo apt update
sudo apt install ros-$ROS_DISTRO-rmw-opensplice-cpp # for OpenSplice
sudo apt install ros-$ROS_DISTRO-rmw-connext-cpp # for RTI Connext (requires license agreement)

6、使用ROS 1包的附加包

sudo apt update
sudo apt install ros-$ROS_DISTRO-ros1-bridge ros-$ROS_DISTRO-turtlebot2-*

注意:要完成第6步必须先参照《ubuntu16.04 环境下 安装 ROS》1-3步添加ROS1的软件源及密钥。

参考链接:https://github.com/ros2/ros2/wiki/Linux-Install-Debians

猜你喜欢

转载自blog.csdn.net/wsc820508/article/details/81273940