1.ubuntu下安装noetic

1.首先安装常规手段安装乌班图系统

2.开始ROS 系统安装

1. 设置编码

$ sudo apt update && sudo apt install locales
$ sudo locale-gen en_US en_US.UTF-8
$ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 
$ export LANG=en_US.UTF-8

2.添加源

bash 复制代码
$ sudo apt update && sudo apt install curl gnupg lsb-release 
$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg 
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

如遇报错"Failed to connect to raw.githubusercontent.com ",可参考古月居 - ROS机器人知识分享社区

3. 安装ROS2

1.配置Softerware & Updates

2.添加软件源

如果不添加软件源,是无法定位软件包的

清华源

bash 复制代码
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

3.设置key

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

4.更新并安装

更新
bash 复制代码
sudo apt update

安装(ros-noetic-desktop-full)

安装aptitude
bash 复制代码
sudo apt install aptitude
安装ROS软件包
bash 复制代码
sudo aptitude install ros-noetic-desktop-full

5.添加环境变量

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

6.安装构建依赖

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

初始化

bash 复制代码
sudo rosdep init
更新
bash 复制代码
rosdep update

7.测试

分别打开3个终端,在第1个终端输入:

bash 复制代码
roscore

在第2个终端输入:

bash 复制代码
rosrun turtlesim turtlesim_node

在第3个终端输入:

bash 复制代码
rosrun turtlesim turtle_teleop_key
相关推荐
bohu8340 分钟前
亚博microros小车-原生ubuntu支持系列:16 机器人状态估计
ubuntu·机器人·imu·localization·microros·imu_tools
马立杰2 小时前
H3CNE-33-BGP
运维·网络·h3cne
云空3 小时前
《DeepSeek 网页/API 性能异常(DeepSeek Web/API Degraded Performance):网络安全日志》
运维·人工智能·web安全·网络安全·开源·网络攻击模型·安全威胁分析
深度Linux3 小时前
Linux网络编程中的零拷贝:提升性能的秘密武器
linux·linux内核·零拷贝技术
没有名字的小羊4 小时前
Cyber Security 101-Build Your Cyber Security Career-Security Principles(安全原则)
运维·网络·安全
千夜啊4 小时前
Nginx 运维开发高频面试题详解
运维·nginx·运维开发
存储服务专家StorageExpert5 小时前
答疑解惑:如何监控EMC unity存储系统磁盘重构rebuild进度
运维·unity·存储维护·emc存储
chian-ocean6 小时前
从理论到实践:Linux 进程替换与 exec 系列函数
linux·运维·服务器
拎得清n7 小时前
UDP编程
linux
敖行客 Allthinker7 小时前
从 UTC 日期时间字符串获取 Unix 时间戳:C 和 C++ 中的挑战与解决方案
linux·运维·服务器·c++