FW attitude and position control minor code cleanup (#7802)

- change a little bit to make the code more readable
This commit is contained in:
CAI Dongcai
2017-08-16 10:51:41 -04:00
committed by Daniel Agar
parent 83643a719a
commit 63306ada92
2 changed files with 9 additions and 23 deletions
@@ -829,16 +829,6 @@ FixedwingPositionControl::control_position(const math::Vector<2> &curr_pos, cons
wp_distance_save = 0.0f;
}
// create virtual waypoint which is on the desired flight path but
// some distance behind landing waypoint. This will make sure that the plane
// will always follow the desired flight path even if we get close or past
// the landing waypoint
double lat{0.0f};
double lon{0.0f};
create_waypoint_from_line_and_dist(pos_sp_curr.lat, pos_sp_curr.lon,
pos_sp_prev.lat, pos_sp_prev.lon, -1000.0f, &lat, &lon);
math::Vector<2> curr_wp_shifted {(float)lat, (float)lon};
// we want the plane to keep tracking the desired flight path until we start flaring
// if we go into heading hold mode earlier then we risk to be pushed away from the runway by cross winds