本文主要是介绍ros安装哪个版本的linux,ROS2入门教程-linux下apt安装ROS2 Dashing,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
说明
在Linux环境下使用apt方式安装ROS2 Dashing
测试环境:Ubuntu 18.04 + ROS2 Dashing
安装步骤
设置语言环境
$ 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 gnupg2 lsb-release
$ curl http://repo.ros2.org/repos.key | sudo apt-key add -
然后将存储库添加到源列表:
$ sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'
安装ROS2包
$ sudo apt update && sudo apt install ros-dashing-desktop
安装argcomplete
$ sudo apt install python3-argcomplete
Sourcing the setup script in .bashrc
$ echo "source /opt/ros/dashing/setup.bash" >> ~/.bashrc
安装额外的中间件
$ sudo apt update
$ sudo apt install ros-dashing-rmw-opensplice-cpp # for OpenSplice
$ sudo apt install ros-dashing-rmw-connext-cpp # for RTI Connext (requires license agreement)
By setting the environment variable RMW_IMPLEMENTATION=rmw_opensplice_cpp you can switch to use OpenSplice instead. For ROS 2 releases Bouncy and newer, RMW_IMPLEMENTATION=rmw_connext_cpp can also be selected to use RTI Connext.
If you want to install the Connext DDS-Security plugins please refer to this page.
University, purchase or evaluation options are also available for RTI Connext.
测试使用
新终端,运行talker例子
$ ros2 run demo_nodes_cpp talker
新终端,运行listener例子
$ ros2 run demo_nodes_py listener
这篇关于ros安装哪个版本的linux,ROS2入门教程-linux下apt安装ROS2 Dashing的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!