Skip to content

Commit 136f9f4

Browse files
authored
FW Position controller: transform RWTO_PSP to rad when used (#24312)
Signed-off-by: Silvan <[email protected]>
1 parent 2b75d2e commit 136f9f4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/modules/fw_pos_control/FixedwingPositionControl.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,8 +1858,10 @@ FixedwingPositionControl::control_auto_landing_straight(const hrt_abstime &now,
18581858
POST_TOUCHDOWN_CLAMP_TIME, 0.0f,
18591859
1.0f);
18601860

1861-
pitch_max_rad = touchdown_interpolator * _param_rwto_psp.get() + (1.0f - touchdown_interpolator) * pitch_max_rad;
1862-
pitch_min_rad = touchdown_interpolator * _param_rwto_psp.get() + (1.0f - touchdown_interpolator) * pitch_min_rad;
1861+
pitch_max_rad = touchdown_interpolator * math::radians(_param_rwto_psp.get()) + (1.0f - touchdown_interpolator) *
1862+
pitch_max_rad;
1863+
pitch_min_rad = touchdown_interpolator * math::radians(_param_rwto_psp.get()) + (1.0f - touchdown_interpolator) *
1864+
pitch_min_rad;
18631865
}
18641866

18651867
// idle throttle may be >0 for internal combustion engines
@@ -2078,8 +2080,10 @@ FixedwingPositionControl::control_auto_landing_circular(const hrt_abstime &now,
20782080
const float touchdown_interpolator = math::constrain((seconds_since_flare_start - touchdown_time) /
20792081
POST_TOUCHDOWN_CLAMP_TIME, 0.0f, 1.0f);
20802082

2081-
pitch_max_rad = touchdown_interpolator * _param_rwto_psp.get() + (1.0f - touchdown_interpolator) * pitch_max_rad;
2082-
pitch_min_rad = touchdown_interpolator * _param_rwto_psp.get() + (1.0f - touchdown_interpolator) * pitch_min_rad;
2083+
pitch_max_rad = touchdown_interpolator * math::radians(_param_rwto_psp.get()) + (1.0f - touchdown_interpolator) *
2084+
pitch_max_rad;
2085+
pitch_min_rad = touchdown_interpolator * math::radians(_param_rwto_psp.get()) + (1.0f - touchdown_interpolator) *
2086+
pitch_min_rad;
20832087
}
20842088

20852089
// idle throttle may be >0 for internal combustion engines

0 commit comments

Comments
 (0)