mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
mc_pos_control: warning for invalid thrust sp
This commit is contained in:
committed by
Lorenz Meier
parent
e58766c394
commit
13f8936cf1
@@ -1476,6 +1476,11 @@ void MulticopterPositionControl::control_auto(float dt)
|
||||
if (previous_in_front) {
|
||||
|
||||
/* just use the default velocity along track */
|
||||
vel_sp_along_track = vec_prev_to_pos.length() * _params.pos_p(0);
|
||||
|
||||
if (vel_sp_along_track > get_cruising_speed_xy()) {
|
||||
vel_sp_along_track = get_cruising_speed_xy();
|
||||
}
|
||||
|
||||
} else if (current_behind) {
|
||||
|
||||
@@ -2079,6 +2084,13 @@ MulticopterPositionControl::calculate_thrust_setpoint(float dt)
|
||||
thrust_body_z = thr_max;
|
||||
}
|
||||
|
||||
/* if any of the thrust setpoint is bogus, send out a warning */
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
if (!PX4_ISFINITE(thrust_sp(i))) {
|
||||
warn_rate_limited("Thrust setpoint not finite");
|
||||
}
|
||||
}
|
||||
|
||||
_att_sp.thrust = math::max(thrust_body_z, thr_min);
|
||||
|
||||
/* update integrals */
|
||||
|
||||
Reference in New Issue
Block a user