mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 10:03:35 +08:00
ThrowLaunch: check ThrowMode parameter to skip takoff in MulticopterPositionControl
Signed-off-by: Michał Barciś <mbarcis@mbarcis.net>
This commit is contained in:
committed by
Matthias Grob
parent
9d455d5f1f
commit
6800a448b0
@@ -74,9 +74,6 @@ void TakeoffHandling::updateTakeoffState(const bool armed, const bool landed, co
|
||||
_takeoff_state = TakeoffState::rampup;
|
||||
_takeoff_ramp_progress = 0.f;
|
||||
|
||||
} else if (!landed) {
|
||||
_takeoff_state = TakeoffState::flight;
|
||||
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -106,6 +103,7 @@ void TakeoffHandling::updateTakeoffState(const bool armed, const bool landed, co
|
||||
_takeoff_state = TakeoffState::flight;
|
||||
}
|
||||
|
||||
// TODO: need to consider free fall here
|
||||
if (!armed) {
|
||||
_takeoff_state = TakeoffState::disarmed;
|
||||
}
|
||||
|
||||
@@ -53,15 +53,15 @@ TEST(TakeoffTest, RegularTakeoffRamp)
|
||||
takeoff.updateTakeoffState(false, true, false, 1.f, false, 0);
|
||||
EXPECT_EQ(takeoff.getTakeoffState(), TakeoffState::disarmed);
|
||||
|
||||
// armed, landed, don't want takeoff
|
||||
takeoff.updateTakeoffState(true, true, false, 1.f, false, 500_ms);
|
||||
// armed, not landed anymore, don't want takeoff
|
||||
takeoff.updateTakeoffState(true, false, false, 1.f, false, 500_ms);
|
||||
EXPECT_EQ(takeoff.getTakeoffState(), TakeoffState::spoolup);
|
||||
|
||||
// armed, landed, don't want takeoff yet, spoolup time passed
|
||||
takeoff.updateTakeoffState(true, true, false, 1.f, false, 2_s);
|
||||
// armed, not landed, don't want takeoff yet, spoolup time passed
|
||||
takeoff.updateTakeoffState(true, false, false, 1.f, false, 2_s);
|
||||
EXPECT_EQ(takeoff.getTakeoffState(), TakeoffState::ready_for_takeoff);
|
||||
|
||||
// armed, not landed anymore, want takeoff
|
||||
// armed, not landed, want takeoff
|
||||
takeoff.updateTakeoffState(true, false, true, 1.f, false, 3_s);
|
||||
EXPECT_EQ(takeoff.getTakeoffState(), TakeoffState::rampup);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user