Skip to content

Commit

Permalink
fw_pos_ctrl: make variables const
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Stastny committed Jan 4, 2022
1 parent cfde05a commit ffd7001
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ FixedwingPositionControl::calculate_target_airspeed(float airspeed_demand, const
}

// groundspeed undershoot
bool not_using_wind_est = !_param_fw_use_npfg.get() || !_wind_valid;
const bool not_using_wind_est = !_param_fw_use_npfg.get() || !_wind_valid;

if (!_l1_control.circle_mode() && not_using_wind_est) {
/*
Expand Down Expand Up @@ -530,7 +530,7 @@ FixedwingPositionControl::status_publish()

npfg_status.wind_est_valid = _wind_valid;

float bearing = _npfg.getBearing(); // dont repeat atan2 calc
const float bearing = _npfg.getBearing(); // dont repeat atan2 calc

pos_ctrl_status.nav_bearing = bearing;
pos_ctrl_status.target_bearing = _npfg.targetBearing();
Expand Down Expand Up @@ -1246,7 +1246,7 @@ FixedwingPositionControl::control_auto_loiter(const hrt_abstime &now, const Vect
loiter_direction = (loiter_radius > 0) ? 1 : -1;
}

bool in_circle_mode = (_param_fw_use_npfg.get() && _wind_valid) ? _npfg.circleMode() : _l1_control.circle_mode();
const bool in_circle_mode = (_param_fw_use_npfg.get() && _wind_valid) ? _npfg.circleMode() : _l1_control.circle_mode();

if (pos_sp_next.type == position_setpoint_s::SETPOINT_TYPE_LAND && pos_sp_next.valid
&& in_circle_mode && _param_fw_lnd_earlycfg.get()) {
Expand Down

0 comments on commit ffd7001

Please sign in to comment.