ROS2安装
1、版本选择
| Ubuntu | ROS1.0 | ROS2.0 | Gazebo | |
|---|---|---|---|---|
| ROS2Go 1.0 | 16.04 LST | Kinetic LTS | Ardent | 7.+ |
| ROS2Go 2.0 | 18.04 LST | Melodic LTS | Dashing LST | 9.+ |
| ROS2Go 3.0 | 20.04 LST | Noetic LTS | Foxy LTS | 11.+ |
2、安装
ubuntu20.04-------------------------ROS2---------------------------------安装Foxy LST
2.1 安装ROS2
sudo apt update
sudo apt install ros-foxy-desktop
2.2 设置环境变量
source /opt/ros/foxy/setup.bash
出现警告:ROS_DISTRO was set to ‘noetic’ before. Please make sure that the environment does not mix paths from different distributions.
原因:安装了ROS1的noetic
解决方法:找到bashrc文件,注释noetic环境即可

2.3 安装自动补全工具
sudo apt install python3-argcomplete
2.4 测试安装结果
运行talke如下:
source /opt/ros/foxy/setup.bash
ros2 run demo_nodes_cpp talker

再打开一个终端运行listener如下:
source /opt/ros/foxy/setup.bash
ros2 run demo_nodes_cpp listener

回头看,轻舟已过万重山!