mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
Make all battery sensor drivers report their sample interval
To make use of the time abstraction in the leaky integrator.
This commit is contained in:
@@ -350,7 +350,7 @@ void Simulator::handle_message_hil_sensor(const mavlink_message_t *msg)
|
||||
static uint64_t last_integration_us = 0;
|
||||
|
||||
// battery simulation (limit update to 100Hz)
|
||||
if (hrt_elapsed_time(&_last_battery_timestamp) >= 10_ms) {
|
||||
if (hrt_elapsed_time(&_last_battery_timestamp) >= SimulatorBattery::SIMLATOR_BATTERY_SAMPLE_INTERVAL_US) {
|
||||
|
||||
const float discharge_interval_us = _param_sim_bat_drain.get() * 1000 * 1000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user