当前位置:网站首页>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畅通无阻,中间出现其他问题就需要自己去解决了。
边栏推荐
- . Net core stepping on the pit practice
- The route of wechat applet jumps again without triggering onload
- June 29, 2022 daily
- How to answer when you encounter a jet on CSDN?
- Redis-02.Redis命令
- Genesis builds a new generation of credit system
- Speedtree01 generator properties
- Database mysql all
- Using handler in a new thread
- LSA Type Explanation - lsa-5 (type 5 LSA - autonomous system external LSA) and lsa-4 (type 4 LSA - ASBR summary LSA) explanation
猜你喜欢
Mutual transformation between two-dimensional array and sparse array (sparse matrix)
将webApp或者H5页面打包成App
Use the Paping tool to detect TCP port connectivity
[algorithm post interview] interview questions of a small factory
Vscode creates its own code template
Volcano resource reservation feature
NVM Downloading npm version 6.7.0... Error
Build a microservice cluster environment locally and learn to deploy automatically
Inclusion exclusion principle acwing 890 Divisible number
Database mysql all
随机推荐
[algorithm post interview] interview questions of a small factory
Xavier CPU & GPU high load power consumption test
confidential! Netease employee data analysis internal training course, white whoring! (attach a data package worth 399 yuan)
[tf] Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initial
Qt项目中的日志库log4qt使用
Orin 安装CUDA环境
H5 模块悬浮拖动效果
【高德地图POI踩坑】AMap.PlaceSearch无法使用
MQClientException: No route info of this topic: type_ topic
Mutual transformation between two-dimensional array and sparse array (sparse matrix)
Positive height system
TCP's understanding of three handshakes and four waves
Knapsack problem acwing 9 Group knapsack problem
La redirection de l'applet Wechat ne déclenche pas onload
[nvidia] CUDA_ VISIBLE_ DEVICES
Integer to 8-bit binary explanation (including positive and negative numbers) scope of application -127~+127
SolidWorks template and design library are convenient for designers to call
TypeScript入门
Vant weapp swippecell set multiple buttons
[moviepy] unable to find a solution for exe