ROS-Ubuntu20.04安装noetic

ROS-Ubuntu20.04环境安装

1.系统和ROS版本

操作系统:Ubuntu20.04

ROS版本:ROS noetic

2.安装步骤

1.配置ROS软件源

c++ 复制代码
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

2.配置密钥

c++ 复制代码
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

3.更新系统软件源

c++ 复制代码
sudo apt update

4.安装ROS

c++ 复制代码
sudo apt install ros-noetic-desktop-full

5.初始化rosdep

先执行以下命令,不然初始化会报错:

c++ 复制代码
sudo apt install python3-rosdep

初始化:

c++ 复制代码
sudo rosdep init

6.rosdep更新

c++ 复制代码
rosdep update

出现以下报错:

复制代码
ERROR:error loading sources list:
	('The read operation timed out',)

尝试解决(没有成功):

访问网址不通造成的,添加https://ghproxy.com/资源代理网站加速rosdep对github raw的访问。但是出现以下报错:

复制代码
ERROR:unable to process source[https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]

查找原因后,发现https://ghproxy.com/已经不管用

最终解决:

复制代码
sudo pip install rosdepc
sudo rosdepc init
rosdepc update

7.设置环境变量

c++ 复制代码
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

8.安装依赖包

c++ 复制代码
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential

出现以下报错:

复制代码
E:Package 'python-rosinstall' has no installation candidate
E:Package 'python-rosinstall-generator' has no installation candidate
E:Package 'python-wstool' has no installation candidate

解决: 现在支持的是python3版本,所以把每个python改为python3

复制代码
sudo apt install python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

3.检验安装

1.查看安装版本

c++ 复制代码
$ rosversion -d
noetic		//输出ROS的版本

2.运行demo

c++ 复制代码
$ roscore 	//启动ROS MASTER
$ rosrun turtlesim turtlesim_node 	//启动小海龟仿真器
$ rosrun turtlesim turtle_teleop_key	//启动小海龟控制节点

4.其他

修改文件权限:

c++ 复制代码
sudo chmod 777 xxx		//777:每个人可读可写可执行,xxx:需要修改权限的文件名

参考链接:
http://t.csdnimg.cn/gYU91

http://t.csdnimg.cn/TWSIn

http://t.csdnimg.cn/brWCe

相关推荐
lxmyzzs7 小时前
基于深度学习CenterPoint的3D目标检测部署实战
人工智能·深度学习·目标检测·自动驾驶·ros·激光雷达·3d目标检测
MintonLee复现侠7 天前
记录RK3588的docker中启动rviz2报错
docker·容器·ros·rk3588·rviz·rviz2
Mr.Winter`10 天前
运动规划实战案例 | 基于多源流场(Flow Field)的路径规划(附ROS C++/Python实现)
人工智能·机器人·自动驾驶·ros·ros2·具身智能
Tipriest_13 天前
wstool和git submodule优劣势对比
ros·wstool·git submodule
zylyehuo24 天前
ROS1(20.04 noetic) + PX4 + AirSim
ros·drone
想要成为计算机高手25 天前
11. isaacsim4.2教程-Transform 树与Odometry
人工智能·机器人·自动驾驶·ros·rviz·isaac sim·仿真环境
Zhichao_971 个月前
【ROS1】09-ROS通信机制——参数服务器
ros
想要成为计算机高手1 个月前
10. isaacsim4.2教程-RTX Lidar 传感器
数码相机·机器人·ros·仿真·具身智能·vla·isaacsim
城北有个混子1 个月前
【机器人】—— 3. ROS 架构 & 文件系统
机器人·ros
Mr.Winter`1 个月前
轨迹优化 | 基于边界中间值问题(BIVP)的路径平滑求解器(附C++/Python仿真)
人工智能·机器人·自动驾驶·ros·路径规划·数值优化·轨迹优化