From 2574e03cb28041bca03a3c0848743882b701589f Mon Sep 17 00:00:00 2001 From: Jacob Dahl <37091262+dakejahl@users.noreply.github.com> Date: Wed, 1 Oct 2025 13:24:30 -0800 Subject: [PATCH] uavcan: esc: init msg to avoid publishing random values (#25656) --- src/drivers/uavcan/actuators/esc.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/drivers/uavcan/actuators/esc.cpp b/src/drivers/uavcan/actuators/esc.cpp index 11248e623b..9af20c49cb 100644 --- a/src/drivers/uavcan/actuators/esc.cpp +++ b/src/drivers/uavcan/actuators/esc.cpp @@ -84,11 +84,7 @@ UavcanEscController::update_outputs(bool stop_motors, uint16_t outputs[MAX_ACTUA _prev_cmd_pub = timestamp; - /* - * Fill the command message - * If unarmed, we publish an empty message anyway - */ - uavcan::equipment::esc::RawCommand msg; + uavcan::equipment::esc::RawCommand msg = {}; for (unsigned i = 0; i < num_outputs; i++) { if (stop_motors || outputs[i] == DISARMED_OUTPUT_VALUE) {