在22.04安装ros1
时间: 2023-12-22 20:18:35 浏览: 196
ubuntu20.04安装ros
以下是在Ubuntu 22.04上安装ROS 1的步骤:
1. 添加ROS仓库密钥:
```
sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
```
2. 添加ROS软件源:
```
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
```
3. 更新软件包列表:
```
sudo apt update
```
4. 安装ROS Desktop-Full:
```
sudo apt install ros-noetic-desktop-full
```
5. 初始化rosdep:
```
sudo rosdep init
rosdep update
```
6. 添加ROS环境变量:
```
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
```
现在,ROS 1已经安装成功了!你可以通过运行以下命令来验证ROS是否正常工作:
```
roscore
```
如果一切正常,你应该会看到ROS主节点启动并打印出类似以下的信息:
```
... logging to /home/USERNAME/.ros/log/xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx/roslaunch-ubuntu-xxxxx.log
started roslaunch server http://ubuntu:xxxxx/
ros_comm version 1.15.9
SUMMARY
========
PARAMETERS
* /rosdistro: noetic
* /rosversion: 1.15.9
NODES
auto-starting new master
process[master]: started with pid [xxxx]
ROS_MASTER_URI=http://ubuntu:xxxxx/
setting /run_id to xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx
process[rosout-1]: started with pid [xxxx]
started core service [/rosout]
```
阅读全文