SITL: fixed SIM lidar for FlightAxis

This commit is contained in:
Andrew Tridgell 2023-01-24 07:52:19 +11:00
parent b43701fffa
commit 0f35286041
1 changed files with 7 additions and 0 deletions

View File

@ -551,6 +551,13 @@ void FlightAxis::update(const struct sitl_input &input)
// update magnetic field
update_mag_field_bf();
// one rangefinder
if (is_positive(dcm.c.z)) {
rangefinder_m[0] = state.m_altitudeAGL_MTR / dcm.c.z;
} else {
rangefinder_m[0] = -1;
}
report_FPS();
}