> ## 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-ros 启用基本的 RPLIDAR 处理

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

## `rplidar_ros` 的管道流程

下图展示了 `rplidar-ros2` 示例的管道流程。该示例从 RPLIDAR SDK 获取驱动数据，然后发布 `/scan` 话题。

<Frame caption="rplidar_ros 管道。">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/qualcomm-prod/zh/SDKs/QIR-SDK-Ubuntu/images/image4.png" style={{width: "50%"}} alt="RPLIDAR hardware feeding the Rplidar SDK, which feeds the Rplidar ROS node that publishes the /scan topic." />
</Frame>

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

下表列出了 `rplidar-ros2` 管道中使用的 ROS 话题，以及每个话题的消息类型和发布者。

| ROS 话题  | 类型                              | 发布者               |
| ------- | ------------------------------- | ----------------- |
| `/scan` | `<sensor_msgs::msg::LaserScan>` | `rplidar-ros2` 节点 |

## 前提条件

* 你已根据[安装 QIR SDK](./install-the-qir-sdk)完成设备设置，并在设备上安装了 ROS2 Jazzy 和 Qualcomm Intelligent Robotics (QIR) SDK。

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

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

<Steps>
  <Step title="启动 lidar ROS 节点">
    ```bash Launch the lidar ROS node theme={null}
    source /opt/ros/jazzy/setup.bash
    ros2 launch rplidar_ros rplidar_a3_launch.py
    ```
  </Step>

  <Step title="获取该节点的话题">
    ```bash List the ROS topics theme={null}
    source /opt/ros/jazzy/setup.bash
    ros2 topic list
    ```
  </Step>

  <Step title="在另一个终端中回显 scan 话题">
    ```bash Echo the scan topic theme={null}
    source /opt/ros/jazzy/setup.bash
    ros2 topic echo /scan
    ```

    <Frame>
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/qualcomm-prod/zh/SDKs/QIR-SDK-Ubuntu/images/image5.png" alt="Terminal log from the RPLIDAR launch file reporting the RPLIDAR S/N, firmware and hardware revision, health status OK, and a 10 Hz scan frequency." />
    </Frame>
  </Step>
</Steps>
