8,460
个编辑
更改
→Ubuntu22.04安装ROS 2 Humble的方法
<ol style="list-style-type: decimal;">
<li><p>使用'''install_ros.sh'''脚本可以安装ros2</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</p>|}</li>
<li><p>'''install_ros.sh'''脚本安装完ros2后会自动运行下'''ros2 -h'''命令,如果能看到下面的打印,说明ros2安装完成</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...</p>
<p>ros2 is an extensible command-line tool for ROS 2.</p>
<p>optional arguments:</p>
:<p>-h, --help show this help message and exit</p>
<p>Commands:</p>
:<p>action Various action related sub-commands</p>:<p>bag Various rosbag related sub-commands</p>:<p>component Various component related sub-commands</p>:<p>daemon Various daemon related sub-commands</p>:<p>doctor Check ROS setup and other potential issues</p>:<p>interface Show information about ROS interfaces</p>:<p>launch Run a launch file</p>:<p>lifecycle Various lifecycle related sub-commands</p>:<p>multicast Various multicast related sub-commands</p>:<p>node Various node related sub-commands</p>:<p>param Various param related sub-commands</p>:<p>pkg Various package related sub-commands</p>:<p>run Run a package specific executable</p>:<p>security Various security related sub-commands</p>:<p>service Various service related sub-commands</p>:<p>topic Various topic related sub-commands</p>:<p>wtf Use `wtf` as alias to `doctor`</p> :<p>Call `ros2 <command> -h` for more detailed usage.</p>|}</li>
<li><p>然后可以使用 '''test_ros.sh'''脚本测试下ROS 2是否安装成功,如果能看到下面的打印,说明ROS 2能正常运行</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepicm4:~$ '''test_ros.sh'''</p>
<p>[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</p>
<p>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p>
<p>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p>
<p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</p>|}</li>
<li><p>运行下面的命令可以打开rviz2</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''source /opt/ros/humble/setup.bash'''</p>
<p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p>
|}
<div class="figure">
</div></li>
<li><p>参考文档</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>'''http://docs.ros.org/en/humble/index.html'''</p>
<p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html''']</p>|}</li></ol>
== 安装内核头文件的方法 ==