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:
Julian Oes 2021-04-21 08:34:36 +02:00
parent 96bc58f0eb
commit ea8d124f47
1 changed files with 4 additions and 2 deletions

View File

@ -2215,10 +2215,12 @@ MavlinkReceiver::handle_message_hil_sensor(mavlink_message_t *msg)
battery_status_s hil_battery_status{};
hil_battery_status.timestamp = timestamp;
hil_battery_status.voltage_v = 11.5f;
hil_battery_status.voltage_filtered_v = 11.5f;
hil_battery_status.voltage_v = 12.0f;
hil_battery_status.voltage_filtered_v = 12.0f;
hil_battery_status.current_a = 10.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);
}