Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Copter: object avoidance should support "stop" in addition to "slide" #5606
Copter's current object avoidance is built on the stop-at-the-fence feature which allows the vehicle to slide along the fence barrier. This is perhaps OK for the fence but for object avoidance it is sometime unnerving for the pilot to see the vehicle moving around as it reaches a barrier. Instead it might be more confidence inspiring for the vehicle to simply stop.
We should add a new parameter to AC_Avoidance which allows the user to choose the behaviour, "Slide" or "Stop".
@rmackay9 In case it's helpful, here's the original implementation I did for the geofence, which has the stop policy instead of the slide policy: https://github.com/UCSD-PL/ardupilot/blob/geofence/libraries/AC_Avoidance/AC_Avoid.cpp.
It has some dumb ideas in it. In particular, if the fence is violated, the vehicle moves back towards the last position it held inside the fence. This is a bad idea. Instead, there should be a buffer (as in the current fence), which should be subtracted from the distance to the fence on line 30. Of course, an actual fence violation should cause a failsafe action.
I'm putting the code here instead of in a pull request because it probably doesn't build again the latest master, and I won't have time to fix it in the near future.