Obstacle avoidance with range of <= 40m


I am successfully feeding the DISTANCE_SENSOR via Mavlink. I have noticed that Arducopter 3.6 supports the obstacle avoidance in GPS modes with parameter AVOID_MARGIN from 1m to 10m. How can I increase this to 40m? If firmware modification needed, can you show me where I have to change?

Thanks in advance.

The “limits” on most of the parameters are not hard limits, they are recommended ranges for most users. In all likelihood, you can change that parameter to 40 meters without issue, assuming your hardware is capable of that.

Thanks for answering. I am trying the new setting.Still curious about where the numbers locate in the program, I am reading the code as well.

The parameter definition and avoidance code is here. The parameter value is used in the code as _margin or accessed with get_margin(), which just returns the value of _margin unmodified. I searched through this avoidance code and didn’t find any place that limits the maximum value for this parameter.