ardupilot
ardupilot copied to clipboard
Copter: prevent PARACHUTE_ENABLE aux function setting CHUTE_ENABLED directly
This closes #20788. We prevent PARACHUTE_ENABLE and PARACHUTE_3POS auxiliary function from directly setting CHUTE_ENABLED parameter by introducing another boolean member in AP_Parachute class. This member is defaulted to true
to make sure it does not affect the behaviour in case no RC channel is assigned one of the above mentioned auxiliary function. In case any of the RC channel is assigned any of these functions, instead of setting the CHUTE_ENABLED parameter directly, it sets the _enabled_by_aux
boolean with appropriate value. This boolean is checked alongside _enabled
parameter.
I have tested it on SITL for below mentioned cases:-
-
CHUTE_ENABLED = 0
andRC11_OPTION 0
- Parachute is not released if we sendlong MAV_CMD_DO_PARACHUTE 2
-
CHUTE_ENABLED = 1
andRC11_OPTION 0
- Parachute is released if we sendlong MAV_CMD_DO_PARACHUTE 2
- i.
CHUTE_ENABLED = 1
andRC11_OPTION 23
- Parachute is not released if we sendlong MAV_CMD_DO_PARACHUTE 2
when rc 11 is 1100 (LOW) ii.CHUTE_ENABLED = 1
andRC11_OPTION 23
- Parachute is released if we sendlong MAV_CMD_DO_PARACHUTE 2
when rc 11 is 1500 (MIDDLE) iii.CHUTE_ENABLED = 1
andRC11_OPTION 23
- Parachute is released immediately when we set rc 11 to 1900 (HIGH) - i.
CHUTE_ENABLED = 1
andRC11_OPTION 21
- Parachute is not released if we sendlong MAV_CMD_DO_PARACHUTE 2
when rc 11 is 1100 (LOW) ii.CHUTE_ENABLED = 1
andRC11_OPTION 21
- Parachute is released if we sendlong MAV_CMD_DO_PARACHUTE 2
when rc 11 is 1500 (HIGH) - i.
CHUTE_ENABLED = 0
andRC11_OPTION 23
- Parachute is not released if we sendlong MAV_CMD_DO_PARACHUTE 2
when rc 11 is 1100 (LOW) ii.CHUTE_ENABLED = 0
andRC11_OPTION 23
- Parachute is not released if we sendlong MAV_CMD_DO_PARACHUTE 2
when rc 11 is 1500 (MIDDLE) iii.CHUTE_ENABLED = 0
andRC11_OPTION 23
- Parachute is not released when we set rc 11 to HIGH - i.
CHUTE_ENABLED = 0
andRC11_OPTION 21
- Parachute is not released if we sendlong MAV_CMD_DO_PARACHUTE 2
when rc 11 is 1100 (LOW) ii.CHUTE_ENABLED = 0
andRC11_OPTION 21
- Parachute is not released if we sendlong MAV_CMD_DO_PARACHUTE 2
when rc 11 is 1500 (HIGH)
@rmackay9 Can you please have a look on these results once? Are these results in line with your expectations?