Mavlink or anyway to read telem 1,2,3

I connected a benewake TF03 LIDAR unit through TELEM2 or Serial 2 using UART.

Anyone kind enough to point me the right direction in how to read data coming out of Either Serial 1, 2 or 3?

Documented in here.

Hi, Thanks for your reply.

As I open the page, its actually for setting on mission planner.

Is there anyway which I can get the data thru mavproxy using mavlink? Specifically pymavlink?

You can read range finder measurement messages. For example using dronekit: https://dronekit-python.readthedocs.io/en/latest/automodule.html#dronekit.Rangefinder
If you really want to use pymavlink (dronekit uses it in background but anyway) you can write a script and wait for this mavlink message https://mavlink.io/en/messages/common.html#DISTANCE_SENSOR

Thanks for your reply.

I am using Mavsdk, realised I have problem with dronekit as it can only use Python2.7.
I was thinking of that but just wonder if the flight controller is able to recognise the data from the lidar and broadcast. Also is that any settings to be made to enable the ardupilot to broadcast the data. I did tried before reading the messages but didn’t really found any lidar data. Maybe I will look it up again.

I have never worked with MAVSDK but Dronekit-Python also available in Python 3, do pip3 install dronekit. You can enable and get data from the sensor and still not permit the autopilot to use it, I think that is what you are looking for and is the easiest way to do it. You can disable autopilot to use the rangefinder in flight modes.
https://ardupilot.org/copter/docs/parameters.html#avoid-enable-avoidance-control-enable-disable
https://ardupilot.org/plane/docs/parameters.html#terrain-follow-use-terrain-following
Also, there is a message type for obstacles too, I think you might need. https://mavlink.io/en/messages/common.html#OBSTACLE_DISTANCE
Hope this helps…

This command is for companion computer getting data from LIDAR and phrase it to send to Ardupilot? Am I right?

actually just wonder if there is any way to read raw data from the Serial port onboard flight controller.

This command is for companion computer getting data from LIDAR and phrase it to send to Ardupilot? Am I right?

Yes you are right.

actually just wonder if there is any way to read raw data from the Serial port onboard flight controller.

I don’t know if there is a ready-to-use solution exists for you, others might help but you need to get into the source code.
But I hope, soon enough there will be MAVLink message support for LUA scripting so you can do what you want later on.