当前位置:网站首页>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畅通无阻,中间出现其他问题就需要自己去解决了。
边栏推荐
- About vscode, "code unreachable" will be displayed when calling sendline series functions with pwntools“
- 微信小程序路由再次跳轉不觸發onload
- Client use of Argo CD installation
- MySQL (UDF authorization)
- TCP's understanding of three handshakes and four waves
- Mutual transformation between two-dimensional array and sparse array (sparse matrix)
- Configuration method and configuration file of SolidWorks GB profile library
- Dameng database all
- inux摄像头(mipi接口)简要说明
- PHY驱动调试之 --- PHY控制器驱动(二)
猜你喜欢

Instruction execution time

SRE核心体系了解

2.Oracle-数据文件的添加及管理

Knapsack problem acwing 9 Group knapsack problem

All English in the code

Database mysql all

Dameng database all

SolidWorks template and design library are convenient for designers to call

Record of problems in ollvm compilation

International Open Source firmware Foundation (osff) organization
随机推荐
MySQL (UDF authorization)
[tf] Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initial
Knapsack problem acwing 9 Group knapsack problem
Orin installs CUDA environment
PR automatically moves forward after deleting clips
1.手动创建Oracle数据库
将webApp或者H5页面打包成App
在本地搭建一个微服务集群环境,学习自动化部署
Idea debug failed
Speedtree01 generator properties
Build a microservice cluster environment locally and learn to deploy automatically
Database mysql all
H5内嵌App适配暗黑模式
Rehabilitation type force deduction brush question notes D2
[Chongqing Guangdong education] National Open University 2018 autumn 0702-22t contemporary Chinese political system reference questions
Rehabilitation type force deduction brush question notes D1
.net core踩坑实践
2. Addition and management of Oracle data files
Huawei bracelet, how to add medicine reminder?
namespace