mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 07:09:48 +08:00
Update src/modules/fw_mode_manager/FixedWingModeManager.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2105,9 +2105,10 @@ FixedWingModeManager::Run()
|
||||
|
||||
}
|
||||
|
||||
if (PX4_ISFINITE(trajectory_setpoint.velocity[0]) && PX4_ISFINITE(trajectory_setpoint.velocity[1])) {
|
||||
if (PX4_ISFINITE(trajectory_setpoint.velocity[0]) && PX4_ISFINITE(trajectory_setpoint.velocity[1])
|
||||
&& PX4_ISFINITE(_pos_sp_triplet.current.lat) && PX4_ISFINITE(_pos_sp_triplet.current.lon)) {
|
||||
// Only accept horizontal velocity setpoints if a valid horizontal position has been set.
|
||||
valid_setpoint = true;
|
||||
_pos_sp_triplet.current.type = position_setpoint_s::SETPOINT_TYPE_POSITION;
|
||||
_pos_sp_triplet.current.vx = trajectory_setpoint.velocity[0];
|
||||
_pos_sp_triplet.current.vy = trajectory_setpoint.velocity[1];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user