mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-22 00:10:35 +08:00
mavlink: fix HITL battery status publication
Without these fields the pre-arm check would complain and fail. Also, the voltage is adjusted to be at around 70% rather than 30% which would almost start to trigger warnings.
This commit is contained in:
@@ -2215,10 +2215,12 @@ MavlinkReceiver::handle_message_hil_sensor(mavlink_message_t *msg)
|
|||||||
battery_status_s hil_battery_status{};
|
battery_status_s hil_battery_status{};
|
||||||
|
|
||||||
hil_battery_status.timestamp = timestamp;
|
hil_battery_status.timestamp = timestamp;
|
||||||
hil_battery_status.voltage_v = 11.5f;
|
hil_battery_status.voltage_v = 12.0f;
|
||||||
hil_battery_status.voltage_filtered_v = 11.5f;
|
hil_battery_status.voltage_filtered_v = 12.0f;
|
||||||
hil_battery_status.current_a = 10.0f;
|
hil_battery_status.current_a = 10.0f;
|
||||||
hil_battery_status.discharged_mah = -1.0f;
|
hil_battery_status.discharged_mah = -1.0f;
|
||||||
|
hil_battery_status.connected = true;
|
||||||
|
hil_battery_status.remaining = 0.70;
|
||||||
|
|
||||||
_battery_pub.publish(hil_battery_status);
|
_battery_pub.publish(hil_battery_status);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user