File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
src/modules/simulation/sensor_airspeed_sim Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -184,8 +184,8 @@ void SensorAirspeedSim::check_failure_injection()
184184 bool handled = false ;
185185 bool supported = false ;
186186
187- const int failure_unit = static_cast <int >(vehicle_command.param1 + 0 . 5f );
188- const int failure_type = static_cast <int >(vehicle_command.param2 + 0 . 5f );
187+ const int failure_unit = static_cast <int >(std::lround ( vehicle_command.param1 ) );
188+ const int failure_type = static_cast <int >(std::lround ( vehicle_command.param2 ) );
189189
190190 if (failure_unit == vehicle_command_s::FAILURE_UNIT_SENSOR_AIRSPEED) {
191191
Original file line number Diff line number Diff line change 3434#pragma once
3535
3636#include < lib/perf/perf_counter.h>
37+ #include < math.h>
3738#include < mathlib/mathlib.h>
3839#include < px4_platform_common/defines.h>
3940#include < px4_platform_common/module.h>
You can’t perform that action at this time.
0 commit comments