Skip to content

Commit eaa5828

Browse files
committed
Fixing of errors caused by #19495
1 parent 8c69e38 commit eaa5828

File tree

2 files changed

+9
-22
lines changed

2 files changed

+9
-22
lines changed

src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -937,27 +937,7 @@ FixedwingPositionControl::control_auto(const float control_interval, const Vecto
937937
}
938938

939939
/* Copy thrust output for publication, handle special cases */
940-
if (position_sp_type == position_setpoint_s::SETPOINT_TYPE_TAKEOFF && // launchdetector only available in auto
941-
_launch_detection_state != LAUNCHDETECTION_RES_DETECTED_ENABLEMOTORS &&
942-
!_runway_takeoff.runwayTakeoffEnabled() && !_autogyro_takeoff.autogyroTakeoffEnabled()) {
943-
944-
/* making sure again that the correct thrust is used,
945-
* without depending on library calls for safety reasons.
946-
the pre-takeoff throttle and the idle throttle normally map to the same parameter. */
947-
_att_sp.thrust_body[0] = _param_fw_thr_idle.get();
948-
949-
} else if (position_sp_type == position_setpoint_s::SETPOINT_TYPE_TAKEOFF &&
950-
_runway_takeoff.runwayTakeoffEnabled()) {
951-
952-
_att_sp.thrust_body[0] = _runway_takeoff.getThrottle(control_interval, get_tecs_thrust());
953-
954-
} else if (pos_sp_curr.type == position_setpoint_s::SETPOINT_TYPE_TAKEOFF &&
955-
_autogyro_takeoff.autogyroTakeoffEnabled()) {
956-
957-
_att_sp.thrust_body[0] = _autogyro_takeoff.getThrottle(control_interval, min(get_tecs_thrust(),
958-
_param_fw_thr_max.get()));
959-
960-
} else if (pos_sp_curr.type == position_setpoint_s::SETPOINT_TYPE_IDLE) {
940+
if (position_sp_type == position_setpoint_s::SETPOINT_TYPE_IDLE) {
961941

962942
_att_sp.thrust_body[0] = 0.0f;
963943

@@ -1703,7 +1683,8 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
17031683
_att_sp.apply_spoilers = vehicle_attitude_setpoint_s::SPOILERS_OFF;
17041684
}
17051685

1706-
if (_launch_detection_state != LAUNCHDETECTION_RES_DETECTED_ENABLEMOTORS && !_runway_takeoff.runwayTakeoffEnabled()) {
1686+
if (_launch_detection_state != LAUNCHDETECTION_RES_DETECTED_ENABLEMOTORS && !_runway_takeoff.runwayTakeoffEnabled()
1687+
&& !_autogyro_takeoff.autogyroTakeoffEnabled()) {
17071688

17081689
/* making sure again that the correct thrust is used,
17091690
* without depending on library calls for safety reasons.
@@ -1714,6 +1695,10 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
17141695

17151696
_att_sp.thrust_body[0] = _runway_takeoff.getThrottle(now, get_tecs_thrust());
17161697

1698+
} else if (_autogyro_takeoff.autogyroTakeoffEnabled()) {
1699+
PX4_INFO("Spoustim GETTHROTTLE");
1700+
_att_sp.thrust_body[0] = _autogyro_takeoff.getThrottle(now, get_tecs_thrust());
1701+
17171702
} else {
17181703
/* Copy thrust and pitch values from tecs */
17191704
// when we are landed state we want the motor to spin at idle speed

src/modules/fw_pos_control_l1/autogyro_takeoff/AutogyroTakeoff.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ float AutogyroTakeoff::getThrottle(const hrt_abstime &now, float tecsThrottle)
367367

368368
float idle = (double)_param_fw_thr_idle.get();
369369

370+
PX4_INFO("GET THROTTLE %f, state: %f, time: %f", (double)idle, (double)_state, (double)(now - _time_in_state));
371+
370372
switch (_state) {
371373

372374
case AutogyroTakeoffState::TAKEOFF_ERROR:

0 commit comments

Comments
 (0)