Skip to content

Commit 4c99051

Browse files
committed
keep in sync with master
1 parent bf2a08b commit 4c99051

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,16 +1484,19 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
14841484
* Update navigation: _autogyro_takeoff returns the start WP according to mode and phase.
14851485
* If we use the navigator heading or not is decided later.
14861486
*/
1487+
Vector2f prev_wp_local = _global_local_proj_ref.project(_runway_takeoff.getStartWP()(0),
1488+
_runway_takeoff.getStartWP()(1));
14871489

14881490
if (_param_fw_use_npfg.get()) {
14891491
_npfg.setAirspeedNom(target_airspeed * _eas2tas);
14901492
_npfg.setAirspeedMax(_param_fw_airspd_max.get() * _eas2tas);
1491-
_npfg.navigateWaypoints(_autogyro_takeoff.getStartWP(), curr_wp, curr_pos, ground_speed, _wind_vel);
1493+
_npfg.navigateWaypoints(prev_wp_local, curr_wp_local, curr_pos_local, ground_speed, _wind_vel);
1494+
14921495
_att_sp.roll_body = _autogyro_takeoff.getRoll(_npfg.getRollSetpoint());
14931496
target_airspeed = _npfg.getAirspeedRef() / _eas2tas;
14941497

14951498
} else {
1496-
_l1_control.navigate_waypoints(_runway_takeoff.getStartWP(), curr_wp, curr_pos, ground_speed);
1499+
_l1_control.navigate_waypoints(prev_wp_local, curr_wp_local, curr_pos_local, ground_speed);
14971500
_att_sp.roll_body = _autogyro_takeoff.getRoll(_l1_control.get_roll_setpoint());
14981501
}
14991502

0 commit comments

Comments
 (0)