Turtlebot-ROS2入门教程-apt方式安装ROS2

Turtlebot-ROS2入门教程-apt方式安装

说明:

  • 介绍apt方式ROS2

步骤:

  • 增加 Debian repository库
sudo apt update && sudo apt install curl
curl http://repo.ros2.org/repos.key | sudo apt-key add -
  • 增加库到ros源
sudo sh -c 'echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main xenial main" > /etc/apt/sources.list.d/ros2-latest.list'
  • 安装ROS2包
sudo apt update
sudo apt install `apt list "ros-ardent-*" 2> /dev/null | grep "/" | awk -F/ '{print $1}' | grep -v -e ros-ardent-ros1-bridge -e ros-ardent-turtlebot2- | tr "\n" " "`
  • 环境安装
source /opt/ros/ardent/setup.bash
  • 安装argcomplete
sudo apt install python3-pip
sudo pip3 install argcomplete
  • 获取完整的命令行工具
source /opt/ros/ardent/share/ros2cli/environment/ros2-argcomplete.bash
  • 选择 RMW, 默认使用FastRTPS
  • 也可以通过环境变量,变更RMW,如:
RMW_IMPLEMENTATION=rmw_opensplice_cpp
  • 安装ros1_bridge
sudo apt update
sudo apt install ros-ardent-ros1-bridge ros-ardent-turtlebot2-*

参考:

  • https://github.com/ros2/ros2/wiki/Linux-Install-Debians

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: turtlebot-ros2入门教程