2026.6.29小更新

This commit is contained in:
2026-06-29 14:44:34 +08:00
parent 23bf083b13
commit 96201abab4
+25 -1
View File
@@ -393,7 +393,7 @@ class MissionManager:
alt=takeoff_alt, alt=takeoff_alt,
alt_frame="RELATIVE", alt_frame="RELATIVE",
speed=3.0, action="TAKEOFF", speed=3.0, action="TAKEOFF",
hover_time=5.0, yaw=state["drone"]["yaw"], yaw=state["drone"]["yaw"],
acceptance_radius=0.5, acceptance_radius=0.5,
is_last=True is_last=True
) )
@@ -505,6 +505,30 @@ class MissionManager:
return return
wp = self.waypoints[self.current_wp_index] wp = self.waypoints[self.current_wp_index]
cmd = wp.get("command", "WAYPOINT")
# 特殊航点分支选择
# 起飞航点
if cmd == "TAKEOFF":
# 飞到原点 + 目标高度
self.proxy.send_setpoint(
x=0, y=0, z=wp.get("z", self.target_altitude),
yaw=wp.get("yaw", 0.0),control_mode="POSITION",
)
current_z = self._get_current_z(state)
target_z = wp.get("z", self.target_altitude)
if abs(current_z - target_z) < 0.5:
self.current_wp_index += 1
return
# 降落航点
if cmd == "LAND":
logger.info("🛬 执行降落")
self.proxy.send_command("LAND")
self.state = MissionState.LANDING
return
wp_x = wp["x"] wp_x = wp["x"]
wp_y = wp["y"] wp_y = wp["y"]
wp_z = wp.get("z", self.target_altitude) wp_z = wp.get("z", self.target_altitude)