Adapter to convert a XV11 Lidar or SDJQR01RR SDJQR02RR SDJQR03RR Xiaomi LIDAR to Mavlink compatible with ardupilot.
Install PID, XVLidar,(and RGB if using RP-2040) libraries into your arduino Library, place mavlink folder into the same folder as the ino file.
The Lidar board takes 3.3v or 5v depeding on the version so check first, I fried my first one.
Most XV lidars are 3.3v only and from all current reports the Xiaomi lidars are all 5v.
https://discuss.ardupilot.org/t/15-360-degree-xv-proximity-lidar/104887
For STM32f4 blackpill:
A2 to Flight controller RX pin
B1 to Lidar motor driver / transistor
A10 to Lidar TX pin
For RP-2040 :
4 to Flight controller RX pin
7 to Lidar motor driver / transistor
1 to Lidar TX pin
with RGB version
LED should be RED on startup then turn BLUE when data is recevied from the lidar, once its running it should blink to indicate its sending mavlink data.
on the flight controller:
set SERIALx_BAUD = 1500
Set SERIALx_PROTOCOL = 2
Set PRX1_TYPE = 2 for MAVLINK
Set PRX1_ORIENT = 1 or it will be upside down.
OA_TYPE = 1, this will enabe avoid in auto mode and show objects on the mission planner map
SRx_ADSB = 5, this is how many objects it will send to the ground station per second, you wont see anything on mission planner if its set to zero. this is set on your telemetry port not the lidar port.
https://www.youtube.com/watch?v=aAFY8p1glmM
https://wiki.recessim.com/w/index.php?title=Xiaomi_Roborock_LIDAR
http://roboticsweekends.blogspot.com/2018/05/xv-11-sensor-hacking-info-none-this-is.html