mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
use proper matching for VTOL fixed-wing state regarding position acceptance
This commit is contained in:
committed by
Lorenz Meier
parent
53b5758eb4
commit
5ed4e4e3a5
@@ -70,7 +70,7 @@ class MavrosMissionTest(unittest.TestCase):
|
|||||||
self.extended_state = ExtendedState()
|
self.extended_state = ExtendedState()
|
||||||
self.home_alt = 0
|
self.home_alt = 0
|
||||||
self.mc_rad = 5
|
self.mc_rad = 5
|
||||||
self.fw_rad = 80
|
self.fw_rad = 60
|
||||||
self.fw_alt_rad = 10
|
self.fw_alt_rad = 10
|
||||||
self.last_alt_d = 9999
|
self.last_alt_d = 9999
|
||||||
self.last_pos_d = 9999
|
self.last_pos_d = 9999
|
||||||
@@ -149,10 +149,15 @@ class MavrosMissionTest(unittest.TestCase):
|
|||||||
# does it reach the position in X seconds?
|
# does it reach the position in X seconds?
|
||||||
count = 0
|
count = 0
|
||||||
while count < timeout:
|
while count < timeout:
|
||||||
# use different radius matching vehicle state
|
# use MC radius by default
|
||||||
|
# FIXME: also check MAV_TYPE from system status, otherwise pure fixed-wing won't work
|
||||||
xy_radius = self.mc_rad
|
xy_radius = self.mc_rad
|
||||||
z_radius = self.mc_rad
|
z_radius = self.mc_rad
|
||||||
if self.extended_state.vtol_state == ExtendedState.VTOL_STATE_FW:
|
|
||||||
|
# use FW radius if in FW or in transition
|
||||||
|
if (self.extended_state.vtol_state == ExtendedState.VTOL_STATE_FW or
|
||||||
|
self.extended_state.vtol_state == ExtendedState.VTOL_STATE_TRANSITION_TO_MC or
|
||||||
|
self.extended_state.vtol_state == ExtendedState.VTOL_STATE_TRANSITION_TO_FW):
|
||||||
xy_radius = self.fw_rad
|
xy_radius = self.fw_rad
|
||||||
z_radius = self.fw_alt_rad
|
z_radius = self.fw_alt_rad
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user