mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-04 09:10:34 +08:00
Simulator: Make battery discharging configurable.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user