Use APDS-9930 proximity sensor for land detection

Hi

Land detection in copter generally works very well. But when auto landing in a windy condition, especially with precision landing enabled (PLND_ENABLED). copter may flip over sometimes like this video

APDS-9930 is a small and cheap short range (~10cm) proximity sensor. I attach it to landing gear to detect copter is close to ground


I also write a simple library for it (porting from https://github.com/Depaulicious/APDS9930). With this proximity sensor, copter can detect it is almost landed and prevent flip over. My code is here https://github.com/chobitsfan/ardupilot/commit/c36db5312d2cc8987c5371e652ebc052b1053698 and test video is here
https://youtu.be/dFu0b_81Vzw

Please give me some comments. Thank you very much

1 Like

nice !!!
I think I’ll expand it to use the VL530L0X sensor,
(https://www.banggood.com/CJMCU-VL53L0X-Laser-ToF-Time-of-Flight-Ranging-Sensor-Module-For-Arduino-p-1103114.html?rmmds=search&cur_warehouse=CN)

I’m all for this, but perhaps the driver could be in ap_rangefinder as a new backend? Then this could call any rangefinder (there is already a vl53l0x driver in there by the way).
Also, implementing as AP_Landing_Detector (rather than AC_xxx) would make it easier for quadplane/vtol to use it (I think tailsitters would be a great use case). But please, make a PR!

thank you very much for feedbacks

I did not put it in ap_rangefinder because apds-9930 is not exactly a rangefinder. It cannot output exact distance reading. It can only tell you “there is something within detect range”. Rangefinders usually have a minimum range and tends to inaccurate in very close range. By contrast, proximity sensor can only detect object in very close range.

2 Likes