Sending lidar data from pixhawk to raspberry pi

Hello. I needed some help in communicating the Pixhawk with the raspberry pi. I have successfully set up the wireless connection using this link (https://ardupilot.org/dev/docs/making-a-mavlink-wifi-bridge-using-the-raspberry-pi.html). This was done so that I can remove the pi from my drone (and make it lighter). The drone also has an RPLidar A1 which was connected to the pi initially but now my only option is for it to be connected to the pixhawk.
I am planning to control the drone using a python file (localizing will be done after reading the lidar data). I can connect the lidar to the pixhawk using the following connection diagram in this link (https://ardupilot.org/copter/docs/common-rplidar-a2.html). My question is, how do I send the data read (of the lidar) from the pixhawk in my python file (I am using dronekit to control it).

Thank you very much

Are you using PX4 firmware, or Ardupilot firmware?

I am sorry for the late reply. On mission planner when I go to the messages tab it gives me this:

2/5/2020 12:56:22 PM : u-blox 1 HW: 00070000 SW: 1.00 (59842)
2/5/2020 12:56:18 PM : PX4v3 00220028 33355119 38393235
2/5/2020 12:56:18 PM : Frame: OCTA_QUAD
2/5/2020 12:56:18 PM : PX4: 0384802e NuttX: 1bcae90b
2/5/2020 12:56:18 PM : APM:Copter V3.5.5 (27229c83)

so I think it is PX4.

That’s an older version of Ardupilot actually (Ardupilot Copter V3.5.5).
Best to visit discuss.ardupilot.org

ok i will post my question over there. Thank you for helping

Hi, if you are concerned about weight on the drone and want to work in Python, you might consider using a WiPy board that you can mount on your drone. I don’t know if micro Python on this board has enough horsepower for your application, but it might solve your problem and not require talking to the Pixhawk and using WiFi to get LIDAR data.