Limit height and avoid obstacles on top of the drone using TOF sensor

I’m developing my drone that I’m going to put on the market, but I would like to know if it is possible to implant a sensor to be able to limit the height of the drone such as that of the Mavic 2, inspire 2, I was thinking of using the vl53l1x but I would like to know if it is possible to do this using pixhawk, sorry for my bad english

Sure: https://ardupilot.org/copter/docs/common-rangefinder-landingpage.html
And: https://ardupilot.org/copter/docs/common-simple-object-avoidance.html

thanks for the assistance, i will install it now and then say if it worked

it is working more I would like that when it reaches the minimum height it stops and does not accept to climb more, just accepting to walk forward and sides etc, any help?