> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 rplidar-ros2 启用基本 RPLIDAR 处理

`rplidar-ros2` 示例应用为 2D 激光扫描仪 RPLIDAR A1/A2/A3/S1/S2/S3 提供基本的设备处理功能。

## `rplidar-ros2` **的管线流程**

下图显示了 rplidar-ros2 示例的管线。该示例应用从 `rplidar` SDK 获取驱动数据，然后发布 `/scan` 话题。

<img
  src="https://mintcdn.com/qualcomm-prod/IP0o0G5fE3MFmCJ8/SDKs/QIR-SDK-2.0/media/80-65220-2-qirp-sdk-qsg/rplidar-ros2-pipeline.svg?fit=max&auto=format&n=IP0o0G5fE3MFmCJ8&q=85&s=a3e54de47ea8eb89965bd2a5c9fd754c"
  style={{
width: "60%",
display: "block",
margin: "0 auto" }}
  width="362"
  height="402"
  data-path="SDKs/QIR-SDK-2.0/media/80-65220-2-qirp-sdk-qsg/rplidar-ros2-pipeline.svg"
/>

<p style={{ textAlign: 'center', fontWeight: 'bold' }}>
  图：rplidar-ros2 管线
</p>

## `rplidar-ros2 ` 管线中使用的 ROS 话题

<table>
  <thead>
    <tr>
      <th style={{ width: '15%' }}>ROS 话题</th>
      <th style={{ width: '25%' }}>消息类型</th>
      <th style={{ width: '25%' }}>发布/订阅者</th>
      <th style={{ width: '40%' }}>说明</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`/scan`</td>
      <td>`sensor_msgs::msg::LaserScan`</td>
      <td>由 `rplidar-ros2` 发布</td>
      <td>`/scan` 话题发布来自 RPLIDAR 的激光扫描数据。</td>
    </tr>
  </tbody>
</table>

## 前提条件

* 您已根据[为运行示例应用设置环境](./set-up-env-for-sample-app)完成了**设置设备**。

* 连接 RPLIDAR A3M1 的电源和 USB 端口。

## 运行开箱即用的 `rplidar-ros2`

要在设备上设置 QIR SDK 和 ROS2 环境并运行 `rplidar-ros2`，请启动一个终端并运行以下命令：

```powershell theme={null}
ssh root@[ip-addr]
(ssh) source /usr/share/qirp-setup.sh
(ssh) ros2 launch rplidar_ros rplidar_a3_launch.py
```
