SITL: populate rangefinder ranges for inbuilt sims

These values are returned for the SITL rangefinder backend, type=100
This commit is contained in:
Peter Barker 2022-05-23 19:27:58 +10:00 committed by Andrew Tridgell
parent 51246fda45
commit e6e45eda97
1 changed files with 7 additions and 0 deletions

View File

@ -950,6 +950,13 @@ void Aircraft::update_external_payload(const struct sitl_input &input)
external_payload_mass += sprayer->payload_mass();
}
{
const float range = rangefinder_range();
for (uint8_t i=0; i<RANGEFINDER_MAX_INSTANCES; i++) {
rangefinder_m[i] = range;
}
}
// update i2c
if (i2c) {
i2c->update(*this);