Collision Prevention using Depth camera

I am currently working on implementing collision prevention for my drone using a depth camera in conjunction with the PX4 firmware. In collision prevention i want to fly my drone with my RC itself and drone should prevent the obstacle before the threshold defined…im using jetson as onboard computer i have tried px4 avoidance but it is not performing well in my case… i got to know about OBSTACLE DISTANCE message which could be published to drone and drone will prevent according based on the distance array provided i want help more specially that how can i implement and make it work.

Please help