ubuntu22.04 安装ROS2
时间: 2024-09-20 14:11:59 浏览: 82
Ubuntu 22.04安装ROS2(Robot Operating System version 2)的步骤如下:
1. **更新系统**:
```sh
sudo apt update && sudo apt upgrade
```
2. **添加ROS2官方镜像源**:
```
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/ros-signing-keyring.gpg] https://download.ros2.org/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/ros2-focal.list
curl -fsSL https://download.ros2.org/keyring/ros2.asc | sudo apt-key add -
```
3. **安装依赖**:
```sh
sudo apt install gnupg2 software-properties-common
```
4. **安装ROS2**:
```sh
sudo apt update
sudo apt install ros-focal-ros-core
```
5. **启动并检查安装**:
```sh
sudo systemctl start rosbridge-server
ros2 run rclcpp_nodes node_list
```
注意:Ubuntu 22.04目前还未正式支持ROS 2 Foxy (Focal Fossa)发行版,如果你需要安装的是最新版本,可能需要等待官方发布针对新版本的适配,或者直接从源码编译。
阅读全文