2025-06-29 15:32:05 +08:00
2025-06-28 15:31:08 +08:00
2025-06-28 15:31:08 +08:00
2025-06-29 15:32:05 +08:00
2025-06-28 15:49:26 +08:00
2025-06-28 07:16:15 +00:00
2025-06-28 22:11:36 +08:00

ROS-noetic安装应用于Ubuntu20.04lts

最好全程使用root权限

sudo vim /etc/apt/sources.list  # 进入apt下载源文件

删除所有ubuntu官方源添加清华源

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

添加ROS源地址

sudo sh -c 'echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros-latest.list'

设置密钥

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-keys 6A030B21B4D2B67B

更新源

sudo apt update

安装ROS-noetic

sudo apt install ros-noetic-desktop-full

初始化 rosdep

sudo rosdep init
rosdep update

配置环境变量

source /opt/ros/noetic/setup.bash
source ~/.bashrc

安装ROS-python3工具包

sudo apt install python3-rosinstall python3-rosinstall-generator python3-wstool
sudo apt install build-essential

环境配置检测

# 确保环境配置
source /opt/ros/noetic/setup.bash
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
# 确保ROS安装完整
sudo apt install --reinstall ros-noetic-desktop-full
# 检测roslaunch是否安装
dpkg -l | grep ros-noetic-roslaunch
# 若roslaunch以安装则无需执行下条命令
sudo apt install ros-noetic-roslaunch

启动roscore

roscore

启动小乌龟

rosrun turtlesim turtlesim_node

控制小乌龟(新终端窗口打开)

rosrun turtlesim turtle_teleop_key

编译工作空间

catkin_make

启动roscore

roscore

添加环境变量

source /home/zmn/Gitea/ROS_Learn/devel/setup.bash

启动发送端

rosrun position_demo publisher_node.py

启动客户端

rosrun position_demo subscriber_node.py

启动RViz

rviz

将RViz左侧 Global Options 面板中 Fixed Frame 改为程序中的 world 。 在 Displays 面板中,点击 Add添加 Marker 类型。

编译工作空间

catkin_make

启动roscore

roscore

添加环境变量

source /home/zmn/Gitea/ROS_Learn/devel/setup.bash

启动发送端

rosrun position_demo publisher_node_three.py

启动客户端

rosrun position_demo subscriber_node_three.py

启动RViz

rviz

将RViz左侧 Global Options 面板中 Fixed Frame 改为程序中的 world 。 在 Displays 面板中,点击 Add添加 Marker 类型。

Description
ROS机器人系统实验。ROS系统的安装和常用命令,发送端和订阅端的话题通讯,利用服务端处理数据。
Readme Apache-2.0 7.3 MiB
2025-07-02 13:25:22 +00:00
Languages
Python 26.3%
Makefile 26.2%
CMake 21%
Shell 10.8%
C 7.9%
Other 7.8%