# Collision prevention

Source: https://forum.modalai.com/topic/223/collision-prevention
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2021-05-03 18:58:04 UTC by gauravshukla914
Replies: 7 · Views: 1839

## gauravshukla914 · 2021-05-03 18:58:04 UTC

Hi, We are trying to test the collision prevention feature on our Voxl flight deck enabled drone. We've set the PX4 parameters as mentioned in the documentation of collision prevention. Its working fine when I set the cp_dist to 1.5 meters as told. It works well and the drone stops.

However, if at all I keep some other value less than 1.5 m, for example, 1 meter or 1.2 meter, or 0.8 meters, it doesn't stop for the obstacle and I just hear "collision warning" from QgroundControl station. So is 1.5 meter a standard value and we can't use any number less than that?

## Reply by modaltb (ModalAI staff) · 2021-05-04 23:47:18 UTC

Hi @gauravshukla914 ,

I didn't know of any limitation, our factory test uses 1.5 --> https://gitlab.com/voxl-public/flight-core-px4/px4-parameters/-/blob/master/helpers/collision_prevention.params#L7

We'll need to check out what is introducing the limit.

## Reply by gauravshukla914 · 2021-05-05 02:59:24 UTC

Thanks for your reply @modaltb . That'd be great. I'll look forward to your response.

## Reply by kiprock · 2021-05-05 14:41:42 UTC

gauravshukla914 Just curious, are you trying https://github.com/PX4/PX4-Avoidance or something else for collision prevention?

## Reply by gauravshukla914 · 2021-05-13 14:44:22 UTC

@modaltb any idea on this?

## Reply by gauravshukla914 · 2021-05-13 14:44:58 UTC

@kiprock No. I'm following the modalai collison prevention documentation.

## Reply by Chad Sweet (ModalAI staff) · 2021-05-13 15:45:03 UTC

I don't think we have tried other values. You can see where PX4 computes min_distance [here](https://github.com/PX4/PX4-Autopilot/blob/master/src/lib/collision_prevention/CollisionPrevention.cpp#L216), that might help

## Reply by modaltb (ModalAI staff) · 2021-05-13 15:46:52 UTC

The only lower bound I've seen is 20cm here: 
https://gitlab.com/voxl-public/modal-pipe-architecture/voxl-vision-px4/-/blob/master/src/voa_manager.c#L165

So I'm still puzzled.

If you debug stereo, what kind of data are you seeing? https://docs.modalai.com/voxl-vision-px4-collision-prevention/#debug-tools
