当前位置:网站首页>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畅通无阻,中间出现其他问题就需要自己去解决了。
边栏推荐
- Skywalking all
- Vant weapp swippecell set multiple buttons
- .net core踩坑实践
- In C language, int a= 'R'
- Get class files and attributes by reflection
- Getting started with typescript
- H5 embedded app adapts to dark mode
- Client use of Argo CD installation
- Install opencv -- CONDA to establish a virtual environment and add the kernel of this environment in jupyter
- MPLS experiment
猜你喜欢

Positive height system

All English in the code

Ret2xx---- common CTF template proposition in PWN

Vscode creates its own code template

Use ffmpeg to rotate, flip up and down, and flip horizontally

1.手动创建Oracle数据库

Game theory acwing 891 Nim games

2. Addition and management of Oracle data files

达梦数据库全部

Orin 安装CUDA环境
随机推荐
Instruction execution time
Find the combination number acwing 888 Find the combination number IV
Pycahrm reports an error: indentation error: unindent does not match any outer indentation
Log4qt usage of logbase in QT project
Build a microservice cluster environment locally and learn to deploy automatically
Orin installs CUDA environment
7. Oracle table structure
Knapsack problem acwing 9 Group knapsack problem
5. Oracle TABLESPACE
SolidWorks template and design library are convenient for designers to call
Game theory acwing 893 Set Nim game
Vant Weapp SwipeCell設置多個按鈕
Vant Weapp SwipeCell设置多个按钮
Orin 安装CUDA环境
Technical conference arrangement
Markdown syntax
Vscode creates its own code template
Rehabilitation type force deduction brush question notes D3
Database mysql all
[tf] Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initial