Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Copter to compile when Fence is disable but Avoidance is not #26561

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

peterbarker
Copy link
Contributor

This arose out of a previous PR - #26466 IIRC.

There hasn't been a technical requirement for this for some time..

Also expanded the tool used to test this sort of change to build_options.py

. The important ouputs were:

pbarker@fx:~/rc/ardupilot(pr/avoidance-no-fence2)$ cat /tmp/enable-in-turn.csv 
Feature,antennatracker,blimp,copter,plane,rover,sub
AP_AVOIDANCE_ENABLED,-56,-64,-8368,0,-4680,-3944
AP_FENCE_ENABLED,-10320,-10464,-30440,-14144,-28204,-12336
pbarker@fx:~/rc/ardupilot(pr/avoidance-no-fence2)$ cat /tmp/some.csv 
Feature,antennatracker,blimp,copter,plane,rover,sub
AP_AVOIDANCE_ENABLED,56,56,11208,-40,8704,7352
AP_FENCE_ENABLED,2688,2816,41624,14072,35508,19656

@rmackay9
Copy link
Contributor

Thanks for this. This is a good idea but we should test in SITL that simple avoidance in Loiter mode works using only proximity sensors.

@tridge tridge requested a review from rmackay9 March 20, 2024 07:23
@rmackay9
Copy link
Contributor

I tested this and maybe I did something wrong but it seems like setting AP_FENCE_ENABLED definition to zero led to AC_Avoidance library disappearing. the AVOID_xxx parameters disappeared.

This is the command line I used
../Tools/autotest/sim_vehicle.py -A --serial5=sim:rplidara2 -l 51.8752066,14.6487840,54.15,0 --map --console --configure-define="AP_FENCE_ENABLED=0"

Just for reference, instructions for testing with proximity sensors in SITL are here: https://ardupilot.org/dev/docs/adding_simulated_devices.html#adding-a-360deg-lidar

the technical reasons in Avoidance were fixed a long time ago
the technical reasons in Avoidance were fixed a long time ago
useful if you need to test multiple features at the same time
@peterbarker peterbarker force-pushed the pr/avoidance-no-fence2 branch from 52d3efe to ccb5c3e Compare March 20, 2024 10:12
@peterbarker
Copy link
Contributor Author

I've added a patch so that we don't disable avoidance if fence is disabled. Missed that patch somehow.

image

@@ -4,7 +4,7 @@
#include <AC_Fence/AC_Fence_config.h>

#ifndef AP_AVOIDANCE_ENABLED
#define AP_AVOIDANCE_ENABLED AP_FENCE_ENABLED
Copy link
Contributor

@rmackay9 rmackay9 Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should change this so it's (AP_FENCE_ENABLE || HAL_PROXIMITY_ENABLED || AP_BEACON_ENABLED). No point in having avoidance if none of these are available.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see if this works - but this sort of thing usually ends up with include loops / tears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants