一、ROS2(Iron Irwini)介绍
官方文档
Iron Irwini版本支持的平台如下:
二、ROS2(Iron Irwini)安装
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 install software-properties-common
sudo add-apt-repository universe
现在用apt添加带ROS 2 GPG关键字
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
3.安装ROS2 Iron
sudo apt update
sudo apt upgrade
sudo apt install ros-iron-desktop ros-iron-ros-base ros-dev-tools
三、ROS2测试
在terminal 1 运行下面的指令:
source /opt/ros/iron/setup.bash
ros2 run demo_nodes_cpp talker
在terminal 2 运行下面的指令:
source /opt/ros/iron/setup.bash
ros2 run demo_nodes_py listener
文章来源:https://www.toymoban.com/news/detail-688409.html
四、ROS2卸载
sudo apt remove ~nros-iron-* && sudo apt autoremove
删除ROS2库:文章来源地址https://www.toymoban.com/news/detail-688409.html
sudo rm /etc/apt/sources.list.d/ros2.list
sudo apt update
sudo apt autoremove
# Consider upgrading for packages previously shadowed.
sudo apt upgrade
到了这里,关于ROS2学习(一):Ubuntu 22.04 安装 ROS2(Iron Irwini)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!