ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Copter: prevent PARACHUTE_ENABLE aux function setting CHUTE_ENABLED directly

Open shiv-tyagi opened this issue 2 years ago • 0 comments

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:-

  1. CHUTE_ENABLED = 0 and RC11_OPTION 0 - Parachute is not released if we send long MAV_CMD_DO_PARACHUTE 2
  2. CHUTE_ENABLED = 1 and RC11_OPTION 0 - Parachute is released if we send long MAV_CMD_DO_PARACHUTE 2
  3. i. CHUTE_ENABLED = 1 and RC11_OPTION 23 - Parachute is not released if we send long MAV_CMD_DO_PARACHUTE 2 when rc 11 is 1100 (LOW) ii. CHUTE_ENABLED = 1 and RC11_OPTION 23 - Parachute is released if we send long MAV_CMD_DO_PARACHUTE 2 when rc 11 is 1500 (MIDDLE) iii. CHUTE_ENABLED = 1 and RC11_OPTION 23 - Parachute is released immediately when we set rc 11 to 1900 (HIGH)
  4. i. CHUTE_ENABLED = 1 and RC11_OPTION 21 - Parachute is not released if we send long MAV_CMD_DO_PARACHUTE 2 when rc 11 is 1100 (LOW) ii. CHUTE_ENABLED = 1 and RC11_OPTION 21 - Parachute is released if we send long MAV_CMD_DO_PARACHUTE 2 when rc 11 is 1500 (HIGH)
  5. i. CHUTE_ENABLED = 0 and RC11_OPTION 23 - Parachute is not released if we send long MAV_CMD_DO_PARACHUTE 2 when rc 11 is 1100 (LOW) ii. CHUTE_ENABLED = 0 and RC11_OPTION 23 - Parachute is not released if we send long MAV_CMD_DO_PARACHUTE 2 when rc 11 is 1500 (MIDDLE) iii. CHUTE_ENABLED = 0 and RC11_OPTION 23 - Parachute is not released when we set rc 11 to HIGH
  6. i. CHUTE_ENABLED = 0 and RC11_OPTION 21 - Parachute is not released if we send long MAV_CMD_DO_PARACHUTE 2 when rc 11 is 1100 (LOW) ii. CHUTE_ENABLED = 0 and RC11_OPTION 21 - Parachute is not released if we send long 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?

shiv-tyagi avatar May 21 '22 16:05 shiv-tyagi