Skip to content

Commit 3e2bf44

Browse files
dakejahlSpir0u
authored andcommitted
uavcan: esc: init msg to avoid publishing random values (PX4#25656)
(cherry picked from commit 2574e03)
1 parent 04423cd commit 3e2bf44

File tree

1 file changed

+1
-5
lines changed
  • src/drivers/uavcan/actuators

1 file changed

+1
-5
lines changed

src/drivers/uavcan/actuators/esc.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ UavcanEscController::update_outputs(bool stop_motors, uint16_t outputs[MAX_ACTUA
8484

8585
_prev_cmd_pub = timestamp;
8686

87-
/*
88-
* Fill the command message
89-
* If unarmed, we publish an empty message anyway
90-
*/
91-
uavcan::equipment::esc::RawCommand msg;
87+
uavcan::equipment::esc::RawCommand msg = {};
9288

9389
for (unsigned i = 0; i < num_outputs; i++) {
9490
if (stop_motors || outputs[i] == DISARMED_OUTPUT_VALUE) {

0 commit comments

Comments
 (0)