payload_deliverer: Refactor & Handle vehicle command conflicts

Refactor
- Require reboot for PD_GRIPPER_EN parameter change
- Define gripper ACTION_NONE for readability. This makes implicit assumption that -1 equals no-action commanded more explicit
- Tidy the scattered vcmd_ack struct handling cases into a single function
- Refactor to remove return in the middle of function: avoids future complications where a programmer may expect the logic at the end of the function to be executed, but isn't

Vehicle Command Handling
- Cancel the previous running vehicle command if we receive a different vehicle command
- Reject vehicle command if we get a same one that is getting executed
- Save the source system & component of currently running vehicle command
- Added note about new discovered edge case of having same entity sending different gripper commands consequently, where an unexpected ack result may be received
This commit is contained in:
Junwoo Hwang
2022-10-27 07:51:17 +02:00
committed by Beat Küng
parent 6529e39f8b
commit c2b2ae55d9
3 changed files with 124 additions and 65 deletions
@@ -10,6 +10,7 @@ parameters:
short: Enable Gripper actuation in Payload Deliverer
type: boolean
default: 0
reboot_required: true
PD_GRIPPER_TYPE:
description: