mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 22:32:11 +08:00
MulticopterPositionControl: allow offboard takeoff also when not landed
This commit is contained in:
@@ -419,8 +419,8 @@ void MulticopterPositionControl::Run()
|
||||
|
||||
if (_vehicle_control_mode.flag_control_offboard_enabled) {
|
||||
|
||||
bool want_takeoff = _vehicle_control_mode.flag_armed && _vehicle_land_detected.landed
|
||||
&& (vehicle_local_position.timestamp_sample < _setpoint.timestamp + 1_s);
|
||||
const bool want_takeoff = _vehicle_control_mode.flag_armed
|
||||
&& (vehicle_local_position.timestamp_sample < _setpoint.timestamp + 1_s);
|
||||
|
||||
if (want_takeoff && PX4_ISFINITE(_setpoint.z)
|
||||
&& (_setpoint.z < states.position(2))) {
|
||||
@@ -536,7 +536,7 @@ void MulticopterPositionControl::Run()
|
||||
_vehicle_attitude_setpoint_pub.publish(attitude_setpoint);
|
||||
|
||||
} else {
|
||||
// an update is necessary here because otherwise the takeoff state doesn't get skiped with non-altitude-controlled modes
|
||||
// an update is necessary here because otherwise the takeoff state doesn't get skipped with non-altitude-controlled modes
|
||||
_takeoff.updateTakeoffState(_vehicle_control_mode.flag_armed, _vehicle_land_detected.landed, false, 10.f, true,
|
||||
vehicle_local_position.timestamp_sample);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user