---
# System prepended metadata

title: 無人機PASS 架構圖
tags: [無人機, "\_PaaS"]

---


# PASS 架構圖
![k8s_computerv2_uav.drawio (1)](https://hackmd.io/_uploads/HJjqCdkhgl.svg)

## WINDOWS LAPTOP 架構
![aaawindows.drawio](https://hackmd.io/_uploads/By8dhmH2el.svg)





## STATUS 轉發 WEBSOCKET 時序圖
![status2websock.drawio](https://hackmd.io/_uploads/SJm_t52oeg.png)



## json 轉mavlink時序圖
![JSON2MAV.drawio (1)](https://hackmd.io/_uploads/BypCxmsoee.png)

#  SASS to PASS 請求事件
## 任務規劃流程範例 JSON（）
### 流程圖
![uavmission_sasstopass.drawio (1)](https://hackmd.io/_uploads/HkYMdt7Ree.png)


### request body
```
{
  "drone_uuid": "e1b5e429-a24d-4588-bfe9-a923283e2993",
  "commands": [
    {
      "message_id": 73,
      "payload": {
        "1": 5,
        "2": 2,
        "5": 226272780,
        "6": 1202850990,
        "7": 10,
        "CommandName": "NAV_WAYPOINT",
        "command": 16
      }
    }
  ]
}
```
### response body  success
```
{
    "status": "received_success",
    "message": "mission upload.",   
    "drone_uuid": "e1b5e429-a24d-4588-bfe9-a923283e2993"
}
```
### respones body fail
```
{
    "status": "received_fail",
    "CommandName": "NAV_WAYPOINT ...",
    "drone_uuid": "e1b5e429-a24d-4588-bfe9-a923283e2993",
    "message": "miss params 1 ..."    
}
```



# PASS to SASS 狀態事件


## 狀態流程json()

| 參數      | 名稱         | 單位     | 說明          |
| -------- | --------     | -------- | --------    |
|  1       | mission      | bool     | 是否執行任務  |
|  2       | flight_mode  | string   | 飛行模式     |
|  3       | battery      | int32    |剩餘電量，單位(%)|
|  4       | lat          | double   | 緯度        |
|  5       | lon          | double   | 經度        |
|  6       | alt          | double   | 海拔高度，單位(m)|
|  7       | hdg          | double   | 機頭朝向0~359.99     |
|  8       | vx           | double   | x軸移動速度  |
|  9       | vy           | double   | y軸移動速度  |
| 10       | vz           | double   | 垂直移動入速度|
| 11       | roll         | double   | 機體左右傾斜角|
| 12       | pitch        | double   | 機體前後傾斜角|
| 13       | yaw          | double   | 機體朝向角   |
| 14       | arm          | int32    | 解鎖時間     |
| 15       | mission_ack  | string   | 任務回覆狀態 |
| 16       | command_ack  | string   | 指令回覆狀態 |
| 17       | source_id    | string   | 無人機uuid  |
### request body
```

 {
 "event": "send_to_message",
 "expect_response": true,
 "target_client_id": "e1b5e429-a24d-4588-bfe9-a923283e2993",
 "drone_uuid": "drone1",
 "message": {
    "alt": 3.46,
    "arm": 0,
    "battery": 0,
    "command_ack": "18:08:41 cmd:0 ack:MAV_RESULT_ACCEPTED",
    "flight_mode": "Auto",
    "hdg": 107.98,
    "lat": 23.4628168,
    "lon": 120.2669566,
    "mission": false,
    "mission_ack": "",
    "pitch": -0.0006779595278203487,
    "roll": -0.0013380491873249412,
    "vx": 0.01,
    "vy": 0.02,
    "vz": 0,
    "yaw": 1.8847218751907349,
       
       }
     }    




```
### response body
```




```

