FixedwingPositionControl: track single point when no prev point exists for waypoint following

make sure correct local position setpoint output is logged
This commit is contained in:
Thomas Stastny 2023-08-21 16:51:12 +02:00 committed by Daniel Agar
parent 7160da741d
commit 37015c3dbe
1 changed files with 5 additions and 2 deletions

View File

@ -1036,8 +1036,11 @@ FixedwingPositionControl::control_auto_position(const float control_interval, co
prev_wp(1) = pos_sp_prev.lon;
} else {
// No valid previous waypoint, go along the line between aircraft and current waypoint
prev_wp = curr_pos;
// No valid previous waypoint, fly directly to current waypoint
// NOTE: this is a bad interface - navigateWaypoints() takes two waypoints on top of each other as an
// indication it should fly directly to that waypoint. Better would be e.g. an alternative overload with
// singular setpoint input. (just an idea for future refactoring/refinement)
prev_wp = curr_wp;
}
float tecs_fw_thr_min;