ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.47k stars 17.11k forks source link

AC_Fence.cpp "get_breach_distance" function does not account for polygon fence breach #13125

Open rishabsingh3003 opened 4 years ago

rishabsingh3003 commented 4 years ago

Issue details

AC_Fence.cpp (Fence Library) contains a get_breach_distance() function which returns the distance a vehicle has breached a fence. It is used here . The function, however, does not include polygon fence breaches and only checks for altitude and circle type fences. Is this done intentionally for a reason that I could not see?

Version master

Platform [ ] All [ ] AntennaTracker [ x ] Copter [ ] Plane [ ] Rover [ ] Submarine

rishabsingh3003 commented 4 years ago

If someone can indeed confirm this is a bug, I would like to try and submit a patch!

peterbarker commented 4 years ago

On Sat, 28 Dec 2019, Rishabh Singh wrote:

If someone can indeed confirm this is a bug, I would like to try and submit a patch!

Looks like a problem to me.

I'd love to see patches and tests that fail before and pass after.