Obstacle Avoidance - RPLidar A1 ---> Raspberry Pi 4 (Ubuntu/Linux) ---> PixHawk 4 (PX4)

I have the following things in hand, but I don’t know how to make them work. I need help from this community to make them work.

  1. PixHawk 4 running the latest version of PX4
  2. RPLidar A1
  3. Raspberry Pi 4 running the Raspberry system (Linux)

I worked on connecting these things in the following way, but I don’t know what to do next:
Enabled the MAV_2_CONFIG and configured it for the Telemetry 2, baud rate is also set.

I know about enabling the avoidance parameter.
But now I don’t know how I can make the RPLidar work so it can act as Obstacle Avoidance.