mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
fix(payload_deliverer): zero-initialize the gripper vehicle command
The gripper command sent at boot left all fields except command, param2 and timestamp uninitialized, so from_external and the target fields held stack garbage. UBSAN caught an invalid bool load in the COMMAND_LONG stream. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
1 parent
ffaae36e5f
commit
75ab97e389
1 file changed
+1
-1
@@ -239,7 +239,7 @@ void PayloadDeliverer::handle_vehicle_command(const hrt_abstime &now, const veh
|
||||
|
||||
bool PayloadDeliverer::send_gripper_vehicle_command(const int32_t gripper_action)
|
||||
{
|
||||
vehicle_command_s vcmd;
|
||||
vehicle_command_s vcmd{};
|
||||
vcmd.timestamp = hrt_absolute_time();
|
||||
vcmd.command = vehicle_command_s::VEHICLE_CMD_DO_GRIPPER;
|
||||
vcmd.param2 = gripper_action;
|
||||
|
||||
Reference in new issue
Block a user