Compare commits

...

50 Commits

Author SHA1 Message Date
wenchun 3483864a2e chore: 移除無關的模擬資料檔與 README 過時段落
刪除歷史 merge 夾帶進來的 obstacles_data.mat 與 uav_simulation_data.mat
(屬於另一個研究的資料,與本專案無關),並移除 README 末尾 0328 的
test_transform / close_loop 敘述。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 weeks ago
wenchun ae80820419 chore: gitignore notes/ 資料夾以收納本地設計筆記
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 weeks ago
wenchun 32e1ce8fb2 Merge remote-tracking branch 'origin/master' into wenchun 4 weeks ago
wenchun 33d6d59139 chore: ignore CLAUDE.md, 本地筆記與 eeprom dump 4 weeks ago
ken910606 7ae4c56f86 Merge branch 'master' of http://140.120.108.238:49308/chiyu1468/AirTrapMine 4 weeks ago
ken910606 20e8397f5a Update master with local 2.0.4 4 weeks ago
ken910606 a700e62de1 Update 'src/GUI/gui.py' 4 weeks ago
ken910606 f28dcca361 Update master with local 2.0.4 4 weeks ago
Chiyu Chen b0f1bd56f5 Merge branch 'master' of http://140.120.108.238:49308/chiyu1468/AirTrapMine
主專案整合
4 weeks ago
Chiyu Chen 2990de2f3f 1. (update) mavlinkROS2Nodes 新增 local_position 資訊 4 weeks ago
Chiyu Chen cf213fc556 1. (adding) mainOrchestrator 增加版本先驗程序
2. (adding) mavlinkVehicleView 增加 read_all 快速讀取
3. (modify) 優化 longCommand 與 navigation 使其更好引用
4. (adding) 提供一個完整的 example_wholeMoving 作為範例
4. (remove) 移除 fc_network_app 重複功能
5. (modify) 修改 overview_table 部分顯示文字
4 weeks ago
Chiyu Chen 017dd4923d 更新說明檔 fc_network_adapter 4 weeks ago
ken910606 f34693a400 longCommand 1 month ago
ken910606 989d3ad2d2 Update GUI 2.0.2 from local 1 month ago
ken910606 a1efcf5664 Update GUI 2.0.1 from local 1 month ago
ken910606 a303a3538e Update GUI 2.0.1 from local 1 month ago
ken910606 cb58ba2121 Update GUI 2.0.1 from local 1 month ago
ken910606 dbcd76be35 Update GUI 2.0.0 from local 1 month ago
ken910606 71321d4839 Update GUI 2.0.0 from local 1 month ago
Chiyu Chen c4f178bb75 Merge branch 'chiyu'
1. 初步完善 ros2 service 功能 包含解鎖起飛降落與 goto
2. 為了整合到 GUI 去使用
1 month ago
Chiyu Chen eb2f0af58e (tested)
1. 新增 ros2 接收 SET_POSITION_TARGET_LOCAL_NED 功能, 因應新增 MavPositionTargetGlobalInt.srv 的介面定義檔, 並相應新增使用者的外層包裝 navigation.py
2. 改善 ros2 service 的 response ack 數值對應, 新增 ackEnum.py
3. 改善 longCommand.py 內的呼叫層次, 把 longCommand 相關整合到同樣的 class 下, 僅以 def function 區分內部套用那種 MAV_CMD
4. 新增 example_position_goto.py, example_takeoff_land.py 作為使用範例 ( land.py arm_disarm.py ... 這些下個版本會被刪除)
5. 剩下就是一些註解的修正與更新
1 month ago
wenchun 7d0368e7ba chore: 移除 CLAUDE.md 不納入版控
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 month ago
wenchun c2196153ff feat: 多任務群組系統 — 四欄式面板、地圖框選分配、可調參數
- 新增 mission_group.py:MissionGroup 資料結構、DroneAssignDialog、GroupPanel
- GroupPanel 四欄式佈局:控制指令 / 任務規劃 / 任務參數 / 選取與分組
- 任務參數欄依任務類型動態切換(間距、高度、偏移量等),規劃時從 UI 讀值
- 框選/全選可直接分配無人機到群組,清除分組一鍵重置
- 地圖清理:移除右下角 overlay,功能整合至 GroupPanel
- 修復 JS clearSelectionMode 引用已移除元素導致框選/Grid Sweep 失效
- 每群組獨立 MissionExecutor,共用 MavlinkSender

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 month ago
wenchun 693a55c289 merge: 合併 master 最新內容,以 master 為基準解決衝突
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 month ago
wenchun 337ca8ce24 chore: 更新 .gitignore,移除不再使用的 test_mission.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 month ago
ken910606 ad87eda1b4 Merge GUI 1.0.1 from ken 1 month ago
ken910606 2937610938 Merge GUI 1.0.1 from ken 1 month ago
Chiyu Chen 44d53f51fb (tested) 1. 增加各種 command long 的功能與使用範例 2. 刪除無用的 mavlinkPublish.py 3. 1 month ago
Chiyu Chen e4585134cc (tested) 將 commandLong 的 ros2 service 包裝為一個函式庫 changeMode 並附上一個臨時範例 1 month ago
Chiyu Chen 60d6eba8cd (tested) 完成 ros2 service 結構與 timesync command_long 協議 1 month ago
Chiyu Chen 5374e2b9d9 timesync 初步做好 1 month ago
Chiyu Chen 1d49ca12e9 (temp) 暫存 3 months ago
Chiyu Chen 3d48b1d9fe (fix) 1. 把 bridge 的種類補上可以跟 ros2 搭配
2. 一些 ros2 service 的基底 仍在開發
3 months ago
Chiyu Chen bbd120d25a (Tested) 將ROS2 Topic 納入 mainOrchestrator 系統 3 months ago
Chiyu Chen e0165c9aab (add) 1. 增加 ros2 topic publish 4 months ago
Chiyu Chen fa0a2d0831 (Tested)
新增刪除載具功能
代碼優化
詳見改版記錄
4 months ago
Chiyu Chen c12959d964 (Sort Out) 1. 新增 fc_network_adapter.md
整理並記錄專案結構
程式功能無改動 修正排版與命名
4 months ago
Chiyu Chen f8f5ff5a15 Tested
(modify) 1. 新增已連線載具的基礎資訊功能
4 months ago
Chiyu Chen e00880c6de 1. (modify) acquireSerial.py 撈取多個端口字串功能
2. (modify) 調整面板的顯示字串
3. (remove) serial_udp_bitrans.py 用不到了
4 months ago
Chiyu Chen 62356cc056 (Tested) fix mainOrchestrator.py
完善 serial 支援
5 months ago
Chiyu Chen 5134fa8466 commit to merge
serial port 功能已驗證
5 months ago
Chiyu Chen f31cc8742a (Tested) 1. mainOrchestrator.py 修正呼叫錯誤 5 months ago
Chiyu Chen a8aefe7853 1. serialManager 功能完成
2. mainOrchestrator 把serial端口整合到介面中了
3. 新增獲取系統 serial 資源的 util 工具
5 months ago
Chiyu Chen bcccdec927 modify: mainOrchestrator.py 改善顯示介面
add: serialManager.py 添加Serial 連結功能 (未完成)
5 months ago
Chiyu Chen 0ce78b964a before merge change nothing 5 months ago
Chiyu Chen d2e90a93c9 Fix geographic_info branch to ros2 5 months ago
Chiyu Chen 7158e9548a Add external package
geographic_info and angles and mavros_msgs
5 months ago
Chiyu Chen 6a71e4530f 1. 大量添增終端機介面功能
2. 優化 mavlink_object 與 manager 的流程
5 months ago
Chiyu Chen 7af138b02a 1. 調整檔案結構 變動 import 的路徑與方法
2. 新增 mainOrchestrator.py 作為接下來開發介面化統合工具的主要檔案
6 months ago
Chiyu Chen 2c4fc4583e Hotfix : mavlink_object 內 process_data 的 try 迴圈刪減
(try 嚴重影響效能)
11 months ago

9
.gitignore vendored

@ -25,5 +25,10 @@ Makefile
**/*.class
**/*.pyc
**/*.pyo
logs/
src/logs/
**/.cursor/
CLAUDE.md
# 本地筆記與硬體 dump
my_env_notes.md
notes/
**/eeprom.bin

7
.gitmodules vendored

@ -0,0 +1,7 @@
[submodule "src/external/angles"]
path = src/external/angles
url = https://github.com/ros/angles.git
[submodule "src/external/geographic_info"]
path = src/external/geographic_info
url = https://github.com/ros-geographic-info/geographic_info.git
branch = ros2

@ -1,45 +1,99 @@
這是天雷系統的專案
===
專案核心框架
1. ROS2 Humble
2. Python 3.8.10
===
必要相依套件
## 功能簡介
1. mavlink 多對多支援平台
2. 不允許進到 ros 系統有相同 sysid
3. 假設一台載具上所有 component 共用同一 socket
Python
1. pymavlink
2. conda-forge 中的 pyserial-asyncio
3.
===
## 運行環境
### 專案核心框架
1. ROS2 Humble
2. Python 3.8.10
ROS2
### 必要相依套件及版本
- 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
1. testresources
2. websockets
3. PyQt6
4. PyQt6-WebEngine
- ROS2
1. source ~/ros2_humble/install/setup.bash
2.
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
===
Package 簡述
<<<<<<< HEAD
===
## 使用說明
Clone 專案後 請先執行這些指令
```bash
# 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 # 自己定義的
```
1.
主要專案 fc_network_adapter 請一律在 ~/AirTrapMine/src/ 路徑下 以模組化啟動程式
```bash
# 記得先開啟 依賴 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
```
2.
GUI 介面
在 ~/AirTrapMine/src/GUI 路徑下 直接啟動
```bash
cd ~/AirTrapMine/src/GUI
python gui.py
```
===
簡述0328
主要是透過test_transform這隻程式執行fdm_switch_example_one_with_remote_forwarding這個副函式透過UDP將封包轉接到Matlab並在Matlab進行演算法迭代後打包JSON檔並再次透過port口傳回封包傳回來的封包會在close_loop這隻程式被解析並提取其中有關velocity的資料儲存成變數以mavlink的方式打入Ardupilot以實現封閉迴路的構思。
=======
## 資料夾說明
1. unitdev 為各自協作者做開發時的測試區
01 -> 晉凱(ken)
02 -> 其宇(chiyu)
03 -> 文鈞
04 -> 倫渝
2. fc_network_adapter
2. fc_network_adapter (核心)
建立、維護與飛控韌體的連接
構築 mavlink 封包
同時處理與 Gazebo 的 ardupilot_plugin 溝通的 FDM/JSON 訊息
處理無線模組的通訊格式 (XBee)
--同時處理與 Gazebo 的 ardupilot_plugin 溝通的 FDM/JSON 訊息 (移除)--
3. fc_interfaces (重要)
自定義的 ROS2 介面檔
4. fc_network_apps
與 fc_network_adapter 銜接做高階功能包裝的應用小程式 利於開發GUI或其他應用
使用者的外層包裝
5. someotherpkg
如何使用 fc_network_apps 的範例檔案
6. GUI
由 PyQt6 開發的互動式介面
N. logs 是執行時期的記錄檔
>>>>>>> chiyu
===

Binary file not shown.

@ -4,10 +4,14 @@ import math
import re
import threading
from threading import Lock
from concurrent.futures import ThreadPoolExecutor
import asyncio
import websockets
import json
import socket
import sys
import os
import traceback
from pymavlink import mavutil
from geometry_msgs.msg import Point, Vector3
from sensor_msgs.msg import BatteryState, NavSatFix, Imu
@ -15,6 +19,23 @@ from std_msgs.msg import Float64, String
from mavros_msgs.msg import State, VfrHud
from mavros_msgs.srv import CommandBool, CommandTOL
# 確保 src 目錄在 Python 路徑中(用於 fc_network_apps 導入)
_src_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if _src_path not in sys.path:
sys.path.insert(0, _src_path)
# 導入 fc_network_apps 的 longCommand統一的 MAV_CMD_* API
try:
from fc_network_apps.longCommand import CommandLongClient
except ImportError as e:
import traceback
print(f"⚠️ 警告: 無法導入 CommandLongClient")
print(f" 错误: {e}")
print(f" 这通常表示 ROS2 的 fc_interfaces 包未被编译或未正确安装")
print(f" 完整堆栈跟踪:")
traceback.print_exc()
CommandLongClient = None
class DroneSignals(QObject):
update_signal = pyqtSignal(str, str, object) # (msg_type, drone_id, data)
@ -113,12 +134,15 @@ class UDPMavlinkReceiver(threading.Thread):
})
elif msg_type == "ATTITUDE":
# 從 MAVLink 訊息中提取並轉為角度
pitch = math.degrees(msg.pitch)
roll = math.degrees(msg.roll)
yaw = math.degrees(msg.yaw)
self.signals.update_signal.emit('attitude', drone_id, {
'pitch': pitch,
'roll': 0,
'yaw': 0,
'rates': (0, 0, 0)
'roll': roll,
'yaw': yaw,
'rates': (msg.rollspeed, msg.pitchspeed, msg.yawspeed)
})
elif msg_type == "VFR_HUD":
@ -244,12 +268,15 @@ class SerialMavlinkReceiver(threading.Thread):
})
elif msg_type == "ATTITUDE":
# 從 MAVLink 訊息中提取並轉為角度
pitch = math.degrees(msg.pitch)
roll = math.degrees(msg.roll)
yaw = math.degrees(msg.yaw)
self.signals.update_signal.emit('attitude', drone_id, {
'pitch': pitch,
'roll': 0,
'yaw': 0,
'rates': (0, 0, 0)
'roll': roll,
'yaw': yaw,
'rates': (msg.rollspeed, msg.pitchspeed, msg.yawspeed)
})
elif msg_type == "VFR_HUD":
@ -392,8 +419,13 @@ class WebSocketMavlinkReceiver(threading.Thread):
class DroneMonitor(Node):
# Subscribe to drone ROS2 topics
_instance = None # Singleton pattern to prevent duplicate nodes
def __init__(self):
super().__init__('drone_monitor')
# Use a unique node name with timestamp to avoid conflicts on restart
import time
node_name = f'drone_monitor_{int(time.time() * 1000) % 100000}'
super().__init__(node_name)
self.signals = DroneSignals()
self.drone_topics = {}
self.lock = Lock()
@ -434,6 +466,17 @@ class DroneMonitor(Node):
# ================================================================================
self.serial_receivers = []
# ================================================================================
# 【新增】初始化 CommandLongClient持久化不會每次調用都創建/銷毀)
# ================================================================================
self.command_long_client = None
try:
self.command_long_client = CommandLongClient()
except Exception as e:
print(f"⚠️ 警告: 無法初始化 CommandLongClient: {e}")
self.command_long_client = None
# ================================================================================
# 主题检测定时器
self.create_timer(1.0, self.scan_topics)
@ -530,44 +573,151 @@ class DroneMonitor(Node):
setattr(self, f'drone_{sys_id}_subs', subs)
async def arm_drone(self, drone_id, arm):
if drone_id not in self.arm_clients:
return False
client = self.arm_clients[drone_id]
if not client.wait_for_service(timeout_sec=1.0):
return False
request = CommandBool.Request()
request.value = arm
future = client.call_async(request)
# ================================================================================
# 【新增】模式名稱到 custom_mode 值的映射(基於 Copter 模式)
# ================================================================================
MODE_MAPPING = {
"STABILIZE": 0,
"ACRO": 1,
"ALT_HOLD": 2,
"AUTO": 3,
"GUIDED": 4,
"LOITER": 5,
"RTL": 6,
"CIRCLE": 7,
"POSITION": 8,
"LAND": 9,
"OF_LOITER": 10,
"DRIFT": 11,
"SPORT": 13,
"FLIP": 14,
"AUTOTUNE": 15,
"POSHOLD": 16,
"BRAKE": 17,
"THROW": 18,
"AVOID_ADSB": 19,
"GUIDED_NOGPS": 20,
"SMART_RTL": 21,
}
# ================================================================================
async def set_mode(self, drone_id, mode_name):
"""使用 CommandLongClient 切換無人機飛行模式"""
try:
response = await future
return response.success
# 解析 drone_id 提取 sysid
parts = drone_id.split('_')
if len(parts) < 2:
print(f"❌ [SET_MODE] 無效的 drone_id 格式: {drone_id}")
return False
sysid = int(parts[-1])
# 獲取模式對應的 custom_mode 值
custom_mode = self.MODE_MAPPING.get(mode_name)
if custom_mode is None:
print(f"❌ [SET_MODE] 未知模式: {mode_name}")
return False
print(f"\n📢 [SET_MODE] {drone_id}{mode_name} (custom_mode={custom_mode})")
# 在線程池中調用 CommandLongClient
loop = asyncio.get_event_loop()
executor = ThreadPoolExecutor(max_workers=1)
def _call_set_mode():
client = CommandLongClient() if CommandLongClient else None
if not client:
return False
result = client.change_mode(
target_sysid=sysid,
custom_mode=float(custom_mode),
target_compid=0,
base_mode=1.0,
timeout_sec=2.0,
)
client.destroy_node()
return result.success if result else False
result = await loop.run_in_executor(executor, _call_set_mode)
if result:
print(f"✅ [SET_MODE] 模式切換成功")
return True
else:
print(f"❌ [SET_MODE] 模式切換失敗")
return False
except Exception as e:
self.get_logger().error(f'Arm service call failed: {e}')
print(f"❌ [SET_MODE] 例外錯誤: {e}")
traceback.print_exc()
return False
async def takeoff_drone(self, drone_id, altitude=10.0):
if drone_id not in self.takeoff_clients:
return False
async def arm_drone(self, drone_id, arm):
"""使用 CommandLongClient 執行 ARM/DISARM使用非阻塞的 async 方法)"""
try:
# 解析 drone_id 提取 sysid
parts = drone_id.split('_')
if len(parts) < 2:
print(f"❌ [ARM] 無效的 drone_id 格式: {drone_id}")
return False
sysid = int(parts[-1])
client = self.takeoff_clients[drone_id]
if not client.wait_for_service(timeout_sec=1.0):
return False
action_name = "解鎖" if arm else "上鎖"
print(f"\n📢 [ARM] {drone_id}{action_name}")
request = CommandTOL.Request()
request.altitude = altitude
request.min_pitch = 0.0
request.yaw = 0.0
future = client.call_async(request)
if not self.command_long_client:
print(f"❌ [ARM] CommandLongClient 未初始化")
return False
# 直接調用 async 方法,無需線程池(避免嵌套執行器衝突)
result = await self.command_long_client.arm_disarm_async(
target_sysid=sysid,
arm=arm,
target_compid=0,
timeout_sec=2.0,
)
if result and result.success:
print(f"✅ [ARM] {action_name}成功")
return True
else:
print(f"❌ [ARM] {action_name}失敗 (message={result.message if result else 'None'})")
return False
except Exception as e:
print(f"❌ [ARM] 例外錯誤: {e}")
traceback.print_exc()
return False
async def takeoff_drone(self, drone_id, altitude):
"""使用 CommandLongClient 執行無人機起飛(使用非阻塞的 async 方法)"""
try:
response = await future
return response.success
# 解析 drone_id 提取 sysid
parts = drone_id.split('_')
if len(parts) < 2:
print(f"❌ [TAKEOFF] 無效的 drone_id 格式: {drone_id}")
return False
sysid = int(parts[-1])
print(f"\n📢 [TAKEOFF] {drone_id} → 起飛 (高度={altitude}m)")
if not self.command_long_client:
print(f"❌ [TAKEOFF] CommandLongClient 未初始化")
return False
# 直接調用 async 方法,無需線程池(避免嵌套執行器衝突)
result = await self.command_long_client.takeoff_async(
target_sysid=sysid,
altitude_m=float(altitude),
target_compid=0,
timeout_sec=2.0,
)
if result and result.success:
print(f"✅ [TAKEOFF] 起飛成功")
return True
else:
print(f"❌ [TAKEOFF] 起飛失敗 (message={result.message if result else 'None'})")
return False
except Exception as e:
self.get_logger().error(f'Takeoff service call failed: {e}')
print(f"❌ [TAKEOFF] 例外錯誤: {e}")
traceback.print_exc()
return False
def send_setpoint(self, drone_id, x, y, z):

