Browse Source

SITL: Simplify boolean expression

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
zr-v5.1
Patrick José Pereira 4 years ago committed by Andrew Tridgell
parent
commit
300a14aaae
  1. 6
      libraries/SITL/SIM_Helicopter.cpp
  2. 2
      libraries/SITL/SIM_SerialProximitySensor.cpp

6
libraries/SITL/SIM_Helicopter.cpp

@ -64,11 +64,7 @@ void Helicopter::update(const struct sitl_input &input) @@ -64,11 +64,7 @@ void Helicopter::update(const struct sitl_input &input)
// get wind vector setup
update_wind(input);
if (input.servos[7] > 1400) {
motor_interlock = true;
} else {
motor_interlock = false;
}
motor_interlock = input.servos[7] > 1400;
float rsc = constrain_float((input.servos[7]-1000) / 1000.0f, 0, 1);
float rsc_scale = rsc/rsc_setpoint;

2
libraries/SITL/SIM_SerialProximitySensor.cpp

@ -60,7 +60,7 @@ float SerialProximitySensor::measure_distance_at_angle_bf(const Location &locati @@ -60,7 +60,7 @@ float SerialProximitySensor::measure_distance_at_angle_bf(const Location &locati
count++;
// the 1000 here is so the files don't grow unbounded
const bool write_debug_files = true && count < 1000;
const bool write_debug_files = count < 1000;
FILE *rayfile = nullptr;
if (write_debug_files) {

Loading…
Cancel
Save