当前位置:网站首页>ROS2——安装ROS2(三)
ROS2——安装ROS2(三)
2022-07-05 06:35:00 【我与nano】
ROS机器人操作系统
前言
前面了解了ROS2是什么,工欲善其事必先利其器,下面我们来安装ROS2。
一、踩坑日记
记住一定一定要安装一个新的22.04的系统,20.04出现的问题,弄了一下午也没有解决,换了一个新的系统,一路上畅通无阻。
二、换源
1.更换中科大源
输入以下命令
sudo gedit /etc/apt/sources.list
sudo apt-get update
sudo apt-get upgrade
用下面的内容替换
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
保存退出
三、安装ROS2
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. 添加源
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
这里可能会报错
执行
sudo vi /etc/hosts
添加下面这句话,重新执行就可以了
185.199.108.133 raw.githubusercontent.com
3.安装ROS2
sudo apt update
sudo apt upgrade
sudo apt install ros-humble-desktop
4.设置环境变量
source /opt/ros/humble/setup.bash
echo " source /opt/ros/humble/setup.bash" >> ~/.bashrc
四、小乌龟示例
运行
ros2 run turtlesim turtlesim_node
ros2 run turtlesim turtle_teleop_key
可以看到小乌龟出来了,至此ROS2安装完毕。
总结
ROS2的安装踩雷了,用22.04畅通无阻,中间出现其他问题就需要自己去解决了。
边栏推荐
- International Open Source firmware Foundation (osff) organization
- H5 embedded app adapts to dark mode
- Volcano 资源预留特性
- Xavier CPU & GPU 高负载功耗测试
- 使用paping工具进行tcp端口连通性检测
- testing framework
- SRE核心体系了解
- Find the combination number acwing 888 Find the combination number IV
- 1. Create Oracle database manually
- ADG5412FBRUZ-RL7应用 双电源模拟开关和多路复用器IC
猜你喜欢
Volcano resource reservation feature
PHY驱动调试之 --- PHY控制器驱动(二)
vsCode创建自己的代码模板
摄像头的MIPI接口、DVP接口和CSI接口
Game theory acwing 894 Split Nim game
Orin two brushing methods
Find the combination number acwing 889 01 sequence meeting conditions
Redis-01.初识Redis
Bit of MySQL_ OR、BIT_ Count function
how to understand the “model independent.“
随机推荐
Game theory acwing 891 Nim games
Redis-01.初识Redis
H5 模块悬浮拖动效果
Vant Weapp SwipeCell设置多个按钮
GDB code debugging
Integer to 8-bit binary explanation (including positive and negative numbers) scope of application -127~+127
H5 embedded app adapts to dark mode
Instruction execution time
Design specification for mobile folding screen
Edge calculation data sorting
[algorithm post interview] interview questions of a small factory
5. Oracle tablespace
Idea debug failed
Technology blog learning website
Using handler in a new thread
5. Oracle TABLESPACE
Volcano resource reservation feature
Qt项目中的日志库log4qt使用
. Net core stepping on the pit practice
vim