The Pixhawk 4 Flight Controller for example has analogue and I2C ports available, so you can connect an external Ultrasonic Sensor there. Here’s two quick examples I found on how to do this and there appear to be some videos on YouTube as well:
This is a great question! The Pixhawk 4 is such a versatile unit as suggested. I found the same as Liam, The PixHawk can handle Ultrasonic Sensors, however, I also found another great option for obstacle/ground level detection in a tiny LIDAR Sensor!
Incredible how compact these are. It’ll run on the PixHawk 4 connected via I2C or PWM.
Some great resources out there for it as well in combination with the PixHawk 4: