ubuntu22.04安装Ros2(每步都有图)(20221124)

SunnyG按:接上文,由于系统Ubuntu22.04下Ros2版本为Humble,以下为安装humble的流程,如系统为ubuntu20.04,即改为foxy。ubuntu18.04如何安装Ros2之后再探索。

达成:ubuntu22.04完成安装ROS2

===========================================================================

直接上图:
(terminal终端输入附后)

 

 

 

 

 

 

 

 按步骤在terminal输入以下

$ 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

$ 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

(这里要更换一下raw.githubusercontent.com的ip地址,参考点击这里

 

继续

$ 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 apt update

$ sudo apt upgrade

$ sudo apt install ros-humble-desktop

$ source /opt/ros/humble/setup.bash

$ echo " source /opt/ros/humble/setup.bash" >> ~/.bashrc

测试,打开终端1窗口

$ ros2 run demo_nodes_cpp talker

打开终端2窗口,如图显示,说明可通信

$ ros2 run demo_nodes_py listener

小乌龟测试,如图

$ ros2 run turtlesim turtlesim_node

$ ros2 run turtlesim turtle_teleop_key

物联沃分享整理
物联沃-IOTWORD物联网 » ubuntu22.04安装Ros2(每步都有图)(20221124)

发表回复