mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
fix(ice_controller): zero-initialize the published engine status
Only four fields of internal_combustion_engine_status are assigned before publishing, so the remaining ones carried indeterminate stack contents. The topic is forwarded to the ground station as MAVLink EFI_STATUS, which therefore reported garbage engine speed, temperatures, pressures and fuel figures on setups without a DroneCAN ECU filling them in. Assisted-by: Claude:claude-opus-5[1m] Signed-off-by: Silvan <silvan@auterion.com>
This commit is contained in:
1 parent
c428709beb
commit
8d53fa0bd6
1 file changed
+1
-1
@@ -302,7 +302,7 @@ void InternalCombustionEngineControl::publishControl(const hrt_abstime now)
|
||||
ice_control.user_request = static_cast<uint8_t>(_user_request);
|
||||
_internal_combustion_engine_control_pub.publish(ice_control);
|
||||
|
||||
internal_combustion_engine_status_s ice_status;
|
||||
internal_combustion_engine_status_s ice_status{};
|
||||
ice_status.state = static_cast<uint8_t>(_state);
|
||||
ice_status.substate = static_cast<uint8_t>(_sub_state);
|
||||
ice_status.timestamp = now;
|
||||
|
||||
Reference in new issue
Block a user