Simulator: Make battery discharging configurable.

This commit is contained in:
Lorenz Meier
2017-08-19 23:20:07 +02:00
parent 641f2f856b
commit 7223780563
4 changed files with 45 additions and 6 deletions
+2 -1
View File
@@ -356,7 +356,7 @@ void Simulator::handle_message(mavlink_message_t *msg, bool publish)
update_sensors(&imu);
// battery simulation
const float discharge_interval_us = 60 * 1000 * 1000;
const float discharge_interval_us = _battery_drain_interval_s.get() * 1000 * 1000;
bool armed = (_vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED);
@@ -625,6 +625,7 @@ void Simulator::send()
if (fds[0].revents & POLLIN) {
// got new data to read, update all topics
parameters_update(false);
poll_topics();
send_controls();
}