天雷系統
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
wenchun 6ef7d3a7a6 feat(GUI): 交戰任務編排器 MissionOrchestrator(S0-S2 + 高度分層/前置攔截/速度比例限速)
在既有 MissionExecutor 之上加一層「任務大腦」,串起 ABC 對抗流程:
A 組偵察 → 偵測敵機 → 手動確認重編隊 → A+B 四機前進追敵 → 足夠近展開包圍。
全部落在 src/GUI/。

新增 mission_orchestrator.py:
- MissionOrchestrator 階段狀態機 IDLE→WATCH→DETECTED→PURSUE→ENCIRCLE。
- PURSUE/ENCIRCLE 用「瞬時隊形」而非路徑跟隨(每 tick 給每台目標點),
  修掉移動目標下 wp_index 歸零 + follower 外推造成的往返振盪。
- 偵測 latch(≤R_detect 持續 dwell)、moving-target 重算(位移≥2m 或封頂 1s)、
  切圓 hysteresis(R_engage=15 進、R_engage_exit=20 退)。
- 高度分層 _alt_for:A 組走上層、B 組走下層(不低於地面下限),
  PURSUE/ENCIRCLE 都套用 → 消掉同高度交叉撞機風險。
- 前置攔截 _aim_point:GPS 差分估敵速,瞄「敵位+敵速×lead_time」的攔截點,
  治純追尾追不上;敵機靜止時退化為瞄當下。
- EngagementPanel 交戰面板:敵機下拉、A/B 組下拉、即時距離讀數、階段顯示、
  重編隊/停止、以及「套用速度」(友機 V + 敵/友比例 r → DO_CHANGE_SPEED)。

mission_executor.py:加 complete_stops=False(hover-hold)+ update_plan()
(熱替換航點、保留 RUNNING 閉環狀態)。

communication.py:加 set_speed()(用共用 client 泛用方法發 DO_CHANGE_SPEED(178),
維持 GUI-only scope)。

gui.py:新增「交戰」分頁、engagement timer(5Hz)、orchestrator 接線、
_on_engagement_apply_speed(友方下 V、敵方下 r×V、同步 friendly_speed)。

SITL 實測通過:高度分層 A/B 正確分開、前置攔截追得上、套用速度後追擊/包圍穩定收斂。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 month ago
src feat(GUI): 交戰任務編排器 MissionOrchestrator(S0-S2 + 高度分層/前置攔截/速度比例限速) 1 month ago
.gitignore chore: 忽略 MAVProxy/SITL 產生的 tlog 與參數 dump 3 months ago
.gitmodules Fix geographic_info branch to ros2 10 months ago
README.md add vehicleDiagShow.py for vehicle diagnostics 3 months ago

README.md

這是天雷系統的專案

===

功能簡介

  1. mavlink 多對多串流與交換
  2. 支援 xbee 與 telemetry
  3. 支援 udp 管理
  4. ROS2 介面監控載具

=== 使用限制

  1. 不允許進到 ros 系統有相同 sysid
  2. 假設一台載具上所有 component 共用同一 socket

===

運行環境

專案核心框架

  1. ROS2 Humble
  2. Python 3.8.10

必要相依套件及版本

  • Python [Package] fc_network_adapter

    1. pymavlink -> Version: 2.4.42
    2. conda-forge 中的 pyserial-asyncio
    3. importlib_metadata -> Version: 8.5.0
    4. setuptools -> Version: 58.2.0 (版本太新不行)
    5. pyserial-asyncio [Package] GUI
    6. testresources
    7. websockets
    8. PyQt6
    9. PyQt6-WebEngine
  • ROS2

  1. source ~/ros2_humble/install/setup.bash
  2. geographic_info (https://github.com/ros-geographic-info/geographic_info.git) 已經作為 submodule 放在 external
  3. angles (https://github.com/ros/angles.git) 已經作為 submodule 放在 external
  4. mavros_msgs (https://github.com/mavlink/mavros) 這個專案中的一個資料夾 這邊手動複製的

開發用輔助專案

  1. Gazebo Garden
  2. Ardupilot

===

使用說明

Clone 專案後 請先執行這些指令

# 1.同步 submodule
cd ~/AirTrapMine
git submodule init
git submodule update
# 2. build 需要的 package
colcon build --packages-select angles geographic_msgs
colcon build --packages-select mavros_msgs # 這個依賴前面的
colcon build --packages-select fc_interfaces # 自己定義的

主要專案 fc_network_adapter 請一律在 ~/AirTrapMine/src/ 路徑下 以模組化啟動程式

# 記得先開啟 依賴 Package 到 overlay
. ./install/local_setup.bash
# 範例
cd ~/AirTrapMine/src/ # 這是範例!!!
python -m fc_network_adapter.fc_network_adapter.mainOrchestrator
python -m fc_network_adapter.tests.demo_integration
python -m someotherpkg.src.example_wholeMoving

python fc_network_apps/vehicleDiagShow.py

GUI 介面 在 ~/AirTrapMine/src/GUI 路徑下 直接啟動

cd ~/AirTrapMine/src/GUI
python gui.py

===

資料夾說明

  1. fc_network_adapter (核心) 建立、維護與飛控韌體的連接 構築 mavlink 封包 處理無線模組的通訊格式 (XBee)
  2. fc_interfaces (必要) 自定義的 ROS2 介面檔 沒有這個核心會運作不了
  3. fc_network_module (重要) 非核心 但是支援載具的重要附屬功能 需要該功能時 作為一個 ros2 節點打開 例如 : ntrip rtk 訊號轉接
  4. fc_network_apps 是 fc_network_adapter 高階包裝API 利於開發GUI或其他應用 使用者的外層包裝 可以不使用 或者當作一個範例程式來看
  5. someotherpkg 如何使用 fc_network_apps 的範例檔案
  6. GUI 由 PyQt6 開發的互動式介面
  7. unitdev 為各自協作者做開發時的測試區 01 -> 晉凱(ken) 02 -> 其宇(chiyu) 03 -> 文鈞 04 -> 倫渝
  8. logs 是執行時期的記錄檔

===