@ -486,7 +486,7 @@ class AttitudeIndicator(QWidget):
# ---- rotate + translate canvas for roll & pitch
p.save()
p.translate(cx, cy)
p.rotate(self.roll)
p.rotate(-self.roll) # ✅ 負值NED 坐標系轉換
pitch_offset = self.pitch * ppd
# sky (above horizon)
@ -535,7 +535,7 @@ class AttitudeIndicator(QWidget):
p.drawLine(QPointF(x1, y1), QPointF(x2, y2))
# roll pointer triangle (rotates with roll)
p.rotate(self.roll)
p.rotate(-self.roll) # ✅ 負值NED 坐標系轉換
ptr_r = arc_r - 1
tri = QPolygonF([
QPointF(0, -ptr_r),

File diff suppressed because it is too large Load Diff

@ -178,35 +178,8 @@ class DroneMap:
</head>
<body>
<div id="map"></div>
<div class="map-controls">
<button class="selection-button" onclick="clearAllTrajectories()">清除軌跡</button>
<div style="border-top: 1px solid #ddd; padding-top: 5px; margin-top: 5px;">
<label style="font-size: 12px; color: #555; font-weight: bold;">任務模式</label>
<select id="mission-mode-select" onchange="onMissionModeChanged(this.value)" style="width: 100%; padding: 6px; border-radius: 4px; border: 1px solid #ccc; font-size: 12px; margin-top: 3px;">
<option value="M_FORMATION">列隊飛行</option>
<option value="CIRCLE_FORMATION">環狀包圍</option>
<option value="LEADER_FOLLOWER">跟隨模式</option>
<option value="GRID_SWEEP">柵狀偵查</option>
</select>
</div>
<button class="confirm-route-button" id="confirm-route-btn" onclick="confirmRoute()" style="display: none;">確認路徑</button>
<button class="selection-button" id="select-polygon-btn" onclick="togglePolygonSelection()">多點選擇區域 (開發中)</button>
</div>
<div class="mission-info-panel">
<div class="selection-buttons">
<button class="selection-button-blue" onclick="toggleSelectAllDrones()">全選無人機</button>
<button class="selection-button-blue" id="select-drones-btn" onclick="toggleDroneSelection()">框選無人機</button>
</div>
<div class="mission-info-row">
<span class="mission-info-label">中心點: </span>
<span class="mission-info-value" id="center-position">未設定</span>
</div>
<div class="mission-info-row">
<span class="mission-info-label">目標點: </span>
<span class="mission-info-value" id="target-position">未設定</span>
</div>
<button class="mission-start-button" id="start-mission-btn" onclick="startMission()" disabled>開始任務</button>
<button class="mission-start-button" id="pause-mission-btn" onclick="pauseMission()">暫停任務</button>
<div class="map-controls" id="map-controls-panel" style="display: none;">
<button class="confirm-route-button" id="confirm-route-btn" onclick="confirmRoute()">確認路徑</button>
</div>
<script>
@ -374,6 +347,9 @@ class DroneMap:
var missionLine = null;
var centerPosition = null;
var targetPosition = null;
// 多群組任務規劃 每個 group 各自的 layer group
var groupMissionLayers = {}; // group_id L.layerGroup
// 選擇工具變量
var selectionMode = null; // 'drones', 'rect', 'polygon', 'route', null
@ -393,30 +369,8 @@ class DroneMap:
var routeLayer = L.layerGroup().addTo(map);
// ================================================================================
// 更新任務信息面板
function updateMissionInfo() {
const centerElem = document.getElementById('center-position');
const targetElem = document.getElementById('target-position');
const startBtn = document.getElementById('start-mission-btn');
if (centerPosition) {
centerElem.textContent = `${centerPosition.lat.toFixed(6)}°, ${centerPosition.lng.toFixed(6)}°`;
} else {
centerElem.textContent = '未設定';
}
if (targetPosition) {
targetElem.textContent = `${targetPosition.lat.toFixed(6)}°, ${targetPosition.lng.toFixed(6)}°`;
} else {
targetElem.textContent = '未設定';
}
if (centerPosition && targetPosition) {
startBtn.disabled = false;
} else {
startBtn.disabled = true;
}
}
// 任務信息已移至 GroupPanel 顯示
function updateMissionInfo() {}
// ================================================================================
// 選擇工具函數
@ -429,14 +383,14 @@ class DroneMap:
}
function toggleDroneSelection() {
clearSelectionMode();
if (selectionMode === 'drones') {
selectionMode = null;
document.getElementById('select-drones-btn').classList.remove('active');
selectionLayer.clearLayers();
tempRectangle = null;
map.dragging.enable();
} else {
clearSelectionMode();
selectionMode = 'drones';
document.getElementById('select-drones-btn').classList.add('active');
map.dragging.disable();
}
}
@ -450,7 +404,7 @@ class DroneMap:
clearSelectionMode();
clearPolygonPoints();
selectionMode = null;
document.getElementById('select-polygon-btn').classList.remove('active');
// select-polygon-btn removed from map overlay
}
} else {
clearSelectionMode();
@ -462,17 +416,12 @@ class DroneMap:
}
function clearSelectionMode() {
document.getElementById('select-drones-btn').classList.remove('active');
document.getElementById('select-polygon-btn').classList.remove('active');
selectionLayer.clearLayers();
tempRectangle = null;
// 不清除 routeLayer clearRoutePoints 單獨管理
map.dragging.enable();
// 如果離開 route 模式重置 selectionMode
if (selectionMode !== 'route') {
selectionMode = null;
}
@ -527,7 +476,7 @@ class DroneMap:
}
selectionMode = null;
document.getElementById('select-polygon-btn').classList.remove('active');
// select-polygon-btn removed from map overlay
map.dragging.enable();
}
@ -554,6 +503,10 @@ class DroneMap:
}
});
console.log('框選無人機:', selectedDrones);
// 通知 Python 完整的框選結果
if (bridge && selectedDrones.length > 0) {
bridge.droneBoxSelected(JSON.stringify(selectedDrones));
}
} else if (selectionMode === 'rect') {
var rectPoints = [
@ -588,18 +541,7 @@ class DroneMap:
// 重置狀態
selectionMode = null;
document.getElementById('select-drones-btn').classList.remove('active');
map.dragging.enable();
// 如果仍在 Grid Sweep 模式重新進入框選
var currentMode = document.getElementById('mission-mode-select').value;
if (currentMode === 'GRID_SWEEP') {
setTimeout(function() {
selectionMode = 'rect';
map.dragging.disable();
console.log('Grid Sweep: 重新進入框選模式');
}, 500);
}
}
// ================================================================================
@ -708,19 +650,19 @@ class DroneMap:
selectionMode = null;
clearSelectionMode();
clearRoutePoints();
// 隱藏確認路徑按鈕
document.getElementById('confirm-route-btn').style.display = 'none';
// 預設隱藏控制面板
document.getElementById('map-controls-panel').style.display = 'none';
if (mode === 'GRID_SWEEP') {
// 自動進入框選模式
selectionMode = 'rect';
map.dragging.disable();
console.log('Grid Sweep: 進入框選模式');
} else if (mode === 'LEADER_FOLLOWER') {
// 進入路徑標記模式
// 進入路徑標記模式 + 顯示確認路徑按鈕
selectionMode = 'route';
document.getElementById('confirm-route-btn').style.display = 'block';
document.getElementById('map-controls-panel').style.display = 'flex';
console.log('跟隨模式: 進入路徑標記模式,點擊地圖添加路徑點');
}
@ -839,76 +781,74 @@ class DroneMap:
// 任務規劃視覺化函式
// ================================================================================
function drawMissionPlan(centerLat, centerLon, targetLat, targetLon) {
clearMissionPlan();
drawMissionPlanForGroup('_default', '#FF4444', centerLat, centerLon, targetLat, targetLon);
}
function drawMissionPlanForGroup(groupId, color, centerLat, centerLon, targetLat, targetLon) {
clearMissionPlanForGroup(groupId);
centerPosition = {lat: centerLat, lng: centerLon};
targetPosition = {lat: targetLat, lng: targetLon};
updateMissionInfo();
var layerGroup = L.layerGroup().addTo(map);
groupMissionLayers[groupId] = layerGroup;
var centerIcon = L.divIcon({
className: 'mission-center',
html: `<div style="
background-color: #FF4444;
color: white;
width: 20px;
height: 20px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 12px;
border: 2px solid white;
box-shadow: 0 2px 5px rgba(0,0,0,0.3);
">C</div>`,
iconSize: [20, 20],
iconAnchor: [10, 10]
html: '<div style="' +
'background-color: ' + color + ';' +
'color: white;' +
'width: 22px; height: 22px;' +
'border-radius: 50%;' +
'display: flex; align-items: center; justify-content: center;' +
'font-weight: bold; font-size: 10px;' +
'border: 2px solid white;' +
'box-shadow: 0 2px 5px rgba(0,0,0,0.3);' +
'">' + groupId + '</div>',
iconSize: [22, 22],
iconAnchor: [11, 11]
});
centerMarker = L.marker([centerLat, centerLon], {
icon: centerIcon,
zIndexOffset: 2000
}).addTo(missionPlanGroup);
L.marker([centerLat, centerLon], {
icon: centerIcon, zIndexOffset: 2000
}).addTo(layerGroup);
var targetIcon = L.divIcon({
className: 'mission-target',
html: `<div style="
background-color: #FFD700;
color: #FF4444;
width: 20px;
height: 20px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 14px;
border: 2px solid white;
box-shadow: 0 2px 5px rgba(0,0,0,0.3);
">★</div>`,
iconSize: [20, 20],
iconAnchor: [10, 10]
html: '<div style="' +
'background-color: #FFD700;' +
'color: ' + color + ';' +
'width: 22px; height: 22px;' +
'border-radius: 50%;' +
'display: flex; align-items: center; justify-content: center;' +
'font-weight: bold; font-size: 14px;' +
'border: 2px solid white;' +
'box-shadow: 0 2px 5px rgba(0,0,0,0.3);' +
'">★</div>',
iconSize: [22, 22],
iconAnchor: [11, 11]
});
targetMarker = L.marker([targetLat, targetLon], {
icon: targetIcon,
zIndexOffset: 2000
}).addTo(missionPlanGroup);
console.log('任務規劃已繪製: C(' + centerLat + ', ' + centerLon + ') -> T(' + targetLat + ', ' + targetLon + ')');
L.marker([targetLat, targetLon], {
icon: targetIcon, zIndexOffset: 2000
}).addTo(layerGroup);
console.log('Group ' + groupId + ' 任務規劃已繪製');
}
function clearMissionPlan() {
if (centerMarker) {
missionPlanGroup.removeLayer(centerMarker);
centerMarker = null;
function clearMissionPlanForGroup(groupId) {
if (groupMissionLayers[groupId]) {
map.removeLayer(groupMissionLayers[groupId]);
delete groupMissionLayers[groupId];
}
if (targetMarker) {
missionPlanGroup.removeLayer(targetMarker);
targetMarker = null;
}
function clearAllMissionPlans() {
for (var gid in groupMissionLayers) {
map.removeLayer(groupMissionLayers[gid]);
}
groupMissionLayers = {};
centerPosition = null;
targetPosition = null;
updateMissionInfo();
@ -969,17 +909,45 @@ class DroneMap:
# 任務規劃視覺化方法
# ================================================================================
def draw_mission_plan(self, center_lat, center_lon, target_lat, target_lon):
"""在地圖上繪製任務規劃"""
"""在地圖上繪製任務規劃(舊介面,相容用)"""
self.draw_mission_plan_for_group('_default', '#FF4444',
center_lat, center_lon, target_lat, target_lon)
def draw_mission_plan_for_group(self, group_id, color,
center_lat, center_lon, target_lat, target_lon):
"""在地圖上繪製指定群組的任務規劃(帶顏色區分)"""
if self.map_loaded:
js_code = f"drawMissionPlan({center_lat:.6f}, {center_lon:.6f}, {target_lat:.6f}, {target_lon:.6f});"
js_code = (
f"drawMissionPlanForGroup("
f"'{group_id}', '{color}', "
f"{center_lat:.6f}, {center_lon:.6f}, "
f"{target_lat:.6f}, {target_lon:.6f});"
)
self.map_view.page().runJavaScript(js_code)
print(f"📍 地圖已繪製任務規劃: C({center_lat:.6f}, {center_lon:.6f}) -> T({target_lat:.6f}, {target_lon:.6f})")
print(f"📍 地圖已繪製 Group {group_id} 任務規劃: "
f"C({center_lat:.6f}, {center_lon:.6f}) -> T({target_lat:.6f}, {target_lon:.6f})")
def clear_mission_plan(self):
"""清除地圖上的任務規劃標記"""
"""清除地圖上所有任務規劃標記"""
if self.map_loaded:
self.map_view.page().runJavaScript("clearAllMissionPlans();")
print("🗑️ 地圖已清除所有任務規劃")
def clear_mission_plan_for_group(self, group_id):
"""清除指定群組的任務規劃標記"""
if self.map_loaded:
self.map_view.page().runJavaScript("clearMissionPlan();")
print("🗑️ 地圖已清除任務規劃")
self.map_view.page().runJavaScript(f"clearMissionPlanForGroup('{group_id}');")
print(f"🗑️ 地圖已清除 Group {group_id} 任務規劃")
def set_mission_mode(self, mode):
"""從 Python 端切換地圖的任務模式(觸發框選/路徑標記等)"""
if self.map_loaded:
self.map_view.page().runJavaScript(f"onMissionModeChanged('{mode}');")
def toggle_drone_box_select(self):
"""切換地圖上的無人機框選模式"""
if self.map_loaded:
self.map_view.page().runJavaScript("toggleDroneSelection();")
# ================================================================================
def get_widget(self):
@ -1029,6 +997,10 @@ class DroneMap:
def get_route_confirmed_signal(self):
"""獲取路徑確認信號"""
return self.bridge.route_confirmed
def get_drone_box_selected_signal(self):
"""獲取框選無人機完成信號"""
return self.bridge.drone_box_selected
class MapBridge(QObject):
"""JavaScript 和 Python 之間的橋接類"""
@ -1042,7 +1014,8 @@ class MapBridge(QObject):
polygon_selected = pyqtSignal(str)
mission_mode_changed = pyqtSignal(str)
route_confirmed = pyqtSignal(str) # 路徑確認 (JSON 字串)
drone_box_selected = pyqtSignal(str) # 框選無人機完成 (JSON 字串)
def __init__(self):
super().__init__()
@ -1102,4 +1075,10 @@ class MapBridge(QObject):
def routeConfirmed(self, points_json):
"""供 JavaScript 調用的方法 - 路徑確認"""
self.route_confirmed.emit(points_json)
print(f"📍 路徑已確認: {points_json}")
print(f"📍 路徑已確認: {points_json}")
@pyqtSlot(str)
def droneBoxSelected(self, drone_ids_json):
"""供 JavaScript 調用的方法 - 框選無人機完成"""
self.drone_box_selected.emit(drone_ids_json)
print(f"📦 框選無人機: {drone_ids_json}")

@ -0,0 +1,519 @@
#!/usr/bin/env python3
"""
任務群組模組
管理多任務群組的資料結構與無人機分配對話框
"""
from PyQt6.QtWidgets import (
QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton,
QComboBox, QDialog, QCheckBox, QScrollArea, QFrame, QLineEdit
)
from PyQt6.QtCore import Qt, pyqtSignal
from mission_executor import MissionExecutor, MissionState
# 群組顏色(循環使用)
GROUP_COLORS = [
'#4A9EFF', # 藍
'#FF8C42', # 橘
'#56C87A', # 綠
'#E85D75', # 紅
'#B07CED', # 紫
'#F5C542', # 黃
'#42C9C9', # 青
'#FF6B9D', # 粉
]
class MissionGroup:
"""單一任務群組的資料"""
def __init__(self, group_id, color):
self.group_id = group_id # 'A', 'B', 'C', ...
self.color = color # 顏色 hex
self.drone_ids = set() # 已分配的無人機 ID
self.mission_type = 'M_FORMATION' # 預設任務類型
self.planned_waypoints = None # 規劃結果 dict
self.executor = None # MissionExecutor 實例(延遲建立)
self.center_origin = None # 規劃原點
@property
def state(self):
if self.executor is None:
return MissionState.IDLE
return self.executor.state
@property
def display_name(self):
return f"Group {self.group_id}"
class DroneAssignDialog(QDialog):
"""無人機分配對話框"""
def __init__(self, parent, all_drone_ids, current_assigned, other_assigned):
"""
Args:
parent: widget
all_drone_ids: 所有可用無人機 ID 列表
current_assigned: 當前群組已分配的無人機 set
other_assigned: 其他群組已佔用的無人機 dict {drone_id: group_id}
"""
super().__init__(parent)
self.setWindowTitle("分配無人機")
self.setMinimumWidth(280)
self.setStyleSheet("""
QDialog { background-color: #2B2B2B; }
QLabel { color: #DDD; }
QCheckBox { color: #DDD; spacing: 8px; padding: 4px; }
QCheckBox::indicator { width: 16px; height: 16px; }
QCheckBox:disabled { color: #666; }
""")
layout = QVBoxLayout(self)
title = QLabel("選擇要分配到此群組的無人機:")
title.setStyleSheet("font-size: 13px; font-weight: bold; padding-bottom: 6px;")
layout.addWidget(title)
# 滾動區域
scroll = QScrollArea()
scroll.setWidgetResizable(True)
scroll.setMaximumHeight(300)
scroll_widget = QWidget()
scroll_layout = QVBoxLayout(scroll_widget)
scroll_layout.setSpacing(2)
self.checkboxes = {}
sorted_ids = sorted(all_drone_ids, key=lambda x: (x.split('_')[0], int(x.split('_')[1])))
for drone_id in sorted_ids:
cb = QCheckBox(drone_id)
if drone_id in current_assigned:
cb.setChecked(True)
elif drone_id in other_assigned:
cb.setEnabled(False)
cb.setToolTip(f"已分配到 Group {other_assigned[drone_id]}")
cb.setText(f"{drone_id} (Group {other_assigned[drone_id]})")
self.checkboxes[drone_id] = cb
scroll_layout.addWidget(cb)
scroll_layout.addStretch()
scroll.setWidget(scroll_widget)
layout.addWidget(scroll)
# 按鈕
btn_layout = QHBoxLayout()
ok_btn = QPushButton("確定")
ok_btn.setStyleSheet("""
QPushButton { background-color: #4A9EFF; color: white; border: none;
padding: 8px 20px; border-radius: 4px; font-weight: bold; }
QPushButton:hover { background-color: #3A8EEF; }
""")
ok_btn.clicked.connect(self.accept)
cancel_btn = QPushButton("取消")
cancel_btn.setStyleSheet("""
QPushButton { background-color: #555; color: #DDD; border: none;
padding: 8px 20px; border-radius: 4px; }
QPushButton:hover { background-color: #666; }
""")
cancel_btn.clicked.connect(self.reject)
btn_layout.addStretch()
btn_layout.addWidget(cancel_btn)
btn_layout.addWidget(ok_btn)
layout.addLayout(btn_layout)
def get_selected(self):
"""回傳勾選的無人機 ID set"""
return {did for did, cb in self.checkboxes.items() if cb.isChecked() and cb.isEnabled()}
class GroupPanel(QWidget):
"""單一群組的 UI 面板(嵌入到 tab 中)— 三欄式佈局"""
# 信號
assign_drones_requested = pyqtSignal(str) # group_id
mission_type_changed = pyqtSignal(str, str) # group_id, mission_type
start_requested = pyqtSignal(str) # group_id
pause_requested = pyqtSignal(str) # group_id
stop_requested = pyqtSignal(str) # group_id
mode_change_requested = pyqtSignal(str, str) # group_id, mode
arm_requested = pyqtSignal(str) # group_id
takeoff_requested = pyqtSignal(str, float) # group_id, altitude
box_select_requested = pyqtSignal(str) # group_id — 框選直接分配
select_all_requested = pyqtSignal(str) # group_id — 全選直接分配
clear_group_requested = pyqtSignal(str) # group_id — 清除分組
add_group_requested = pyqtSignal() # 新增群組
delete_group_requested = pyqtSignal(str) # group_id — 刪除群組
BUTTON_STYLE = """
QPushButton {{ background-color: {bg}; color: {fg}; border: none;
padding: 5px 8px; border-radius: 4px; font-size: 11px; }}
QPushButton:hover {{ background-color: {hover}; }}
QPushButton:disabled {{ background-color: #444; color: #666; }}
"""
def __init__(self, group: MissionGroup, parent=None):
super().__init__(parent)
self.group = group
self._is_all_selected = False # 追蹤全選狀態
self.all_btn_ref = None # 保存全選按鈕的參考
self._build_ui()
def _make_sep(self):
"""建立垂直分隔線"""
sep = QFrame()
sep.setFrameShape(QFrame.Shape.VLine)
sep.setStyleSheet("color: #444;")
return sep
def _build_ui(self):
layout = QVBoxLayout(self)
layout.setContentsMargins(6, 4, 6, 4)
layout.setSpacing(0)
COMBO = ("QComboBox { background-color: #333; color: #DDD; "
"border-radius: 3px; padding: 2px 6px; font-size: 11px; }")
BTN = self.BUTTON_STYLE
LBL = "color: #AAA; font-size: 11px;"
TITLE = "color: #DDD; font-size: 11px; font-weight: bold; padding-bottom: 2px;"
# ── 三欄主佈局 ──
cols = QHBoxLayout()
cols.setSpacing(6)
# ============================
# 左欄:控制指令
# ============================
left = QVBoxLayout()
left.setSpacing(3)
left_title = QLabel("控制指令")
left_title.setStyleSheet(TITLE)
left.addWidget(left_title)
# 模式切換
mode_row = QHBoxLayout()
mode_row.setSpacing(3)
self.mode_combo = QComboBox()
self.mode_combo.addItems([
"GUIDED", "AUTO", "LAND", "LOITER",
"STABILIZE", "ALT_HOLD", "RTL", "POSHOLD", "SMART_RTL"
])
self.mode_combo.setStyleSheet(COMBO)
mode_btn = QPushButton("切換")
mode_btn.setStyleSheet(BTN.format(bg='#555', fg='#DDD', hover='#666'))
mode_btn.clicked.connect(
lambda: self.mode_change_requested.emit(
self.group.group_id, self.mode_combo.currentText()))
mode_row.addWidget(self.mode_combo, 1)
mode_row.addWidget(mode_btn)
left.addLayout(mode_row)
# 解鎖
arm_btn = QPushButton("解鎖")
arm_btn.setStyleSheet(BTN.format(bg='#555', fg='#DDD', hover='#666'))
arm_btn.clicked.connect(
lambda: self.arm_requested.emit(self.group.group_id))
left.addWidget(arm_btn)
# 起飛
takeoff_row = QHBoxLayout()
takeoff_row.setSpacing(3)
self.alt_input = QComboBox()
self.alt_input.setEditable(True)
self.alt_input.addItems(["5", "10", "15", "20"])
self.alt_input.setCurrentText("10")
self.alt_input.setStyleSheet(COMBO)
alt_lbl = QLabel("m")
alt_lbl.setStyleSheet(LBL)
takeoff_btn = QPushButton("起飛")
takeoff_btn.setStyleSheet(BTN.format(bg='#555', fg='#DDD', hover='#666'))
takeoff_btn.clicked.connect(self._on_takeoff)
takeoff_row.addWidget(self.alt_input, 1)
takeoff_row.addWidget(alt_lbl)
takeoff_row.addWidget(takeoff_btn)
left.addLayout(takeoff_row)
left.addStretch()
# ============================
# 中欄:任務規劃(左右分割)
# ============================
mid = QVBoxLayout()
mid.setSpacing(2)
mid_title = QLabel("任務規劃")
mid_title.setStyleSheet(TITLE)
mid.addWidget(mid_title)
mid_body = QHBoxLayout()
mid_body.setSpacing(4)
# 左側:類型 + 狀態 + 座標
mid_left = QVBoxLayout()
mid_left.setSpacing(2)
self.type_combo = QComboBox()
self.type_combo.addItems([
"M_FORMATION", "CIRCLE_FORMATION", "LEADER_FOLLOWER", "GRID_SWEEP"
])
self.type_combo.setStyleSheet(COMBO)
self.type_combo.currentTextChanged.connect(
lambda t: self.mission_type_changed.emit(self.group.group_id, t))
mid_left.addWidget(self.type_combo)
self.status_label = QLabel("○ 未規劃")
self.status_label.setStyleSheet("color: #888; font-size: 11px;")
mid_left.addWidget(self.status_label)
self.center_label = QLabel("中心: --")
self.center_label.setStyleSheet("color: #AAA; font-size: 11px;")
mid_left.addWidget(self.center_label)
self.target_label = QLabel("目標: --")
self.target_label.setStyleSheet("color: #AAA; font-size: 11px;")
mid_left.addWidget(self.target_label)
mid_left.addStretch()
# 右側:執行 / 暫停 / 停止(垂直排列)
mid_right = QVBoxLayout()
mid_right.setSpacing(3)
self.start_btn = QPushButton("▶ 執行")
self.start_btn.setStyleSheet(BTN.format(bg='#2E7D32', fg='white', hover='#388E3C'))
self.start_btn.clicked.connect(
lambda: self.start_requested.emit(self.group.group_id))
self.pause_btn = QPushButton("⏸ 暫停")
self.pause_btn.setStyleSheet(BTN.format(bg='#F57F17', fg='white', hover='#F9A825'))
self.pause_btn.clicked.connect(
lambda: self.pause_requested.emit(self.group.group_id))
self.stop_btn = QPushButton("■ 停止")
self.stop_btn.setStyleSheet(BTN.format(bg='#C62828', fg='white', hover='#D32F2F'))
self.stop_btn.clicked.connect(
lambda: self.stop_requested.emit(self.group.group_id))
mid_right.addWidget(self.start_btn)
mid_right.addWidget(self.pause_btn)
mid_right.addWidget(self.stop_btn)
mid_right.addStretch()
mid_body.addLayout(mid_left, 1)
mid_body.addLayout(mid_right)
mid.addLayout(mid_body)
# ============================
# 選取與分組3x2 按鈕)
# ============================
right = QVBoxLayout()
right.setSpacing(3)
right_title = QLabel("選取與分組")
right_title.setStyleSheet(TITLE)
right.addWidget(right_title)
self.drone_list_label = QLabel("尚未分配")
self.drone_list_label.setStyleSheet("color: #888; font-size: 11px;")
self.drone_list_label.setWordWrap(True)
right.addWidget(self.drone_list_label)
# 3x2 按鈕網格:第一行 框選 全選 新增群組
grid_r1 = QHBoxLayout()
grid_r1.setSpacing(3)
box_btn = QPushButton("框選")
box_btn.setStyleSheet(BTN.format(bg='#64B5F6', fg='white', hover='#42A5F5'))
box_btn.clicked.connect(
lambda: self.box_select_requested.emit(self.group.group_id))
all_btn = QPushButton("全選/取消")
all_btn.setStyleSheet(BTN.format(bg='#64B5F6', fg='white', hover='#42A5F5'))
all_btn.clicked.connect(self._on_all_select_clicked)
self.all_btn_ref = all_btn # 保存按鈕參考(備用)
add_group_btn = QPushButton("+ 新增群組")
add_group_btn.setStyleSheet(BTN.format(bg='#4A9EFF', fg='white', hover='#3A8EEF'))
add_group_btn.clicked.connect(lambda: self.add_group_requested.emit())
grid_r1.addWidget(box_btn)
grid_r1.addWidget(all_btn)
grid_r1.addWidget(add_group_btn)
right.addLayout(grid_r1)
# 第二行 編輯分配 清除分組 刪除群組
grid_r2 = QHBoxLayout()
grid_r2.setSpacing(3)
assign_btn = QPushButton("編輯分配")
assign_btn.setStyleSheet(BTN.format(bg='#555', fg='#DDD', hover='#666'))
assign_btn.clicked.connect(
lambda: self.assign_drones_requested.emit(self.group.group_id))
clear_btn = QPushButton("清除分組")
clear_btn.setStyleSheet(BTN.format(bg='#777', fg='white', hover='#888'))
clear_btn.clicked.connect(
lambda: self.clear_group_requested.emit(self.group.group_id))
delete_group_btn = QPushButton("刪除群組")
delete_group_btn.setStyleSheet(BTN.format(bg='#EF5350', fg='white', hover='#E53935'))
delete_group_btn.clicked.connect(
lambda: self.delete_group_requested.emit(self.group.group_id))
grid_r2.addWidget(assign_btn)
grid_r2.addWidget(clear_btn)
grid_r2.addWidget(delete_group_btn)
right.addLayout(grid_r2)
right.addStretch()
# ============================
# 第四欄:任務參數
# ============================
param_col = QVBoxLayout()
param_col.setSpacing(2)
param_title = QLabel("任務參數")
param_title.setStyleSheet(TITLE)
param_col.addWidget(param_title)
INPUT = ("QLineEdit { background-color: #333; color: #DDD; "
"border: 1px solid #555; border-radius: 3px; "
"padding: 1px 4px; font-size: 11px; }")
# 每種任務類型的參數定義: (key, label, default_value)
self._param_defs = {
'M_FORMATION': [
('spacing', '間距 (m)', '5.0'),
('base_altitude', '基準高度 (m)', '10.0'),
('altitude_diff', '高低差 (m)', '2.0'),
],
'CIRCLE_FORMATION': [
('radius', '半徑 (m)', '10.0'),
('altitude', '高度 (m)', '10.0'),
('start_angle', '起始角 (°)', '0'),
],
'LEADER_FOLLOWER': [
('lateral_offset', '橫向偏移 (m)', '3.0'),
('longitudinal_spacing', '縱向間距 (m)', '5.0'),
('altitude', '高度 (m)', '10.0'),
],
'GRID_SWEEP': [
('line_spacing', '掃描線距 (m)', '5.0'),
('altitude', '高度 (m)', '10.0'),
],
}
# 建立所有參數列的 widget先全部建好切換時顯示/隱藏)
self._param_widgets = {} # key → (label_widget, input_widget)
self._param_rows = [] # 所有 row layout 對應的 container widget
for mission_type, defs in self._param_defs.items():
for key, label_text, default in defs:
if key in self._param_widgets:
continue # 同名參數只建一次
row_w = QWidget()
row_l = QHBoxLayout(row_w)
row_l.setContentsMargins(0, 0, 0, 0)
row_l.setSpacing(3)
lbl = QLabel(label_text)
lbl.setStyleSheet(LBL)
inp = QLineEdit(default)
inp.setStyleSheet(INPUT)
inp.setFixedWidth(50)
row_l.addWidget(lbl, 1)
row_l.addWidget(inp)
param_col.addWidget(row_w)
self._param_widgets[key] = (row_w, inp)
self._param_rows.append(row_w)
param_col.addStretch()
# 初始顯示對應的參數
self._update_param_visibility()
# 當任務類型切換時更新參數顯示
self.type_combo.currentTextChanged.connect(self._update_param_visibility)
# ── 組裝四欄:控制指令 > 任務規劃 > 任務參數 > 選取與分組 ──
# 使用伸展因子 0 讓列根據內容自動調整寬度,而不是均等分配
cols.addLayout(left, 0)
cols.addWidget(self._make_sep())
cols.addLayout(mid, 0)
cols.addWidget(self._make_sep())
cols.addLayout(param_col, 0)
cols.addWidget(self._make_sep())
cols.addLayout(right, 0)
cols.addStretch() # 填充剩餘空間,使四列置左
layout.addLayout(cols)
def update_drone_list(self):
"""更新無人機列表顯示"""
if not self.group.drone_ids:
self.drone_list_label.setText("尚未分配")
self.drone_list_label.setStyleSheet("color: #888; font-size: 11px;")
else:
sorted_ids = sorted(self.group.drone_ids,
key=lambda x: (x.split('_')[0], int(x.split('_')[1])))
self.drone_list_label.setText("".join(sorted_ids))
self.drone_list_label.setStyleSheet(
f"color: {self.group.color}; font-size: 11px; font-weight: bold;")
def update_status(self):
"""更新任務狀態顯示"""
state = self.group.state
if self.group.planned_waypoints is None:
self.status_label.setText("○ 未規劃")
self.status_label.setStyleSheet("color: #888; font-size: 11px;")
elif state == MissionState.RUNNING:
self.status_label.setText("▶ 執行中")
self.status_label.setStyleSheet("color: #4CAF50; font-size: 11px; font-weight: bold;")
elif state == MissionState.PAUSED:
self.status_label.setText("⏸ 已暫停")
self.status_label.setStyleSheet("color: #FFA000; font-size: 11px; font-weight: bold;")
else:
n = len(self.group.drone_ids)
total_wps = sum(len(wps) for wps in self.group.planned_waypoints['waypoints'])
self.status_label.setText(f"● 已規劃 ({n}架/{total_wps}點)")
self.status_label.setStyleSheet(
f"color: {self.group.color}; font-size: 11px; font-weight: bold;")
def _on_all_select_clicked(self):
"""全選按鈕點擊 - 發送信號給 gui.py 處理 toggle 邏輯"""
self.select_all_requested.emit(self.group.group_id)
def set_all_select_state(self, is_selected):
"""外部設置全選狀態(按鈕文本保持「全選/取消」)"""
self._is_all_selected = is_selected
def _update_param_visibility(self, _=None):
"""根據當前任務類型,顯示/隱藏對應的參數列"""
mission_type = self.type_combo.currentText()
visible_keys = {d[0] for d in self._param_defs.get(mission_type, [])}
for key, (row_w, _inp) in self._param_widgets.items():
row_w.setVisible(key in visible_keys)
def get_mission_params(self):
"""讀取當前顯示的參數值,回傳 dict"""
mission_type = self.type_combo.currentText()
params = {}
for key, _label, default in self._param_defs.get(mission_type, []):
if key in self._param_widgets:
_row_w, inp = self._param_widgets[key]
try:
params[key] = float(inp.text())
except ValueError:
params[key] = float(default)
return params
def update_mission_info(self, center_lat, center_lon, target_lat, target_lon):
"""更新中心點 / 目標點顯示"""
info_style = f"color: {self.group.color}; font-size: 11px; font-weight: bold;"
self.center_label.setText(f"中心: {center_lat:.6f}°, {center_lon:.6f}°")
self.center_label.setStyleSheet(info_style)
self.target_label.setText(f"目標: {target_lat:.6f}°, {target_lon:.6f}°")
self.target_label.setStyleSheet(info_style)
def clear_mission_info(self):
"""清除中心點 / 目標點顯示"""
self.center_label.setText("中心: --")
self.center_label.setStyleSheet("color: #AAA; font-size: 11px;")
self.target_label.setText("目標: --")
self.target_label.setStyleSheet("color: #AAA; font-size: 11px;")
def _on_takeoff(self):
try:
alt = float(self.alt_input.currentText())
except ValueError:
alt = 10.0
self.takeoff_requested.emit(self.group.group_id, alt)

@ -6,7 +6,7 @@ class OverviewTable(QTableWidget):
"""總覽表格,顯示所有無人機的狀態資訊"""
# 默認的資訊類型和映射
DEFAULT_INFO_TYPES = ["模式", "ARM", "電壓", "經度", "緯度", "高度", "位置", "速度", "地速", "航向",
DEFAULT_INFO_TYPES = ["模式", "ARM", "電壓", "經度", "緯度", "高度", "XY位置", "XY速度", "地速", "航向",
"空速", "油門", "HUD ALT", "爬升率", "Roll", "Pitch", "Yaw", "丟包", "延遲"]
DEFAULT_INFO_TYPE_MAP = {

File diff suppressed because it is too large Load Diff

@ -0,0 +1,208 @@
cmake_minimum_required(VERSION 3.5)
project(mavros_msgs)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# we dont use add_compile_options with pedantic in message packages
# because the Python C extensions dont comply with it
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rcl_interfaces REQUIRED)
find_package(geographic_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
# include_directories(include)
# [[[cog:
# import mavros_cog
# ]]]
# [[[end]]] (checksum: d41d8cd98f00b204e9800998ecf8427e)
set(msg_files
# [[[cog:
# mavros_cog.outl_glob_files('msg', '*.msg')
# ]]]
msg/ADSBVehicle.msg
msg/ActuatorControl.msg
msg/Altitude.msg
msg/AttitudeTarget.msg
msg/CamIMUStamp.msg
msg/CameraImageCaptured.msg
msg/CellularStatus.msg
msg/CommandCode.msg
msg/CompanionProcessStatus.msg
msg/DebugValue.msg
msg/ESCInfo.msg
msg/ESCInfoItem.msg
msg/ESCStatus.msg
msg/ESCStatusItem.msg
msg/ESCTelemetry.msg
msg/ESCTelemetryItem.msg
msg/EstimatorStatus.msg
msg/ExtendedState.msg
msg/FileEntry.msg
msg/GPSINPUT.msg
msg/GPSRAW.msg
msg/GPSRTK.msg
msg/GimbalDeviceAttitudeStatus.msg
msg/GimbalDeviceInformation.msg
msg/GimbalDeviceSetAttitude.msg
msg/GimbalManagerInformation.msg
msg/GimbalManagerSetAttitude.msg
msg/GimbalManagerSetPitchyaw.msg
msg/GimbalManagerStatus.msg
msg/GlobalPositionTarget.msg
msg/HilActuatorControls.msg
msg/HilControls.msg
msg/HilGPS.msg
msg/HilSensor.msg
msg/HilStateQuaternion.msg
msg/HomePosition.msg
msg/LandingTarget.msg
msg/LogData.msg
msg/LogEntry.msg
msg/MagnetometerReporter.msg
msg/ManualControl.msg
msg/Mavlink.msg
msg/MountControl.msg
msg/NavControllerOutput.msg
msg/OnboardComputerStatus.msg
msg/OpticalFlow.msg
msg/OpticalFlowRad.msg
msg/OverrideRCIn.msg
msg/Param.msg
msg/ParamEvent.msg
msg/ParamValue.msg
msg/PlayTuneV2.msg
msg/PositionTarget.msg
msg/RCIn.msg
msg/RCOut.msg
msg/RTCM.msg
msg/RTKBaseline.msg
msg/RadioStatus.msg
msg/State.msg
msg/StatusEvent.msg
msg/StatusText.msg
msg/SysStatus.msg
msg/TerrainReport.msg
msg/Thrust.msg
msg/TimesyncStatus.msg
msg/Trajectory.msg
msg/Tunnel.msg
msg/VehicleInfo.msg
msg/VfrHud.msg
msg/Vibration.msg
msg/Waypoint.msg
msg/WaypointList.msg
msg/WaypointReached.msg
msg/WheelOdomStamped.msg
# [[[end]]] (checksum: a8e24eb0a6da5cea6cc049fdc6b2612e)
)
set(srv_files
# [[[cog:
# mavros_cog.outl_glob_files('srv', '*.srv')
# ]]]
srv/CommandAck.srv
srv/CommandBool.srv
srv/CommandHome.srv
srv/CommandInt.srv
srv/CommandLong.srv
srv/CommandTOL.srv
srv/CommandTOLLocal.srv
srv/CommandTriggerControl.srv
srv/CommandTriggerInterval.srv
srv/CommandVtolTransition.srv
srv/EndpointAdd.srv
srv/EndpointDel.srv
srv/FileChecksum.srv
srv/FileClose.srv
srv/FileList.srv
srv/FileMakeDir.srv
srv/FileOpen.srv
srv/FileRead.srv
srv/FileRemove.srv
srv/FileRemoveDir.srv
srv/FileRename.srv
srv/FileTruncate.srv
srv/FileWrite.srv
srv/GimbalGetInformation.srv
srv/GimbalManagerCameraTrack.srv
srv/GimbalManagerConfigure.srv
srv/GimbalManagerPitchyaw.srv
srv/GimbalManagerSetRoi.srv
srv/LogRequestData.srv
srv/LogRequestEnd.srv
srv/LogRequestList.srv
srv/MessageInterval.srv
srv/MountConfigure.srv
srv/ParamGet.srv
srv/ParamPull.srv
srv/ParamPush.srv
srv/ParamSet.srv
srv/ParamSetV2.srv
srv/SetMavFrame.srv
srv/SetMode.srv
srv/StreamRate.srv
srv/VehicleInfoGet.srv
srv/WaypointClear.srv
srv/WaypointPull.srv
srv/WaypointPush.srv
srv/WaypointSetCurrent.srv
# [[[end]]] (checksum: cd7701b28a3176d96ef65cb1f2157917)
)
rosidl_generate_interfaces(${PROJECT_NAME}
${msg_files}
${srv_files}
DEPENDENCIES
builtin_interfaces
rcl_interfaces
geographic_msgs
geometry_msgs
sensor_msgs
std_msgs
)
ament_export_dependencies(rosidl_default_runtime)
install(
FILES mavros_msgs_mapping_rule.yaml
DESTINATION share/${PROJECT_NAME}
)
if(rcl_interfaces_VERSION VERSION_LESS "1.2.0")
install(
DIRECTORY include/
DESTINATION include
FILES_MATCHING PATTERN "*.hpp"
)
else()
# NOTE(vooon): Humble
install(
DIRECTORY include/
DESTINATION include/mavros_msgs
FILES_MATCHING PATTERN "*.hpp"
)
endif()
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# NOTE(vooon): Does not support our custom triple-license, tiered to make it to work.
list(APPEND AMENT_LINT_AUTO_EXCLUDE ament_cmake_copyright)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()
# vim: ts=2 sw=2 et:

@ -0,0 +1,145 @@
//
// Copyright 2015,2016,2021 Vladimir Ermakov.
//
// This file is part of the mavros package and subject to the license terms
// in the top-level LICENSE file of the mavros repository.
// https://github.com/mavlink/mavros/tree/master/LICENSE.md
//
/**
* @brief Mavlink convert utils
* @file
* @author Vladimir Ermakov <vooon341@gmail.com>
*/
#pragma once
#ifndef MAVROS_MSGS__MAVLINK_CONVERT_HPP_
#define MAVROS_MSGS__MAVLINK_CONVERT_HPP_
#include <mavconn/mavlink_dialect.hpp>
#include <mavros_msgs/msg/mavlink.hpp>
#include <algorithm>
namespace mavros_msgs
{
namespace mavlink
{
using ::mavlink::mavlink_message_t;
using mavros_msgs::msg::Mavlink;
// [[[cog:
// FIELD_NAMES = [
// "magic",
// "len",
// "incompat_flags",
// "compat_flags",
// "seq",
// "sysid",
// "compid",
// "msgid",
// "checksum",
// ]
// ]]]
// [[[end]]] (checksum: d41d8cd98f00b204e9800998ecf8427e)
// NOTE(vooon): Ignore impossible warning as
// memcpy() should work with unaligned pointers without any trouble.
//
// warning: taking address of packed member of mavlink::__mavlink_message
// may result in an unaligned pointer value
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
/**
* @brief Convert mavros_msgs/Mavlink message to mavlink_message_t
*
* @note signature vector should be empty for unsigned OR
* MAVLINK_SIGNATURE_BLOCK size for signed messages
*
* @param[in] rmsg mavros_msgs/Mavlink message
* @param[out] mmsg mavlink_message_t struct
* @return true if success
*/
inline bool convert(const Mavlink & rmsg, mavlink_message_t & mmsg)
{
if (rmsg.payload64.size() > sizeof(mmsg.payload64) / sizeof(mmsg.payload64[0])) {
return false;
}
if (!rmsg.signature.empty() && rmsg.signature.size() != sizeof(mmsg.signature)) {
return false;
}
// [[[cog:
// for f in FIELD_NAMES:
// cog.outl(f"mmsg.{f} = rmsg.{f};")
// ]]]
mmsg.magic = rmsg.magic;
mmsg.len = rmsg.len;
mmsg.incompat_flags = rmsg.incompat_flags;
mmsg.compat_flags = rmsg.compat_flags;
mmsg.seq = rmsg.seq;
mmsg.sysid = rmsg.sysid;
mmsg.compid = rmsg.compid;
mmsg.msgid = rmsg.msgid;
mmsg.checksum = rmsg.checksum;
// [[[end]]] (checksum: 0b66f0fc1cd46db0f18a2429c56a6b8c)
std::copy(rmsg.payload64.begin(), rmsg.payload64.end(), mmsg.payload64);
std::copy(rmsg.signature.begin(), rmsg.signature.end(), mmsg.signature);
return true;
}
/**
* @brief Convert mavlink_message_t to mavros/Mavlink
*
* @param[in] mmsg mavlink_message_t struct
* @param[out] rmsg mavros_msgs/Mavlink message
* @param[in] framing_status framing parse result (OK, BAD_CRC or BAD_SIGNATURE)
* @return true, this convertion can't fail
*/
inline bool convert(
const mavlink_message_t & mmsg, Mavlink & rmsg,
uint8_t framing_status = Mavlink::FRAMING_OK)
{
const size_t payload64_len = (mmsg.len + 7) / 8;
rmsg.framing_status = framing_status;
// [[[cog:
// for f in FIELD_NAMES:
// cog.outl(f"rmsg.{f} = mmsg.{f};")
// ]]]
rmsg.magic = mmsg.magic;
rmsg.len = mmsg.len;
rmsg.incompat_flags = mmsg.incompat_flags;
rmsg.compat_flags = mmsg.compat_flags;
rmsg.seq = mmsg.seq;
rmsg.sysid = mmsg.sysid;
rmsg.compid = mmsg.compid;
rmsg.msgid = mmsg.msgid;
rmsg.checksum = mmsg.checksum;
// [[[end]]] (checksum: 64ef6c1af60c622ed427e005d8ca4f2a)
rmsg.payload64.assign(
mmsg.payload64,
mmsg.payload64 + payload64_len);
// copy signature block only if message is signed
if (mmsg.incompat_flags & MAVLINK_IFLAG_SIGNED) {
rmsg.signature.assign(
mmsg.signature,
mmsg.signature + sizeof(mmsg.signature));
} else {
rmsg.signature.clear();
}
return true;
}
#pragma GCC diagnostic pop
} // namespace mavlink
} // namespace mavros_msgs
#endif // MAVROS_MSGS__MAVLINK_CONVERT_HPP_

@ -0,0 +1,8 @@
# This file defines mappings between ROS 1 and ROS 2 interfaces.
# It is used with the ros1_bridge to allow for communcation between ROS 1 and ROS 2.
-
ros1_package_name: 'mavros_msgs'
ros1_message_name: 'VFR_HUD'
ros2_package_name: 'mavros_msgs'
ros2_message_name: 'VfrHud'

@ -0,0 +1,66 @@
# The location and information of an ADSB vehicle
#
# https://mavlink.io/en/messages/common.html#ADSB_VEHICLE
# [[[cog:
# import mavros_cog
# mavros_cog.idl_decl_enum('ADSB_ALTITUDE_TYPE', 'ALT_')
# mavros_cog.idl_decl_enum('ADSB_EMITTER_TYPE', 'EMITTER_')
# mavros_cog.idl_decl_enum('ADSB_FLAGS', 'FLAG_', 16)
# ]]]
# ADSB_ALTITUDE_TYPE
uint8 ALT_PRESSURE_QNH = 0 # Altitude reported from a Baro source using QNH reference
uint8 ALT_GEOMETRIC = 1 # Altitude reported from a GNSS source
# ADSB_EMITTER_TYPE
uint8 EMITTER_NO_INFO = 0
uint8 EMITTER_LIGHT = 1
uint8 EMITTER_SMALL = 2
uint8 EMITTER_LARGE = 3
uint8 EMITTER_HIGH_VORTEX_LARGE = 4
uint8 EMITTER_HEAVY = 5
uint8 EMITTER_HIGHLY_MANUV = 6
uint8 EMITTER_ROTOCRAFT = 7
uint8 EMITTER_UNASSIGNED = 8
uint8 EMITTER_GLIDER = 9
uint8 EMITTER_LIGHTER_AIR = 10
uint8 EMITTER_PARACHUTE = 11
uint8 EMITTER_ULTRA_LIGHT = 12
uint8 EMITTER_UNASSIGNED2 = 13
uint8 EMITTER_UAV = 14
uint8 EMITTER_SPACE = 15
uint8 EMITTER_UNASSGINED3 = 16
uint8 EMITTER_EMERGENCY_SURFACE = 17
uint8 EMITTER_SERVICE_SURFACE = 18
uint8 EMITTER_POINT_OBSTACLE = 19
# ADSB_FLAGS
uint16 FLAG_VALID_COORDS = 1
uint16 FLAG_VALID_ALTITUDE = 2
uint16 FLAG_VALID_HEADING = 4
uint16 FLAG_VALID_VELOCITY = 8
uint16 FLAG_VALID_CALLSIGN = 16
uint16 FLAG_VALID_SQUAWK = 32
uint16 FLAG_SIMULATED = 64
uint16 FLAG_VERTICAL_VELOCITY_VALID = 128
uint16 FLAG_BARO_VALID = 256
uint16 FLAG_SOURCE_UAT = 32768
# [[[end]]] (checksum: a34f2a081739921b6e3e443ed0516d8d)
std_msgs/Header header
uint32 icao_address
string callsign
float64 latitude
float64 longitude
float32 altitude # AMSL
float32 heading # deg [0..360)
float32 hor_velocity # m/s
float32 ver_velocity # m/s
uint8 altitude_type # Type from ADSB_ALTITUDE_TYPE enum
uint8 emitter_type # Type from ADSB_EMITTER_TYPE enum
builtin_interfaces/Duration tslc # Duration from last communication, seconds [0..255]
uint16 flags # ADSB_FLAGS bit field
uint16 squawk # Squawk code

@ -0,0 +1,16 @@
# raw servo values for direct actuator controls
#
# about groups, mixing and channels:
# https://pixhawk.org/dev/mixing
# constant for mixer group
uint8 PX4_MIX_FLIGHT_CONTROL = 0
uint8 PX4_MIX_FLIGHT_CONTROL_VTOL_ALT = 1
uint8 PX4_MIX_PAYLOAD = 2
uint8 PX4_MIX_MANUAL_PASSTHROUGH = 3
#uint8 PX4_MIX_FC_MC_VIRT = 4
#uint8 PX4_MIX_FC_FW_VIRT = 5
std_msgs/Header header
uint8 group_mix
float32[8] controls

@ -0,0 +1,12 @@
# Altitude information
#
# https://mavlink.io/en/messages/common.html#ALTITUDE
std_msgs/Header header
float32 monotonic
float32 amsl
float32 local
float32 relative
float32 terrain
float32 bottom_clearance

@ -0,0 +1,17 @@
# Message for SET_ATTITUDE_TARGET
#
# Some complex system requires all feautures that mavlink
# message provide. See issue #402, #418.
std_msgs/Header header
uint8 type_mask
uint8 IGNORE_ROLL_RATE = 1 # body_rate.x
uint8 IGNORE_PITCH_RATE = 2 # body_rate.y
uint8 IGNORE_YAW_RATE = 4 # body_rate.z
uint8 IGNORE_THRUST = 64
uint8 IGNORE_ATTITUDE = 128 # orientation field
geometry_msgs/Quaternion orientation
geometry_msgs/Vector3 body_rate
float32 thrust

@ -0,0 +1,4 @@
# IMU-Camera synchronisation data
builtin_interfaces/Time frame_stamp # Timestamp when the camera was triggered
int32 frame_seq_id # Sequence number of the image frame

@ -0,0 +1,11 @@
# MAVLink message: CAMERA_IMAGE_CAPTURED
# https://mavlink.io/en/messages/common.html#CAMERA_IMAGE_CAPTURED
std_msgs/Header header
geometry_msgs/Quaternion orientation # Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
geographic_msgs/GeoPoint geo
float32 relative_alt # mm Altitude above ground
int32 image_index # Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
int8 capture_result # Boolean indicating success (1) or failure (0) while capturing this image.
string file_url #URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.

@ -0,0 +1,9 @@
#Follows https://mavlink.io/en/messages/common.html#CELLULAR_STATUS specification
uint8 status
uint8 failure_reason
uint8 type
uint8 quality
uint16 mcc
uint16 mnc
uint16 lac

@ -0,0 +1,200 @@
# MAV_CMD command codes.
# Actual meaning and params you may find in MAVLink documentation
# https://mavlink.io/en/messages/common.html#MAV_CMD
# [[[cog:
# import mavros_cog
# mavros_cog.idl_decl_enum_mav_cmd()
# ]]]
# MAV_CMD_AIRFRAME
uint16 AIRFRAME_CONFIGURATION = 2520
# MAV_CMD_ARM
uint16 ARM_AUTHORIZATION_REQUEST = 3001 # Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. If approved the progress of command_ack message should be set with period of time that this authorization is valid in seconds or in case it was denied it should be set with one of the reasons in ARM_AUTH_DENIED_REASON.
# MAV_CMD_CAMERA
uint16 CAMERA_TRACK_POINT = 2004 # If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking.
uint16 CAMERA_TRACK_RECTANGLE = 2005 # If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking.
uint16 CAMERA_STOP_TRACKING = 2010 # Stops ongoing tracking.
# MAV_CMD_CAN
uint16 CAN_FORWARD = 32000 # Request forwarding of CAN packets from the given CAN bus to this interface. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages
# MAV_CMD_COMPONENT
uint16 COMPONENT_ARM_DISARM = 400 # Arms / Disarms a component
# MAV_CMD_CONDITION
uint16 CONDITION_DELAY = 112 # Delay mission state machine.
uint16 CONDITION_CHANGE_ALT = 113 # Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached.
uint16 CONDITION_DISTANCE = 114 # Delay mission state machine until within desired distance of next NAV point.
uint16 CONDITION_YAW = 115 # Reach a certain target angle.
uint16 CONDITION_LAST = 159 # NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration
# MAV_CMD_CONTROL
uint16 CONTROL_HIGH_LATENCY = 2600 # Request to start/stop transmitting over the high latency telemetry
# MAV_CMD_DO
uint16 DO_FOLLOW = 32 # Begin following a target
uint16 DO_FOLLOW_REPOSITION = 33 # Reposition the MAV after a follow target command has been sent
uint16 DO_SET_MODE = 176 # Set system mode.
uint16 DO_JUMP = 177 # Jump to the desired command in the mission list. Repeat this action only the specified number of times
uint16 DO_CHANGE_SPEED = 178 # Change speed and/or throttle set points
uint16 DO_SET_HOME = 179 # Changes the home location either to the current location or a specified location.
uint16 DO_SET_PARAMETER = 180 # Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter.
uint16 DO_SET_RELAY = 181 # Set a relay to a condition.
uint16 DO_REPEAT_RELAY = 182 # Cycle a relay on and off for a desired number of cycles with a desired period.
uint16 DO_SET_SERVO = 183 # Set a servo to a desired PWM value.
uint16 DO_REPEAT_SERVO = 184 # Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period.
uint16 DO_FLIGHTTERMINATION = 185 # Terminate flight immediately
uint16 DO_CHANGE_ALTITUDE = 186 # Change altitude set point.
uint16 DO_LAND_START = 189 # Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude/Altitude is optional, and may be set to 0 if not needed. If specified then it will be used to help find the closest landing sequence.
uint16 DO_RALLY_LAND = 190 # Mission command to perform a landing from a rally point.
uint16 DO_GO_AROUND = 191 # Mission command to safely abort an autonomous landing.
uint16 DO_REPOSITION = 192 # Reposition the vehicle to a specific WGS84 global position.
uint16 DO_PAUSE_CONTINUE = 193 # If in a GPS controlled position mode, hold the current position or continue.
uint16 DO_SET_REVERSE = 194 # Set moving direction to forward or reverse.
uint16 DO_SET_ROI_LOCATION = 195 # Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras.
uint16 DO_SET_ROI_WPNEXT_OFFSET = 196 # Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras.
uint16 DO_SET_ROI_NONE = 197 # Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras.
uint16 DO_SET_ROI_SYSID = 198 # Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means.
uint16 DO_CONTROL_VIDEO = 200 # Control onboard camera system.
uint16 DO_SET_ROI = 201 # Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras.
uint16 DO_DIGICAM_CONFIGURE = 202 # Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ).
uint16 DO_DIGICAM_CONTROL = 203 # Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ).
uint16 DO_MOUNT_CONFIGURE = 204 # Mission command to configure a camera or antenna mount
uint16 DO_MOUNT_CONTROL = 205 # Mission command to control a camera or antenna mount
uint16 DO_SET_CAM_TRIGG_DIST = 206 # Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera.
uint16 DO_FENCE_ENABLE = 207 # Mission command to enable the geofence
uint16 DO_PARACHUTE = 208 # Mission item/command to release a parachute or enable/disable auto release.
uint16 DO_MOTOR_TEST = 209 # Mission command to perform motor test.
uint16 DO_INVERTED_FLIGHT = 210 # Change to/from inverted flight.
uint16 DO_GRIPPER = 211 # Mission command to operate a gripper.
uint16 DO_AUTOTUNE_ENABLE = 212 # Enable/disable autotune.
uint16 DO_SET_CAM_TRIGG_INTERVAL = 214 # Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera.
uint16 DO_MOUNT_CONTROL_QUAT = 220 # Mission command to control a camera or antenna mount, using a quaternion as reference.
uint16 DO_GUIDED_MASTER = 221 # set id of master controller
uint16 DO_GUIDED_LIMITS = 222 # Set limits for external control
uint16 DO_ENGINE_CONTROL = 223 # Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines
uint16 DO_SET_MISSION_CURRENT = 224 # Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between).
uint16 DO_LAST = 240 # NOP - This command is only used to mark the upper limit of the DO commands in the enumeration
uint16 DO_JUMP_TAG = 601 # Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number.
uint16 DO_GIMBAL_MANAGER_PITCHYAW = 1000 # Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate.
uint16 DO_GIMBAL_MANAGER_CONFIGURE = 1001 # Gimbal configuration to set which sysid/compid is in primary and secondary control.
uint16 DO_TRIGGER_CONTROL = 2003 # Enable or disable on-board camera triggering system.
uint16 DO_VTOL_TRANSITION = 3000 # Request VTOL transition
uint16 DO_ADSB_OUT_IDENT = 10001 # Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec.
uint16 DO_WINCH = 42600 # Command to operate winch.
# MAV_CMD_FIXED
uint16 FIXED_MAG_CAL_YAW = 42006 # Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location.
# MAV_CMD_GET
uint16 GET_HOME_POSITION = 410 # Request the home position from the vehicle.
uint16 GET_MESSAGE_INTERVAL = 510 # Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message.
# MAV_CMD_IMAGE
uint16 IMAGE_START_CAPTURE = 2000 # Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels.
uint16 IMAGE_STOP_CAPTURE = 2001 # Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels.
# MAV_CMD_JUMP
uint16 JUMP_TAG = 600 # Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG.
# MAV_CMD_LOGGING
uint16 LOGGING_START = 2510 # Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)
uint16 LOGGING_STOP = 2511 # Request to stop streaming log data over MAVLink
# MAV_CMD_MISSION
uint16 MISSION_START = 300 # start running a mission
# MAV_CMD_NAV
uint16 NAV_WAYPOINT = 16 # Navigate to waypoint.
uint16 NAV_LOITER_UNLIM = 17 # Loiter around this waypoint an unlimited amount of time
uint16 NAV_LOITER_TURNS = 18 # Loiter around this waypoint for X turns
uint16 NAV_LOITER_TIME = 19 # Loiter around this waypoint for X seconds
uint16 NAV_RETURN_TO_LAUNCH = 20 # Return to launch location
uint16 NAV_LAND = 21 # Land at location.
uint16 NAV_TAKEOFF = 22 # Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode.
uint16 NAV_LAND_LOCAL = 23 # Land at local position (local frame only)
uint16 NAV_TAKEOFF_LOCAL = 24 # Takeoff from local position (local frame only)
uint16 NAV_FOLLOW = 25 # Vehicle following, i.e. this waypoint represents the position of a moving vehicle
uint16 NAV_CONTINUE_AND_CHANGE_ALT = 30 # Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached.
uint16 NAV_LOITER_TO_ALT = 31 # Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint.
uint16 NAV_ROI = 80 # Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras.
uint16 NAV_PATHPLANNING = 81 # Control autonomous path planning on the MAV.
uint16 NAV_SPLINE_WAYPOINT = 82 # Navigate to waypoint using a spline path.
uint16 NAV_VTOL_TAKEOFF = 84 # Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.).
uint16 NAV_VTOL_LAND = 85 # Land using VTOL mode
uint16 NAV_GUIDED_ENABLE = 92 # hand control over to an external controller
uint16 NAV_DELAY = 93 # Delay the next navigation command a number of seconds or until a specified time
uint16 NAV_PAYLOAD_PLACE = 94 # Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload.
uint16 NAV_LAST = 95 # NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration
uint16 NAV_SET_YAW_SPEED = 213 # Sets a desired vehicle turn angle and speed change.
uint16 NAV_FENCE_RETURN_POINT = 5000 # Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead.
uint16 NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001 # Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required.
uint16 NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002 # Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required.
uint16 NAV_FENCE_CIRCLE_INCLUSION = 5003 # Circular fence area. The vehicle must stay inside this area.
uint16 NAV_FENCE_CIRCLE_EXCLUSION = 5004 # Circular fence area. The vehicle must stay outside this area.
uint16 NAV_RALLY_POINT = 5100 # Rally point. You can have multiple rally points defined.
# MAV_CMD_OBLIQUE
uint16 OBLIQUE_SURVEY = 260 # Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera.
# MAV_CMD_OVERRIDE
uint16 OVERRIDE_GOTO = 252 # Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position.
# MAV_CMD_PANORAMA
uint16 PANORAMA_CREATE = 2800 # Create a panorama at the current position
# MAV_CMD_PAYLOAD
uint16 PAYLOAD_PREPARE_DEPLOY = 30001 # Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity.
uint16 PAYLOAD_CONTROL_DEPLOY = 30002 # Control the payload deployment.
# MAV_CMD_PREFLIGHT
uint16 PREFLIGHT_CALIBRATION = 241 # Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero.
uint16 PREFLIGHT_SET_SENSOR_OFFSETS = 242 # Set sensor offsets. This command will be only accepted if in pre-flight mode.
uint16 PREFLIGHT_UAVCAN = 243 # Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named).
uint16 PREFLIGHT_STORAGE = 245 # Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode.
uint16 PREFLIGHT_REBOOT_SHUTDOWN = 246 # Request the reboot or shutdown of system components.
# MAV_CMD_REQUEST
uint16 REQUEST_MESSAGE = 512 # Request the target system(s) emit a single instance of a specified message (i.e. a "one-shot" version of MAV_CMD_SET_MESSAGE_INTERVAL).
uint16 REQUEST_PROTOCOL_VERSION = 519 # Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message
uint16 REQUEST_AUTOPILOT_CAPABILITIES = 520 # Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message
uint16 REQUEST_CAMERA_INFORMATION = 521 # Request camera information (CAMERA_INFORMATION).
uint16 REQUEST_CAMERA_SETTINGS = 522 # Request camera settings (CAMERA_SETTINGS).
uint16 REQUEST_STORAGE_INFORMATION = 525 # Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage.
uint16 REQUEST_CAMERA_CAPTURE_STATUS = 527 # Request camera capture status (CAMERA_CAPTURE_STATUS)
uint16 REQUEST_FLIGHT_INFORMATION = 528 # Request flight information (FLIGHT_INFORMATION)
uint16 REQUEST_VIDEO_STREAM_INFORMATION = 2504 # Request video stream information (VIDEO_STREAM_INFORMATION)
uint16 REQUEST_VIDEO_STREAM_STATUS = 2505 # Request video stream status (VIDEO_STREAM_STATUS)
# MAV_CMD_RESET
uint16 RESET_CAMERA_SETTINGS = 529 # Reset all camera settings to Factory Default
# MAV_CMD_RUN
uint16 RUN_PREARM_CHECKS = 401 # Instructs system to run pre-arm checks. This command should return MAV_RESULT_TEMPORARILY_REJECTED in the case the system is armed, otherwse MAV_RESULT_ACCEPTED. Note that the return value from executing this command does not indicate whether the vehicle is armable or not, just whether the system has successfully run/is currently running the checks. The result of the checks is reflected in the SYS_STATUS message.
# MAV_CMD_SET
uint16 SET_MESSAGE_INTERVAL = 511 # Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM.
uint16 SET_CAMERA_MODE = 530 # Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming.
uint16 SET_CAMERA_ZOOM = 531 # Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success).
uint16 SET_CAMERA_FOCUS = 532 # Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success).
uint16 SET_GUIDED_SUBMODE_STANDARD = 4000 # This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes.
uint16 SET_GUIDED_SUBMODE_CIRCLE = 4001 # This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position.
# MAV_CMD_START
uint16 START_RX_PAIR = 500 # Starts receiver pairing.
# MAV_CMD_STORAGE
uint16 STORAGE_FORMAT = 526 # Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage.
# MAV_CMD_UAVCAN
uint16 UAVCAN_GET_NODE_INFO = 5200 # Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages.
# MAV_CMD_VIDEO
uint16 VIDEO_START_CAPTURE = 2500 # Starts video capture (recording).
uint16 VIDEO_STOP_CAPTURE = 2501 # Stop the current video capture (recording).
uint16 VIDEO_START_STREAMING = 2502 # Start video streaming
uint16 VIDEO_STOP_STREAMING = 2503 # Stop the given video stream
# [[[end]]] (checksum: 73ee94ac661c9fcb61528a6668f71d94)

@ -0,0 +1,19 @@
# Mavros message: COMPANIONPROCESSSTATUS
std_msgs/Header header
uint8 state # See enum COMPANION_PROCESS_STATE
uint8 component # See enum MAV_COMPONENT
uint8 MAV_STATE_UNINIT = 0
uint8 MAV_STATE_BOOT = 1
uint8 MAV_STATE_CALIBRATING = 2
uint8 MAV_STATE_STANDBY = 3
uint8 MAV_STATE_ACTIVE = 4
uint8 MAV_STATE_CRITICAL = 5
uint8 MAV_STATE_EMERGENCY = 6
uint8 MAV_STATE_POWEROFF = 7
uint8 MAV_STATE_FLIGHT_TERMINATION = 8
uint8 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196
uint8 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197

@ -0,0 +1,26 @@
# Msg for Debug MAVLink API
#
# Supported types:
# DEBUG https://mavlink.io/en/messages/common.html#DEBUG
# DEBUG_VECTOR https://mavlink.io/en/messages/common.html#DEBUG_VECT
# DEBUG_FLOAT_ARRAY https://mavlink.io/en/messages/common.html#DEBUG_FLOAT_ARRAY
# NAMED_VALUE_FLOAT https://mavlink.io/en/messages/common.html#NAMED_VALUE_FLOAT
# NAMED_VALUE_INT https://mavlink.io/en/messages/common.html#NAMED_VALUE_INT
std_msgs/Header header
int32 index # index value of DEBUG value (-1 if not indexed)
int32 array_id # Unique ID used to discriminate between DEBUG_FLOAT_ARRAYS (-1 if not used)
string name # value name/key
float32 value_float # float value for NAMED_VALUE_FLOAT and DEBUG
int32 value_int # int value for NAMED_VALUE_INT
float32[] data # DEBUG vector or array
uint8 type
uint8 TYPE_DEBUG = 0
uint8 TYPE_DEBUG_VECT = 1
uint8 TYPE_DEBUG_FLOAT_ARRAY = 2
uint8 TYPE_NAMED_VALUE_FLOAT = 3
uint8 TYPE_NAMED_VALUE_INT = 4

@ -0,0 +1,14 @@
# ESCInfo.msg
#
#
# See mavlink message documentation here:
# https://mavlink.io/en/messages/common.html#ESC_INFO
std_msgs/Header header
uint16 counter
uint8 count
uint8 connection_type
uint8 info
mavros_msgs/ESCInfoItem[] esc_info

@ -0,0 +1,12 @@
# ESCInfoItem.msg
#
#
# See mavlink message documentation here:
# https://mavlink.io/en/messages/common.html#ESC_INFO
std_msgs/Header header
uint16 failure_flags
uint32 error_count
int32 temperature

@ -0,0 +1,9 @@
# ESCStatus.msg
#
#
# See mavlink message documentation here:
# https://mavlink.io/en/messages/common.html#ESC_STATUS
std_msgs/Header header
mavros_msgs/ESCStatusItem[] esc_status

@ -0,0 +1,11 @@
# ESCStatusItem.msg
#
#
# See mavlink message documentation here:
# https://mavlink.io/en/messages/common.html#ESC_STATUS
std_msgs/Header header
int32 rpm
float32 voltage
float32 current

@ -0,0 +1,10 @@
# APM ESC Telemetry as returned by BLHeli
#
# See:
# https://mavlink.io/en/messages/ardupilotmega.html#ESC_TELEMETRY_1_TO_4
# https://mavlink.io/en/messages/ardupilotmega.html#ESC_TELEMETRY_5_TO_8
# https://mavlink.io/en/messages/ardupilotmega.html#ESC_TELEMETRY_9_TO_12
std_msgs/Header header
mavros_msgs/ESCTelemetryItem[] esc_telemetry

@ -0,0 +1,15 @@
# APM ESC Telemetry as returned by BLHeli
#
# See:
# https://mavlink.io/en/messages/ardupilotmega.html#ESC_TELEMETRY_1_TO_4
# https://mavlink.io/en/messages/ardupilotmega.html#ESC_TELEMETRY_5_TO_8
# https://mavlink.io/en/messages/ardupilotmega.html#ESC_TELEMETRY_9_TO_12
std_msgs/Header header
float32 temperature # deg C
float32 voltage # V
float32 current # A
float32 totalcurrent # Ah
int32 rpm # 1/min
uint16 count # count of telemetry packets

@ -0,0 +1,23 @@
# Current autopilot estimator state
#
# https://mavlink.io/en/messages/common.html#ESTIMATOR_STATUS_FLAGS
std_msgs/Header header
bool attitude_status_flag
bool velocity_horiz_status_flag
bool velocity_vert_status_flag
bool pos_horiz_rel_status_flag
bool pos_horiz_abs_status_flag
bool pos_vert_abs_status_flag
bool pos_vert_agl_status_flag
bool const_pos_mode_status_flag
bool pred_pos_horiz_rel_status_flag
bool pred_pos_horiz_abs_status_flag
bool gps_glitch_status_flag
bool accel_error_status_flag

@ -0,0 +1,19 @@
# Extended autopilot state
#
# https://mavlink.io/en/messages/common.html#EXTENDED_SYS_STATE
uint8 VTOL_STATE_UNDEFINED = 0
uint8 VTOL_STATE_TRANSITION_TO_FW = 1
uint8 VTOL_STATE_TRANSITION_TO_MC = 2
uint8 VTOL_STATE_MC = 3
uint8 VTOL_STATE_FW = 4
uint8 LANDED_STATE_UNDEFINED = 0
uint8 LANDED_STATE_ON_GROUND = 1
uint8 LANDED_STATE_IN_AIR = 2
uint8 LANDED_STATE_TAKEOFF = 3
uint8 LANDED_STATE_LANDING = 4
std_msgs/Header header
uint8 vtol_state
uint8 landed_state

@ -0,0 +1,12 @@
# File/Dir information
uint8 TYPE_FILE = 0
uint8 TYPE_DIRECTORY = 1
string name
uint8 type
uint64 size
# Not supported by MAVLink FTP
#builtin_interfaces/Time atime
#int32 access_flags

@ -0,0 +1,37 @@
# FCU GPS INPUT message for the gps_input plugin
# <a href="https://mavlink.io/en/messages/common.html#GPS_INPUT">mavlink GPS_INPUT message</a>.
std_msgs/Header header
## GPS_FIX_TYPE enum
uint8 GPS_FIX_TYPE_NO_GPS = 0 # No GPS connected
uint8 GPS_FIX_TYPE_NO_FIX = 1 # No position information, GPS is connected
uint8 GPS_FIX_TYPE_2D_FIX = 2 # 2D position
uint8 GPS_FIX_TYPE_3D_FIX = 3 # 3D position
uint8 GPS_FIX_TYPE_DGPS = 4 # DGPS/SBAS aided 3D position
uint8 GPS_FIX_TYPE_RTK_FLOATR = 5 # TK float, 3D position
uint8 GPS_FIX_TYPE_RTK_FIXEDR = 6 # TK Fixed, 3D position
uint8 GPS_FIX_TYPE_STATIC = 7 # Static fixed, typically used for base stations
uint8 GPS_FIX_TYPE_PPP = 8 # PPP, 3D position
uint8 fix_type # [GPS_FIX_TYPE] GPS fix type
uint8 gps_id # ID of the GPS for multiple GPS inputs
uint16 ignore_flags # Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
uint32 time_week_ms # [ms] GPS time (from start of GPS week)
uint16 time_week # GPS week number
int32 lat # [degE7] Latitude (WGS84, EGM96 ellipsoid)
int32 lon # [degE7] Longitude (WGS84, EGM96 ellipsoid)
float32 alt # [m] Altitude (MSL). Positive for up.
float32 hdop # [m] GPS HDOP horizontal dilution of position.
float32 vdop # [m] GPS VDOP vertical dilution of position
float32 vn # [m/s] GPS velocity in NORTH direction in earth-fixed NED frame
float32 ve # [m/s] GPS velocity in EAST direction in earth-fixed NED frame
float32 vd # [m/s] GPS velocity in DOWN direction in earth-fixed NED frame
float32 speed_accuracy # [m/s] GPS speed accuracy
float32 horiz_accuracy # [m] GPS horizontal accuracy
float32 vert_accuracy # [m] GPS vertical accuracy
uint8 satellites_visible # Number of satellites visible. If unknown, set to 255
uint16 yaw # [cdeg] Yaw in earth frame from north.

@ -0,0 +1,37 @@
# FCU GPS RAW message for the gps_status plugin
# A merge of <a href="https://mavlink.io/en/messages/common.html#GPS_RAW_INT">mavlink GPS_RAW_INT</a> and
# <a href="https://mavlink.io/en/messages/common.html#GPS2_RAW">mavlink GPS2_RAW</a> messages.
std_msgs/Header header
## GPS_FIX_TYPE enum
uint8 GPS_FIX_TYPE_NO_GPS = 0 # No GPS connected
uint8 GPS_FIX_TYPE_NO_FIX = 1 # No position information, GPS is connected
uint8 GPS_FIX_TYPE_2D_FIX = 2 # 2D position
uint8 GPS_FIX_TYPE_3D_FIX = 3 # 3D position
uint8 GPS_FIX_TYPE_DGPS = 4 # DGPS/SBAS aided 3D position
uint8 GPS_FIX_TYPE_RTK_FLOAT = 5 # RTK float, 3D position
uint8 GPS_FIX_TYPE_RTK_FIXED = 6 # RTK Fixed, 3D position
uint8 GPS_FIX_TYPE_STATIC = 7 # Static fixed, typically used for base stations
uint8 GPS_FIX_TYPE_PPP = 8 # PPP, 3D position
uint8 fix_type # [GPS_FIX_TYPE] GPS fix type
int32 lat # [degE7] Latitude (WGS84, EGM96 ellipsoid)
int32 lon # [degE7] Longitude (WGS84, EGM96 ellipsoid)
int32 alt # [mm] Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude.
uint16 eph # GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
uint16 epv # GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
uint16 vel # [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX
uint16 cog # [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
uint8 satellites_visible # Number of satellites visible. If unknown, set to 255
# -*- only available with MAVLink v2.0 and GPS_RAW_INT messages -*-
int32 alt_ellipsoid # [mm] Altitude (above WGS84, EGM96 ellipsoid). Positive for up.
uint32 h_acc # [mm] Position uncertainty. Positive for up.
uint32 v_acc # [mm] Altitude uncertainty. Positive for up.
uint32 vel_acc # [mm] Speed uncertainty. Positive for up.
int32 hdg_acc # [degE5] Heading / track uncertainty
uint16 yaw # [cdeg] Yaw in earth frame from north.
# -*- only available with MAVLink v2.0 and GPS2_RAW messages -*-
uint8 dgps_numch # Number of DGPS satellites
uint32 dgps_age # [ms] Age of DGPS info

@ -0,0 +1,18 @@
# FCU GPS RTK message for the gps_status plugin
# A copy of <a href="https://mavlink.io/en/messages/common.html#GPS_RTK">mavlink GPS_RTK message</a>
std_msgs/Header header
uint8 rtk_receiver_id # Identification of connected RTK receiver.
int16 wn # GPS Week Number of last baseline.
uint32 tow # [ms] GPS Time of Week of last baseline.
uint8 rtk_health # GPS-specific health report for RTK data.
uint8 rtk_rate # [Hz] Rate of baseline messages being received by GPS.
uint8 nsats # Current number of sats used for RTK calculation.
int32 baseline_a # [mm] Current baseline in ECEF x or NED north component, depends on header.frame_id.
int32 baseline_b # [mm] Current baseline in ECEF y or NED east component, depends on header.frame_id.
int32 baseline_c # [mm] Current baseline in ECEF z or NED down component, depends on header.frame_id.
uint32 accuracy # Current estimate of baseline accuracy.
int32 iar_num_hypotheses # Current number of integer ambiguity hypotheses.

@ -0,0 +1,32 @@
# MAVLink message: GIMBAL_DEVICE_ATTITUDE_STATUS
# https://mavlink.io/en/messages/common.html#GIMBAL_DEVICE_ATTITUDE_STATUS
std_msgs/Header header
uint8 target_system # System ID
uint8 target_component # Component ID
uint16 flags # Current gimbal flags set (bitwise) - See GIMBAL_DEVICE_FLAGS
#GIMBAL_DEVICE_FLAGS
uint16 FLAGS_RETRACT = 1 # Set to retracted safe position (no stabilization), takes presedence over all other flags.
uint16 FLAGS_NEUTRAL = 2 # Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (pitch=yaw=0) but may be any orientation.
uint16 FLAGS_ROLL_LOCK = 4 # Lock roll angle to absolute angle relative to horizon (not relative to drone). This is generally the default with a stabilizing gimbal.
uint16 FLAGS_PITCH_LOCK = 8 # Lock pitch angle to absolute angle relative to horizon (not relative to drone). This is generally the default.
uint16 FLAGS_YAW_LOCK = 16 # Lock yaw angle to absolute angle relative to North (not relative to drone). If this flag is set, the quaternion is in the Earth frame with the x-axis pointing North (yaw absolute). If this flag is not set, the quaternion frame is in the Earth frame rotated so that the x-axis is pointing forward (yaw relative to vehicle).
geometry_msgs/Quaternion q # Quaternion, x, y, z, w (0 0 0 1 is the null-rotation, the frame is depends on whether the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set)
float32 angular_velocity_x # X component of angular velocity (NaN if unknown)
float32 angular_velocity_y # Y component of angular velocity (NaN if unknown)
float32 angular_velocity_z # Z component of angular velocity (NaN if unknown)
uint32 failure_flags # Failure flags (0 for no failure) (bitwise) - See GIMBAL_DEVICE_ERROR_FLAGS
#GIMBAL_DEVICE_ERROR_FLAGS
uint32 ERROR_FLAGS_AT_ROLL_LIMIT = 1 # Gimbal device is limited by hardware roll limit.
uint32 ERROR_FLAGS_AT_PITCH_LIMIT = 2 # Gimbal device is limited by hardware pitch limit.
uint32 ERROR_FLAGS_AT_YAW_LIMIT = 4 # Gimbal device is limited by hardware yaw limit.
uint32 ERROR_FLAGS_ENCODER_ERROR = 8 # There is an error with the gimbal encoders.
uint32 ERROR_FLAGS_POWER_ERROR = 16 # There is an error with the gimbal power source.
uint32 ERROR_FLAGS_MOTOR_ERROR = 32 # There is an error with the gimbal motor's.
uint32 ERROR_FLAGS_SOFTWARE_ERROR = 64 # There is an error with the gimbal's software.
uint32 ERROR_FLAGS_COMMS_ERROR = 128 # There is an error with the gimbal's communication.
uint32 ERROR_FLAGS_CALIBRATION_RUNNING = 256 # Gimbal is currently calibrating.

@ -0,0 +1,34 @@
# MAVLink message: GIMBAL_DEVICE_INFORMATION
# https://mavlink.io/en/messages/common.html#GIMBAL_DEVICE_INFORMATION
std_msgs/Header header
string vendor_name # Name of the gimbal vendor.
string model_name # Name of the gimbal model.
string custom_name # Custom name of the gimbal given to it by the user.
uint32 firmware_version # Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
uint32 hardware_version # Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
uint64 uid # UID of gimbal hardware (0 if unknown).
uint32 cap_flags # Bitmap of gimbal capability flags - see GIMBAL_DEVICE_CAP_FLAGS
#GIMBAL_DEVICE_CAP_FLAGS
uint32 CAP_FLAGS_HAS_RETRACT = 1 # Gimbal device supports a retracted position
uint32 CAP_FLAGS_HAS_NEUTRAL = 2 # Gimbal device supports a horizontal, forward looking position, stabilized
uint32 CAP_FLAGS_HAS_ROLL_AXIS = 4 # Gimbal device supports rotating around roll axis.
uint32 CAP_FLAGS_HAS_ROLL_FOLLOW = 8 # Gimbal device supports to follow a roll angle relative to the vehicle
uint32 CAP_FLAGS_HAS_ROLL_LOCK = 16 # Gimbal device supports locking to an roll angle (generally that's the default with roll stabilized)
uint32 CAP_FLAGS_HAS_PITCH_AXIS = 32 # Gimbal device supports rotating around pitch axis.
uint32 CAP_FLAGS_HAS_PITCH_FOLLOW = 64 # Gimbal device supports to follow a pitch angle relative to the vehicle
uint32 CAP_FLAGS_HAS_PITCH_LOCK = 128 # Gimbal device supports locking to an pitch angle (generally that's the default with pitch stabilized)
uint32 CAP_FLAGS_HAS_YAW_AXIS = 256 # Gimbal device supports rotating around yaw axis.
uint32 CAP_FLAGS_HAS_YAW_FOLLOW = 512 # Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)
uint32 CAP_FLAGS_HAS_YAW_LOCK = 1024 # Gimbal device supports locking to an absolute heading (often this is an option available)
uint32 CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 # Gimbal device supports yawing/panning infinetely (e.g. using slip disk).
uint16 custom_cap_flags # Bitmap for use for gimbal-specific capability flags.
float32 roll_min # Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
float32 roll_max # Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
float32 pitch_min # Minimum pitch angle (positive: up, negative: down)
float32 pitch_max # Maximum pitch angle (positive: up, negative: down)
float32 yaw_min # Minimum yaw angle (positive: to the right, negative: to the left)
float32 yaw_max # Maximum yaw angle (positive: to the right, negative: to the left)

@ -0,0 +1,18 @@
# MAVLink message: GIMBAL_DEVICE_SET_ATTITUDE
# https://mavlink.io/en/messages/common.html#GIMBAL_DEVICE_SET_ATTITUDE
uint8 target_system # System ID
uint8 target_component # Component ID
uint16 flags # Low level gimbal flags (bitwise) - See GIMBAL_DEVICE_FLAGS
#GIMBAL_DEVICE_FLAGS
uint16 FLAGS_RETRACT = 1 # Based on GIMBAL_DEVICE_FLAGS_RETRACT
uint16 FLAGS_NEUTRAL = 2 # Based on GIMBAL_DEVICE_FLAGS_NEUTRAL
uint16 FLAGS_ROLL_LOCK = 4 # Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK
uint16 FLAGS_PITCH_LOCK = 8 # Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK
uint16 FLAGS_YAW_LOCK = 16 # Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK
geometry_msgs/Quaternion q # Quaternion, x, y, z, w (0 0 0 1 is the null-rotation, the frame is depends on whether the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set)
float32 angular_velocity_x # X component of angular velocity, positive is rolling to the right, NaN to be ignored.
float32 angular_velocity_y # Y component of angular velocity, positive is pitching up, NaN to be ignored.
float32 angular_velocity_z # Z component of angular velocity, positive is yawing to the right, NaN to be ignored.

@ -0,0 +1,29 @@
# MAVLink message: GIMBAL_MANAGER_INFORMATION
# https://mavlink.io/en/messages/common.html#GIMBAL_MANAGER_INFORMATION
std_msgs/Header header
uint32 cap_flags # Bitmap of gimbal capability flags - see GIMBAL_MANAGER_CAP_FLAGS
#GIMBAL_MANAGER_CAP_FLAGS
uint32 CAP_FLAGS_HAS_RETRACT = 1 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT.
uint32 CAP_FLAGS_HAS_NEUTRAL = 2 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL.
uint32 CAP_FLAGS_HAS_ROLL_AXIS = 4 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS.
uint32 CAP_FLAGS_HAS_ROLL_FOLLOW = 8 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW.
uint32 CAP_FLAGS_HAS_ROLL_LOCK = 16 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK.
uint32 CAP_FLAGS_HAS_PITCH_AXIS = 32 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS.
uint32 CAP_FLAGS_HAS_PITCH_FOLLOW = 64 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW.
uint32 CAP_FLAGS_HAS_PITCH_LOCK = 128 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK.
uint32 CAP_FLAGS_HAS_YAW_AXIS = 256 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS.
uint32 CAP_FLAGS_HAS_YAW_FOLLOW = 512 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW.
uint32 CAP_FLAGS_HAS_YAW_LOCK = 1024 # Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK.
uint32 CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 # Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW.
uint32 CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 # Gimbal manager supports to point to a local position.
uint32 CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 # Gimbal manager supports to point to a global latitude, longitude, altitude position.
uint8 gimbal_device_id # Gimbal device ID that this gimbal manager is responsible for.
float32 roll_min # Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
float32 roll_max # Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
float32 pitch_min # Minimum pitch angle (positive: up, negative: down)
float32 pitch_max # Maximum pitch angle (positive: up, negative: down)
float32 yaw_min # Minimum yaw angle (positive: to the right, negative: to the left)
float32 yaw_max # Maximum yaw angle (positive: to the right, negative: to the left)

@ -0,0 +1,24 @@
# MAVLink message: GIMBAL_MANAGER_SET_ATTITUDE
# https://mavlink.io/en/messages/common.html#GIMBAL_MANAGER_SET_ATTITUDE
uint8 target_system # System ID
uint8 target_component # Component ID
uint32 flags # High level gimbal manager flags to use (bitwise) - See GIMBAL_MANAGER_FLAGS
#GIMBAL_MANAGER_FLAGS
uint32 GIMBAL_MANAGER_FLAGS_RETRACT = 1 # Based on GIMBAL_DEVICE_FLAGS_RETRACT
uint32 GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 # Based on GIMBAL_DEVICE_FLAGS_NEUTRAL
uint32 GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 # Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK
uint32 GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 # Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK
uint32 GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 # Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK
uint8 gimbal_device_id # Component ID of gimbal device to address
# (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device
# components. Send command multiple times for more than
# one gimbal (but not all gimbals). Default Mavlink gimbal
# device ids: 154, 171-175
geometry_msgs/Quaternion q # Quaternion, x, y, z, w (0 0 0 1 is the null-rotation, the frame is depends on whether the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set)
float32 angular_velocity_x # X component of angular velocity, positive is rolling to the right, NaN to be ignored.
float32 angular_velocity_y # Y component of angular velocity, positive is pitching up, NaN to be ignored.
float32 angular_velocity_z # Z component of angular velocity, positive is yawing to the right, NaN to be ignored.

@ -0,0 +1,27 @@
# MAVLink message: GIMBAL_MANAGER_SET_PITCHYAW
# https://mavlink.io/en/messages/common.html#GIMBAL_MANAGER_SET_PITCHYAW
# Note that this message structure is identical also to GIMBAL_MANAGER_SET_MANUAL_CONTROL and is
# reused as such by the plugin
# https://mavlink.io/en/messages/common.html#GIMBAL_MANAGER_SET_MANUAL_CONTROL
uint8 target_system # System ID
uint8 target_component # Component ID
uint32 flags # High level gimbal manager flags to use - See GIMBAL_MANAGER_FLAGS
#GIMBAL_MANAGER_FLAGS
uint32 GIMBAL_MANAGER_FLAGS_RETRACT = 1 # Based on GIMBAL_DEVICE_FLAGS_RETRACT
uint32 GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 # Based on GIMBAL_DEVICE_FLAGS_NEUTRAL
uint32 GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 # Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK
uint32 GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 # Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK
uint32 GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 # Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK
uint8 gimbal_device_id # Component ID of gimbal device to address
# (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device
# components. Send command multiple times for more than
# one gimbal (but not all gimbals). Default Mavlink gimbal
# device ids: 154, 171-175
float32 pitch # Pitch angle (positive: up, negative: down, NaN to be ignored).
float32 yaw # Yaw angle (positive: to the right, negative: to the left, NaN to be ignored).
float32 pitch_rate # Pitch angular rate (positive: up, negative: down, NaN to be ignored).
float32 yaw_rate # Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored).

@ -0,0 +1,19 @@
# MAVLink message: GIMBAL_MANAGER_STATUS
# https://mavlink.io/en/messages/common.html#GIMBAL_MANAGER_STATUS
std_msgs/Header header
uint32 flags # High level gimbal manager flags to use - See GIMBAL_MANAGER_FLAGS
#GIMBAL_MANAGER_FLAGS
uint32 GIMBAL_MANAGER_FLAGS_RETRACT = 1 # Based on GIMBAL_DEVICE_FLAGS_RETRACT
uint32 GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 # Based on GIMBAL_DEVICE_FLAGS_NEUTRAL
uint32 GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 # Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK
uint32 GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 # Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK
uint32 GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 # Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK
uint8 gimbal_device_id # Gimbal device ID that this gimbal manager is responsible for.
uint8 sysid_primary # System ID of MAVLink component with primary control, 0 for none.
uint8 compid_primary # Component ID of MAVLink component with primary control, 0 for none.
uint8 sysid_secondary # System ID of MAVLink component with secondary control, 0 for none.
uint8 compid_secondary # Component ID of MAVLink component with secondary control, 0 for none.

@ -0,0 +1,34 @@
# Message for SET_POSITION_TARGET_GLOBAL_INT
#
# https://mavlink.io/en/messages/common.html#SET_POSITION_TARGET_GLOBAL_INT
# Some complex system requires all feautures that mavlink
# message provide. See issue #402, #415.
std_msgs/Header header
uint8 coordinate_frame
uint8 FRAME_GLOBAL_INT = 5
uint8 FRAME_GLOBAL_REL_ALT = 6
uint8 FRAME_GLOBAL_TERRAIN_ALT = 11
uint16 type_mask
uint16 IGNORE_LATITUDE = 1 # Position ignore flags
uint16 IGNORE_LONGITUDE = 2
uint16 IGNORE_ALTITUDE = 4
uint16 IGNORE_VX = 8 # Velocity vector ignore flags
uint16 IGNORE_VY = 16
uint16 IGNORE_VZ = 32
uint16 IGNORE_AFX = 64 # Acceleration/Force vector ignore flags
uint16 IGNORE_AFY = 128
uint16 IGNORE_AFZ = 256
uint16 FORCE = 512 # Force in af vector flag
uint16 IGNORE_YAW = 1024
uint16 IGNORE_YAW_RATE = 2048
float64 latitude
float64 longitude
float32 altitude # in meters, AMSL or above terrain
geometry_msgs/Vector3 velocity
geometry_msgs/Vector3 acceleration_or_force
float32 yaw
float32 yaw_rate

@ -0,0 +1,10 @@
# HilActuatorControls.msg
#
# ROS representation of MAVLink HIL_ACTUATOR_CONTROLS
# See mavlink message documentation here:
# https://mavlink.io/en/messages/common.html#HIL_ACTUATOR_CONTROLS
std_msgs/Header header
float32[16] controls
uint8 mode
uint64 flags

@ -0,0 +1,18 @@
# HilControls.msg
#
# ROS representation of MAVLink HIL_CONTROLS
# (deprecated, use HIL_ACTUATOR_CONTROLS instead)
# See mavlink message documentation here:
# https://mavlink.io/en/messages/common.html#HIL_CONTROLS
std_msgs/Header header
float32 roll_ailerons
float32 pitch_elevator
float32 yaw_rudder
float32 throttle
float32 aux1
float32 aux2
float32 aux3
float32 aux4
uint8 mode
uint8 nav_mode

@ -0,0 +1,17 @@
# HilControls.msg
#
# ROS representation of MAVLink HIL_GPS
# See mavlink message documentation here:
# https://mavlink.io/en/messages/common.html#HIL_GPS
std_msgs/Header header
uint8 fix_type
geographic_msgs/GeoPoint geo
uint16 eph
uint16 epv
uint16 vel
int16 vn
int16 ve
int16 vd
uint16 cog
uint8 satellites_visible

@ -0,0 +1,16 @@
# HilSensor.msg
#
# ROS representation of MAVLink HIL_SENSOR
# See mavlink message documentation here:
# https://mavlink.io/en/messages/common.html#HIL_SENSOR
std_msgs/Header header
geometry_msgs/Vector3 acc
geometry_msgs/Vector3 gyro
geometry_msgs/Vector3 mag
float32 abs_pressure
float32 diff_pressure
float32 pressure_alt
float32 temperature
uint32 fields_updated

@ -0,0 +1,15 @@
# HilStateQuaternion.msg
#
# ROS representation of MAVLink HIL_STATE_QUATERNION
# See mavlink message documentation here:
# https://mavlink.io/en/messages/common.html#HIL_STATE_QUATERNION
std_msgs/Header header
geometry_msgs/Quaternion orientation
geometry_msgs/Vector3 angular_velocity
geometry_msgs/Vector3 linear_acceleration
geometry_msgs/Vector3 linear_velocity
geographic_msgs/GeoPoint geo
float32 ind_airspeed
float32 true_airspeed

@ -0,0 +1,10 @@
# MAVLink message: HOME_POSITION
# https://mavlink.io/en/messages/common.html#HOME_POSITION
std_msgs/Header header
geographic_msgs/GeoPoint geo # geodetic coordinates in WGS-84 datum
geometry_msgs/Point position # local position
geometry_msgs/Quaternion orientation # XXX: verify field name (q[4])
geometry_msgs/Vector3 approach # position of the end of approach vector

@ -0,0 +1,32 @@
# MAVLink message: LANDING_TARGET
# https://mavlink.io/en/messages/common.html
std_msgs/Header header
## MAV_FRAME enum
uint8 GLOBAL = 0 # Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL)
uint8 LOCAL_NED = 2 # Local coordinate frame, Z-up (x: north, y: east, z: down).
uint8 MISSION = 3 # NOT a coordinate frame, indicates a mission command.
uint8 GLOBAL_RELATIVE_ALT = 4 # Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location.
uint8 LOCAL_ENU = 5 # Local coordinate frame, Z-down (x: east, y: north, z: up)
uint8 GLOBAL_INT = 6 # Global coordinate frame, WGS84 coordinate system. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL)
uint8 GLOBAL_RELATIVE_ALT_INT = 7 # Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location.
uint8 LOCAL_OFFSET_NED = 8 # Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position.
uint8 BODY_NED = 9 # Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right.
uint8 BODY_OFFSET_NED = 10 # Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east.
uint8 GLOBAL_TERRAIN_ALT = 11 # Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model.
uint8 GLOBAL_TERRAIN_ALT_INT = 12 # Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model.
## LANDING_TARGET_TYPE enum
uint8 LIGHT_BEACON = 0 # Landing target signaled by light beacon (ex: IR-LOCK)
uint8 RADIO_BEACON = 1 # Landing target signaled by radio beacon (ex: ILS, NDB)
uint8 VISION_FIDUCIAL = 2 # Landing target represented by a fiducial marker (ex: ARTag)
uint8 VISION_OTHER = 3 # Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)
uint8 target_num
uint8 frame
float32[2] angle
float32 distance
float32[2] size
geometry_msgs/Pose pose
uint8 type

@ -0,0 +1,11 @@
# Reply to LogRequestData, - a chunk of a log
#
# :id: - log id
# :offset: - offset into the log
# :data: - chunk of data (if zero-sized, then there are no more chunks)
std_msgs/Header header
uint16 id
uint32 offset
uint8[] data

@ -0,0 +1,15 @@
# Information about a single log
#
# :id: - log id
# :num_logs: - total number of logs
# :last_log_num: - id of last log
# :time_utc: - UTC timestamp of log (ros::Time(0) if not available)
# :size: - size of log in bytes (may be approximate)
std_msgs/Header header
uint16 id
uint16 num_logs
uint16 last_log_num
builtin_interfaces/Time time_utc
uint32 size

@ -0,0 +1,4 @@
std_msgs/Header header
uint8 report
float32 confidence

@ -0,0 +1,7 @@
# Manual Control state
std_msgs/Header header
float32 x
float32 y
float32 z
float32 r
uint16 buttons

@ -0,0 +1,38 @@
# Mavlink message transport type.
#
# Used to transport mavlink_message_t via ROS topic
#
# :framing_status:
# Frame decoding status: OK, CRC error, bad Signature (mavlink v2.0)
# You may simply drop all non valid messages.
# Used for GCS Bridge to transport unknown messages.
#
# :magic:
# STX byte, used to determine protocol version v1.0 or v2.0.
#
# Please use mavros_msgs::mavlink::convert() from <mavros_msgs/mavlink_convert.hpp>
# to convert between ROS and MAVLink message type
# mavlink_framing_t enum
uint8 FRAMING_OK = 1
uint8 FRAMING_BAD_CRC = 2
uint8 FRAMING_BAD_SIGNATURE = 3
# stx values
uint8 MAVLINK_V10 = 254
uint8 MAVLINK_V20 = 253
std_msgs/Header header
uint8 framing_status
uint8 magic # STX byte
uint8 len
uint8 incompat_flags
uint8 compat_flags
uint8 seq
uint8 sysid
uint8 compid
uint32 msgid # 24-bit message id
uint16 checksum
uint64[<=33] payload64 # max size: (255+2+7)/8
uint8[<=13] signature # optional signature, max size: 13

@ -0,0 +1,18 @@
# MAVLink message: DO_MOUNT_CONTROL
# https://mavlink.io/en/messages/common.html#MAV_CMD_DO_MOUNT_CONTROL
std_msgs/Header header
uint8 mode # See enum MAV_MOUNT_MODE.
uint8 MAV_MOUNT_MODE_RETRACT = 0
uint8 MAV_MOUNT_MODE_NEUTRAL = 1
uint8 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2
uint8 MAV_MOUNT_MODE_RC_TARGETING = 3
uint8 MAV_MOUNT_MODE_GPS_POINT = 4
float32 pitch # pitch degrees or degrees/second depending on mount mode.
float32 roll # roll degrees or degrees/second depending on mount mode.
float32 yaw # yaw degrees or degrees/second depending on mount mode.
float32 altitude # altitude depending on mount mode.
float32 latitude # latitude in degrees * 1E7, set if appropriate mount mode.
float32 longitude # longitude in degrees * 1E7, set if appropriate mount mode.

@ -0,0 +1,12 @@
# https://mavlink.io/en/messages/common.html#NAV_CONTROLLER_OUTPUT
std_msgs/Header header
float32 nav_roll # Current desired roll
float32 nav_pitch # Current desired pitch
int16 nav_bearing # Current desired heading
int16 target_bearing # Bearing to current waypoint/target
uint16 wp_dist # Distance to active waypoint
float32 alt_error # Current altitude error
float32 aspd_error # Current airspeed error
float32 xtrack_error # Current crosstrack error on x-y plane

@ -0,0 +1,25 @@
# Mavros message: ONBOARDCOMPUTERSTATUS
std_msgs/Header header
uint8 component # See enum MAV_COMPONENT
uint32 uptime # [ms] Time since system boot
uint8 type # Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers.
uint8[8] cpu_cores # CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.
uint8[10] cpu_combined # Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused
uint8[4] gpu_cores # GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused
uint8[10] gpu_combined # Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.
int8 temperature_board # [degC] Temperature of the board. A value of INT8_MAX implies the field is unused.
int8[8] temperature_core # [degC] Temperature of the CPU core. A value of INT8_MAX implies the field is unused.
int16[4] fan_speed # [rpm] Fan speeds. A value of INT16_MAX implies the field is unused.
uint32 ram_usage # [MiB] Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused.
uint32 ram_total # [MiB] Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused.
uint32[4] storage_type # Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused.
uint32[4] storage_usage # [MiB] Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused.
uint32[4] storage_total # [MiB] Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused.
uint32[6] link_type # Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary.
uint32[6] link_tx_rate # [KiB/s] Network traffic from the component system. A value of UINT32_MAX implies the field is unused.
uint32[6] link_rx_rate # [KiB/s] Network traffic to the component system. A value of UINT32_MAX implies the field is unused.
uint32[6] link_tx_max # [KiB/s] Network capacity from the component system. A value of UINT32_MAX implies the field is unused.
uint32[6] link_rx_max # [KiB/s] Network capacity to the component system. A value of UINT32_MAX implies the field is unused.

@ -0,0 +1,9 @@
# OPTICAL_FLOW message data
std_msgs/Header header
geometry_msgs/Vector3 flow
geometry_msgs/Vector3 flow_comp_m
uint8 quality
float32 ground_distance
geometry_msgs/Vector3 flow_rate

@ -0,0 +1,14 @@
# OPTICAL_FLOW_RAD message data
std_msgs/Header header
uint32 integration_time_us
float32 integrated_x
float32 integrated_y
float32 integrated_xgyro
float32 integrated_ygyro
float32 integrated_zgyro
int16 temperature
uint8 quality
uint32 time_delta_distance_us
float32 distance

@ -0,0 +1,9 @@
# Override RC Input
# Currently MAVLink defines override for 18 channels
# https://mavlink.io/en/messages/common.html#RC_CHANNELS_OVERRIDE
uint16 CHAN_RELEASE=0
uint16 CHAN_NOCHANGE=65535
uint16[18] channels

@ -0,0 +1,11 @@
# Parameter msg.
# XXX DEPRECATED: replaced by ParamEvent
std_msgs/Header header
string param_id
mavros_msgs/ParamValue value
uint16 param_index
uint16 param_count

@ -0,0 +1,14 @@
# Parameter Event
#
# That messages replaces mavros_msgs/Param from mavros v1.
# Reason for that: ROS2 have native message for parameters
#
# ROS2 also have it's own ParameterEvent stream, which could be used
# to get FCU updates too. But that message is simpler to use.
std_msgs/Header header
string param_id
rcl_interfaces/ParameterValue value
uint16 param_index
uint16 param_count

@ -0,0 +1,12 @@
# Parameter value storage type.
#
# Integer and float fields:
#
# if integer != 0: it is integer value
# else if real != 0.0: it is float value
# else: it is zero.
# XXX DEPRECATED: replaced by rmw_interfaces/ParameterValue
int64 integer
float64 real

@ -0,0 +1,10 @@
# Play tune V2
#
# https://mavlink.io/en/messages/common.html#PLAY_TUNE_V2
## TUNE_FORMAT enum
uint8 QBASIC1_1 = 1
uint8 MML_MODERN = 2
uint8 format
string tune

@ -0,0 +1,32 @@
# Message for SET_POSITION_TARGET_LOCAL_NED
#
# Some complex system requires all feautures that mavlink
# message provide. See issue #402.
std_msgs/Header header
uint8 coordinate_frame
uint8 FRAME_LOCAL_NED = 1
uint8 FRAME_LOCAL_OFFSET_NED = 7
uint8 FRAME_BODY_NED = 8
uint8 FRAME_BODY_OFFSET_NED = 9
uint16 type_mask
uint16 IGNORE_PX = 1 # Position ignore flags
uint16 IGNORE_PY = 2
uint16 IGNORE_PZ = 4
uint16 IGNORE_VX = 8 # Velocity vector ignore flags
uint16 IGNORE_VY = 16
uint16 IGNORE_VZ = 32
uint16 IGNORE_AFX = 64 # Acceleration/Force vector ignore flags
uint16 IGNORE_AFY = 128
uint16 IGNORE_AFZ = 256
uint16 FORCE = 512 # Force in af vector flag
uint16 IGNORE_YAW = 1024
uint16 IGNORE_YAW_RATE = 2048
geometry_msgs/Point position
geometry_msgs/Vector3 velocity
geometry_msgs/Vector3 acceleration_or_force
float32 yaw
float32 yaw_rate

@ -0,0 +1,5 @@
# RAW RC input state
std_msgs/Header header
uint8 rssi
uint16[] channels

@ -0,0 +1,4 @@
# RAW Servo out state
std_msgs/Header header
uint16[] channels

@ -0,0 +1,6 @@
# RTCM message for the gps_rtk plugin
# The gps_rtk plugin will fragment the data if necessary and
# forward it to the FCU via Mavlink through the available link.
# data should be <= 4*180, higher will be discarded.
std_msgs/Header header
uint8[] data

@ -0,0 +1,23 @@
# RTKBaseline received from the FCU.
# Full description: https://mavlink.io/en/messages/common.html#GPS_RTK
# Mavlink Common, #127and #128
std_msgs/Header header
uint32 time_last_baseline_ms
uint8 rtk_receiver_id
uint16 wn
uint32 tow
uint8 rtk_health
uint8 rtk_rate
uint8 nsats
uint8 baseline_coords_type
uint8 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0 # Earth-centered, earth-fixed
uint8 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1 # RTK basestation centered, north, east, down
int32 baseline_a_mm
int32 baseline_b_mm
int32 baseline_c_mm
uint32 accuracy
int32 iar_num_hypotheses

@ -0,0 +1,16 @@
# RADIO_STATUS message
std_msgs/Header header
# message data
uint8 rssi
uint8 remrssi
uint8 txbuf
uint8 noise
uint8 remnoise
uint16 rxerrors
uint16 fixed
# calculated
float32 rssi_dbm
float32 remrssi_dbm

@ -0,0 +1,82 @@
# Current autopilot state
#
# Known modes listed here:
# http://wiki.ros.org/mavros/CustomModes
#
# For system_status values
# see https://mavlink.io/en/messages/common.html#MAV_STATE
#
std_msgs/Header header
bool connected
bool armed
bool guided
bool manual_input
string mode
uint8 system_status
string MODE_APM_PLANE_MANUAL = MANUAL
string MODE_APM_PLANE_CIRCLE = CIRCLE
string MODE_APM_PLANE_STABILIZE = STABILIZE
string MODE_APM_PLANE_TRAINING = TRAINING
string MODE_APM_PLANE_ACRO = ACRO
string MODE_APM_PLANE_FBWA = FBWA
string MODE_APM_PLANE_FBWB = FBWB
string MODE_APM_PLANE_CRUISE = CRUISE
string MODE_APM_PLANE_AUTOTUNE = AUTOTUNE
string MODE_APM_PLANE_AUTO = AUTO
string MODE_APM_PLANE_RTL = RTL
string MODE_APM_PLANE_LOITER = LOITER
string MODE_APM_PLANE_LAND = LAND
string MODE_APM_PLANE_GUIDED = GUIDED
string MODE_APM_PLANE_INITIALISING = INITIALISING
string MODE_APM_PLANE_QSTABILIZE = QSTABILIZE
string MODE_APM_PLANE_QHOVER = QHOVER
string MODE_APM_PLANE_QLOITER = QLOITER
string MODE_APM_PLANE_QLAND = QLAND
string MODE_APM_PLANE_QRTL = QRTL
string MODE_APM_COPTER_STABILIZE = STABILIZE
string MODE_APM_COPTER_ACRO = ACRO
string MODE_APM_COPTER_ALT_HOLD = ALT_HOLD
string MODE_APM_COPTER_AUTO = AUTO
string MODE_APM_COPTER_GUIDED = GUIDED
string MODE_APM_COPTER_LOITER = LOITER
string MODE_APM_COPTER_RTL = RTL
string MODE_APM_COPTER_CIRCLE = CIRCLE
string MODE_APM_COPTER_POSITION = POSITION
string MODE_APM_COPTER_LAND = LAND
string MODE_APM_COPTER_OF_LOITER = OF_LOITER
string MODE_APM_COPTER_DRIFT = DRIFT
string MODE_APM_COPTER_SPORT = SPORT
string MODE_APM_COPTER_FLIP = FLIP
string MODE_APM_COPTER_AUTOTUNE = AUTOTUNE
string MODE_APM_COPTER_POSHOLD = POSHOLD
string MODE_APM_COPTER_BRAKE = BRAKE
string MODE_APM_COPTER_THROW = THROW
string MODE_APM_COPTER_AVOID_ADSB = AVOID_ADSB
string MODE_APM_COPTER_GUIDED_NOGPS = GUIDED_NOGPS
string MODE_APM_ROVER_MANUAL = MANUAL
string MODE_APM_ROVER_LEARNING = LEARNING
string MODE_APM_ROVER_STEERING = STEERING
string MODE_APM_ROVER_HOLD = HOLD
string MODE_APM_ROVER_AUTO = AUTO
string MODE_APM_ROVER_RTL = RTL
string MODE_APM_ROVER_GUIDED = GUIDED
string MODE_APM_ROVER_INITIALISING = INITIALISING
string MODE_PX4_MANUAL = MANUAL
string MODE_PX4_ACRO = ACRO
string MODE_PX4_ALTITUDE = ALTCTL
string MODE_PX4_POSITION = POSCTL
string MODE_PX4_OFFBOARD = OFFBOARD
string MODE_PX4_STABILIZED = STABILIZED
string MODE_PX4_RATTITUDE = RATTITUDE
string MODE_PX4_MISSION = AUTO.MISSION
string MODE_PX4_LOITER = AUTO.LOITER
string MODE_PX4_RTL = AUTO.RTL
string MODE_PX4_LAND = AUTO.LAND
string MODE_PX4_RTGS = AUTO.RTGS
string MODE_PX4_READY = AUTO.READY
string MODE_PX4_TAKEOFF = AUTO.TAKEOFF

@ -0,0 +1,19 @@
# EVENT message representation
# https://mavlink.io/en/messages/common.html#EVENT
# Severity levels
uint8 EMERGENCY = 0
uint8 ALERT = 1
uint8 CRITICAL = 2
uint8 ERROR = 3
uint8 WARNING = 4
uint8 NOTICE = 5
uint8 INFO = 6
uint8 DEBUG = 7
# Fields
std_msgs/Header header
uint8 severity
uint32 px4_id
uint8[40] arguments
uint16 sequence

@ -0,0 +1,17 @@
# STATUSTEXT message representation
# https://mavlink.io/en/messages/common.html#STATUSTEXT
# Severity levels
uint8 EMERGENCY = 0
uint8 ALERT = 1
uint8 CRITICAL = 2
uint8 ERROR = 3
uint8 WARNING = 4
uint8 NOTICE = 5
uint8 INFO = 6
uint8 DEBUG = 7
# Fields
std_msgs/Header header
uint8 severity
string text

@ -0,0 +1,15 @@
std_msgs/Header header
uint32 sensors_present
uint32 sensors_enabled
uint32 sensors_health
uint16 load
uint16 voltage_battery
int16 current_battery
int8 battery_remaining
uint16 drop_rate_comm
uint16 errors_comm
uint16 errors_count1
uint16 errors_count2
uint16 errors_count3
uint16 errors_count4

@ -0,0 +1,12 @@
# Message for TERRAIN_REPORT
# https://mavlink.io/en/messages/common.html#TERRAIN_REPORT
std_msgs/Header header
float64 latitude
float64 longitude
uint16 spacing
float32 terrain_height # in meters, terrain height
float32 current_height # in meters, vehicle height above terrain
uint16 pending
uint16 loaded

@ -0,0 +1,5 @@
# Thrust to send to the FCU
std_msgs/Header header
float32 thrust

@ -0,0 +1,7 @@
# Status of the MAVLink time synchroniser
std_msgs/Header header
uint64 remote_timestamp_ns # remote system timestamp (nanoseconds)
int64 observed_offset_ns # raw time offset directly observed from this timesync packet (nanoseconds)
int64 estimated_offset_ns # smoothed time offset between companion system and Mavros (nanoseconds)
float32 round_trip_time_ms # round trip time of this timesync packet (milliseconds)

@ -0,0 +1,19 @@
# MAVLink message: TRAJECTORY
# https://mavlink.io/en/messages/common.html#TRAJECTORY
std_msgs/Header header
uint8 type # See enum MAV_TRAJECTORY_REPRESENTATION.
uint8 MAV_TRAJECTORY_REPRESENTATION_WAYPOINTS = 0
uint8 MAV_TRAJECTORY_REPRESENTATION_BEZIER = 1
mavros_msgs/PositionTarget point_1
mavros_msgs/PositionTarget point_2
mavros_msgs/PositionTarget point_3
mavros_msgs/PositionTarget point_4
mavros_msgs/PositionTarget point_5
uint8[5] point_valid # States if respective point is valid.
uint16[5] command # MAV_CMD associated with each point. UINT16_MAX if unused.
float32[5] time_horizon # if type MAV_TRAJECTORY_REPRESENTATION_BEZIER, it represents the time horizon for each point, otherwise set to NaN

@ -0,0 +1,27 @@
# Tunnel
#
# https://mavlink.io/en/messages/common.html#TUNNEL
uint8 target_system
uint8 target_component
uint16 payload_type
uint8 payload_length
uint8[128] payload
# [[[cog:
# import mavros_cog
# mavros_cog.idl_decl_enum('MAV_TUNNEL_PAYLOAD_TYPE', 'PAYLOAD_TYPE_', 16)
# ]]]
# MAV_TUNNEL_PAYLOAD_TYPE
uint16 PAYLOAD_TYPE_UNKNOWN = 0 # Encoding of payload unknown.
uint16 PAYLOAD_TYPE_STORM32_RESERVED0 = 200 # Registered for STorM32 gimbal controller.
uint16 PAYLOAD_TYPE_STORM32_RESERVED1 = 201 # Registered for STorM32 gimbal controller.
uint16 PAYLOAD_TYPE_STORM32_RESERVED2 = 202 # Registered for STorM32 gimbal controller.
uint16 PAYLOAD_TYPE_STORM32_RESERVED3 = 203 # Registered for STorM32 gimbal controller.
uint16 PAYLOAD_TYPE_STORM32_RESERVED4 = 204 # Registered for STorM32 gimbal controller.
uint16 PAYLOAD_TYPE_STORM32_RESERVED5 = 205 # Registered for STorM32 gimbal controller.
uint16 PAYLOAD_TYPE_STORM32_RESERVED6 = 206 # Registered for STorM32 gimbal controller.
uint16 PAYLOAD_TYPE_STORM32_RESERVED7 = 207 # Registered for STorM32 gimbal controller.
uint16 PAYLOAD_TYPE_STORM32_RESERVED8 = 208 # Registered for STorM32 gimbal controller.
uint16 PAYLOAD_TYPE_STORM32_RESERVED9 = 209 # Registered for STorM32 gimbal controller.
# [[[end]]] (checksum: 3327b212af02c2d47d940cd6de049624)

@ -0,0 +1,31 @@
# Vehicle Info msg
std_msgs/Header header
uint8 HAVE_INFO_HEARTBEAT = 1
uint8 HAVE_INFO_AUTOPILOT_VERSION = 2
uint8 available_info # Bitmap shows what info is available
# Vehicle address
uint8 sysid # SYSTEM ID
uint8 compid # COMPONENT ID
# -*- Heartbeat info -*-
uint8 autopilot # MAV_AUTOPILOT
uint8 type # MAV_TYPE
uint8 system_status # MAV_STATE
uint8 base_mode
uint32 custom_mode
string mode # MAV_MODE string
uint32 mode_id # MAV_MODE number
# -*- Autopilot version -*-
uint64 capabilities # MAV_PROTOCOL_CAPABILITY
uint32 flight_sw_version # Firmware version number
uint32 middleware_sw_version # Middleware version number
uint32 os_sw_version # Operating system version number
uint32 board_version # HW / board version (last 8 bytes should be silicon ID, if any)
string flight_custom_version # Custom version field, commonly from the first 8 bytes of the git hash
uint16 vendor_id # ID of the board vendor
uint16 product_id # ID of the product
uint64 uid # UID if provided by hardware

@ -0,0 +1,11 @@
# Metrics typically displayed on a HUD for fixed wing aircraft
#
# VFR_HUD message
std_msgs/Header header
float32 airspeed # m/s
float32 groundspeed # m/s
int16 heading # degrees 0..360
float32 throttle # normalized to 0.0..1.0
float32 altitude # MSL
float32 climb # current climb rate m/s

@ -0,0 +1,7 @@
# VIBRATION message data
# @description: Vibration levels and accelerometer clipping
std_msgs/Header header
geometry_msgs/Vector3 vibration # 3-axis vibration levels
float32[3] clipping # Accelerometers clipping

@ -0,0 +1,45 @@
# Waypoint.msg
#
# ROS representation of MAVLink MISSION_ITEM
# See mavlink documentation
# see enum MAV_FRAME
uint8 frame
uint8 FRAME_GLOBAL = 0
uint8 FRAME_LOCAL_NED = 1
uint8 FRAME_MISSION = 2
uint8 FRAME_GLOBAL_REL_ALT = 3
uint8 FRAME_LOCAL_ENU = 4
uint8 FRAME_GLOBAL_INT = 5
uint8 FRAME_GLOBAL_RELATIVE_ALT_INT = 6
uint8 FRAME_LOCAL_OFFSET_NED = 7
uint8 FRAME_BODY_NED = 8
uint8 FRAME_BODY_OFFSET_NED = 9
uint8 FRAME_GLOBAL_TERRAIN_ALT = 10
uint8 FRAME_GLOBAL_TERRAIN_ALT_INT = 11
uint8 FRAME_BODY_FRD = 12
uint8 FRAME_RESERVED_13 = 13
uint8 FRAME_RESERVED_14 = 14
uint8 FRAME_RESERVED_15 = 15
uint8 FRAME_RESERVED_16 = 16
uint8 FRAME_RESERVED_17 = 17
uint8 FRAME_RESERVED_18 = 18
uint8 FRAME_RESERVED_19 = 19
uint8 FRAME_LOCAL_FRD = 20
uint8 FRAME_LOCAL_FLU = 21
# see enum MAV_CMD and CommandCode.msg
uint16 command
bool is_current
bool autocontinue
# meaning of this params described in enum MAV_CMD
float32 param1
float32 param2
float32 param3
float32 param4
float64 x_lat
float64 y_long
float64 z_alt

@ -0,0 +1,9 @@
# WaypointList.msg
#
# :current_seq: seq nr of currently active waypoint
# waypoints[current_seq].is_current == True
#
# :waypoints: list of waypoints
uint16 current_seq
mavros_msgs/Waypoint[] waypoints

@ -0,0 +1,7 @@
# That message represent MISSION_ITEM_REACHED
#
# :wp_seq: index number of reached waypoint
std_msgs/Header header
uint16 wp_seq

@ -0,0 +1,6 @@
# Stamped wheel odometry message
#
# For streaming timestamped data from FCU wheel encoders (RPM or WHEEL_DISTANCE).
std_msgs/Header header
float64[] data

@ -0,0 +1,46 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>mavros_msgs</name>
<version>2.9.0</version>
<description>
mavros_msgs defines messages for <a href="http://wiki.ros.org/mavros">MAVROS</a>.
</description>
<maintainer email="vooon341@gmail.com">Vladimir Ermakov</maintainer>
<license>GPLv3</license>
<license>LGPLv3</license>
<license>BSD</license>
<url type="website">http://wiki.ros.org/mavros_msgs</url>
<url type="repository">https://github.com/mavlink/mavros.git</url>
<url type="bugtracker">https://github.com/mavlink/mavros/issues</url>
<author email="vooon341@gmail.com">Vladimir Ermakov</author>
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<!-- <depend>builtin_interfaces</depend> -->
<depend>rcl_interfaces</depend>
<depend>geographic_msgs</depend>
<depend>geometry_msgs</depend>
<depend>sensor_msgs</depend>
<!-- <depend>std_msgs</depend> -->
<!-- XXX needed for users of mavlink_convert.h
<build_export_depend>libmavconn</build_export_depend>
-->
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<member_of_group>rosidl_interface_packages</member_of_group>
<export>
<build_type>ament_cmake</build_type>
<ros1_bridge mapping_rules="mavros_msgs_mapping_rule.yaml" />
</export>
</package>

@ -0,0 +1,11 @@
# Generic COMMAND_ACK
uint16 command
uint8 result
uint8 progress
uint32 result_param2
---
bool success
# raw result returned by COMMAND_ACK
uint8 result

@ -0,0 +1,6 @@
# Common type for switch commands
bool value
---
bool success
uint8 result

@ -0,0 +1,10 @@
# request set new home position
bool current_gps
float32 yaw
float32 latitude
float32 longitude
float32 altitude
---
bool success
uint8 result

@ -0,0 +1,19 @@
# Generic COMMAND_INT
bool broadcast # send this command in broadcast mode
uint8 frame
uint16 command
uint8 current
uint8 autocontinue
float32 param1
float32 param2
float32 param3
float32 param4
int32 x # latitude in deg * 1E7 or local x * 1E4 m
int32 y # longitude in deg * 1E7 or local y * 1E4 m
float32 z # altitude
---
bool success
# seems that this message don't produce andy COMMAND_ACK messages
# so no result field

@ -0,0 +1,17 @@
# Generic COMMAND_LONG
bool broadcast # send this command in broadcast mode
uint16 command
uint8 confirmation
float32 param1
float32 param2
float32 param3
float32 param4
float32 param5 # x_lat
float32 param6 # y_lon
float32 param7 # z_alt
---
bool success
# raw result returned by COMMAND_ACK
uint8 result

@ -0,0 +1,10 @@
# Common type for Take Off and Landing
float32 min_pitch # used by takeoff
float32 yaw
float32 latitude
float32 longitude
float32 altitude
---
bool success
uint8 result

@ -0,0 +1,10 @@
#Common type for LOCAL Take Off and Landing
float32 min_pitch # used by takeoff
float32 offset # used by land (landing position accuracy)
float32 rate # speed of takeoff/land in m/s
float32 yaw # in radians
geometry_msgs/Vector3 position #(x,y,z) in meters
---
bool success
uint8 result

@ -0,0 +1,8 @@
# Type for controlling onboard camera triggering system
bool trigger_enable # Trigger enable/disable
bool sequence_reset # Reset the trigger sequence
bool trigger_pause # Pause triggering, but without switching the camera off or retracting it.
---
bool success
uint8 result

@ -0,0 +1,7 @@
# Type for controlling camera trigger interval and integration time
float32 cycle_time # Trigger cycle_time (interval between to triggers) - set to 0 to ignore command
float32 integration_time # Camera shutter integration_time - set to 0 to ignore command
---
bool success
uint8 result

@ -0,0 +1,16 @@
# MAVLink command: DO_VTOL_TRANSITION
# https://mavlink.io/en/messages/common.html#MAV_CMD_DO_VTOL_TRANSITION
std_msgs/Header header
# MAV_VTOL_STATE
uint8 STATE_MC = 3
uint8 STATE_FW = 4
uint8 state # See enum MAV_VTOL_STATE.
---
bool success
uint8 result # Raw result returned by COMMAND_ACK

@ -0,0 +1,14 @@
#
# Adds endpoint to router
#
uint8 TYPE_FCU = 0
uint8 TYPE_GCS = 1
uint8 TYPE_UAS = 2
string url # mavconn URL or topic prefix for TYPE_UAS
uint8 type # should be set to one of the TYPE_xxx
---
bool successful # true if endpoint added and opened
string reason # returns error description if open fails
uint32 id # ID of new endpoint, should be > 0 if endpoint created

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save