diff --git a/APMrover2/Log.cpp b/APMrover2/Log.cpp index 8f00f6d135..aebcabc3e3 100644 --- a/APMrover2/Log.cpp +++ b/APMrover2/Log.cpp @@ -467,9 +467,9 @@ void Rover::Log_Write_WheelEncoder() LOG_PACKET_HEADER_INIT(LOG_WHEELENCODER_MSG), time_us : AP_HAL::micros64(), distance_0 : g2.wheel_encoder.get_distance(0), - quality_0 : (uint8_t)constrain_float(g2.wheel_encoder.get_signal_quality(0),0.0f,100.0f), + quality_0 : (uint8_t)constrain_float(g2.wheel_encoder.get_signal_quality(0), 0.0f, 100.0f), distance_1 : g2.wheel_encoder.get_distance(1), - quality_1 : (uint8_t)constrain_float(g2.wheel_encoder.get_signal_quality(1),0.0f,100.0f) + quality_1 : (uint8_t)constrain_float(g2.wheel_encoder.get_signal_quality(1), 0.0f, 100.0f) }; DataFlash.WriteBlock(&pkt, sizeof(pkt)); } @@ -503,7 +503,6 @@ void Rover::log_init(void) DataFlash.Init(log_structure, ARRAY_SIZE(log_structure)); gcs().reset_cli_timeout(); - } #if CLI_ENABLED == ENABLED diff --git a/APMrover2/radio.cpp b/APMrover2/radio.cpp index 764b08e82f..413e1fa878 100644 --- a/APMrover2/radio.cpp +++ b/APMrover2/radio.cpp @@ -129,7 +129,7 @@ void Rover::read_radio() const float left_input = channel_steer->norm_input(); const float right_input = channel_throttle->norm_input(); const float throttle_scaled = 0.5f * (left_input + right_input); - float steering_scaled = constrain_float(left_input - right_input,-1.0f,1.0f); + float steering_scaled = constrain_float(left_input - right_input, -1.0f, 1.0f); // flip the steering direction if requesting the vehicle reverse (to be consistent with separate steering-throttle frames) if (is_negative(throttle_scaled)) { diff --git a/APMrover2/sensors.cpp b/APMrover2/sensors.cpp index a8b2cd6bdb..a2c1694587 100644 --- a/APMrover2/sensors.cpp +++ b/APMrover2/sensors.cpp @@ -104,10 +104,10 @@ void Rover::update_wheel_encoder() g2.wheel_encoder.update(); // initialise on first iteration - uint32_t now = AP_HAL::millis(); + const uint32_t now = AP_HAL::millis(); if (wheel_encoder_last_ekf_update_ms == 0) { wheel_encoder_last_ekf_update_ms = now; - for (uint8_t i = 0; i