mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
AP_HAL_SITL: populate first rangefinder distance if unused
This commit is contained in:
parent
123d7e4683
commit
a1eb284349
@ -65,6 +65,11 @@ void SITL_State::_update_rangefinder(float range_value)
|
||||
}
|
||||
}
|
||||
|
||||
// if not populated also fill out the STIL rangefinder array
|
||||
if (is_equal(_sitl->state.rangefinder_m[0],-1.0f)) {
|
||||
_sitl->state.rangefinder_m[0] = altitude;
|
||||
}
|
||||
|
||||
sonar_pin_value = 1023 * (voltage / 5.0f);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user