CollisionAvoidance/docs/official_api.md

123 lines
4.6 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 数据接口对接方案
## 第1章 位置数据接口对接方案
### 1.1 登录认证
1. 登录接口:<http://IP:端口/login>
2. 请求方式post
3. 参数username、password
4. 示例:<http://127.0.0.1:8080/login?username=XXXX&password=XXXX>
5、返回值 data 为返回的鉴权token后续接口需要再header中携带data所有的数据是一个token不要截断
示例:{
    "status": 200,
    "msg": "登入成功",
    "data": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MzI3ODMwOTAsInVzZXJuYW1lIjoiYWRtaW4ifQ.y9feEL_9NT8UzED9NNkb0Ln6C-PBoufiSHWobWe5vWY"
}
### 1.2 航空器位置数据接入
数据来源:接入并转发从空管接收到的融合数据
1. 接口地址:<http://IP:端口/openApi/getCurrentFlightPositions>
2. 请求方式get需要在 Header 中携带认证信息,字段名为 Authorization值为认证接口返回的token
3. 返回格式:以 JSON 格式返回数据一次请求返回List集合对象
4. 数据结构:
| 序号 | 字段 | 描述 | 字段类型 | 是否必填 |
|-----|------|------|----------|----------|
| 1 | flightNo | 航班号 | String | 是 |
| 2 | longitude | 经度 | double | 是 |
| 3 | latitude | 纬度 | double | 是 |
| 4 | time | 时间戳UTC 时间) | long | 是 |
| 5 | altitude | 海拔高度 | double | 否 |
| 6 | trackNumber | 航迹号 | long | 否 |
### 1.3 车辆位置数据接入
数据来源:仅传递目前机场已接入的车辆位置数据
1. 接口地址:<http://IP:端口/openApi/getCurrentVehiclePositions>
2. 请求方式get需要在 Header 中携带认证信息,字段名为 Authorization值为认证接口返回的token
3. 返回格式:以 JSON 格式返回数据一次请求返回List集合对象
4. 数据结构:
| 序号 | 字段 | 描述 | 字段类型 | 是否必填 |
|-----|------|------|----------|----------|
| 1 | vehicleNo | 车牌号 | String | 是 |
| 2 | longitude | 经度 | double | 是 |
| 3 | latitude | 纬度 | double | 是 |
| 4 | time | 时间戳 | long | 是 |
| 5 | direction | 方向 | double | 否 |
| 6 | speed | 速度 | double | 否 |
## 第2章 无人车控制接口对接方案
### 2.1 无人车控制指令
2.1.1 接口地址: <http://127.0.0.1:31140/api/VehicleCommandInfo>
2.1.2 请求方法POST
2.1.3 请求参数:
| 字段名称 | 类型 | 是否必填 | 说明 |
|---------|------|----------|------|
| transId | string | 是 | 消息唯一 id消息的唯一标识符 |
| timestamp | long | 是 | 时间戳 |
| vehicleID | string | 是 | 车辆 ID |
| commandType | string | 是 | 指令类型ALERT告警指令SIGNAL信号灯指令WARNING预警指令RESUME恢复指令 |
| commandReason | string | 是 | 指令原因TRAFFIC_LIGHT红绿灯控制AIRCRAFT_CROSSING航空器交叉SPECIAL_VEHICLE特勤车辆AIRCRAFT_PUSH航空器推出RESUME_TRAFFIC恢复通行 |
| signalState | string | 否 | 信号灯状态(仅当 commandType 为 SIGNAL 时有效RED红灯GREEN绿灯YELLOW黄灯 |
| intersectionId | string | 否 | 路口 ID仅当 commandType 为 SIGNAL 时有效) |
| latitude | double | 是 | 目标位置纬度(路口/航空器/特勤车) |
| longitude | double | 是 | 目标位置经度(路口/航空器/特勤车) |
| relativeSpeed | double | 否 | 相对速度(仅当 commandType 为 ALERT/WARNING 时有效) |
| relativeMotionX | double | 否 | 相对运动 X 分量(仅当 commandType 为 ALERT/WARNING 时有效) |
| relativeMotionY | double | 否 | 相对运动 Y 分量(仅当 commandType 为 ALERT/WARNING 时有效) |
| minDistance | double | 否 | 最小距离(仅当 commandType 为 ALERT/WARNING 时有效) |
示例:
requestData:
{
"messageUniqueId": "68f79d1a-e27f-11ed-b28c-2cf05d9c2649",
"timestamp": 1736175610000,
"vehicleID": "A001",
"commandType": "SIGNAL",
"commandReason": "TRAFFIC_LIGHT",
"signalState":"RED",
"intersectionId":"002",
"latitude": 343.23,
"longitude": 343.23,
"relativeSpeed": 3,
"relativeMotionX": 2002.12,
"relativeMotionY":100.12,
"minDistance":10.5
}
返回值:
| 字段名 | 类型 | 是否必须 | 描述 |
|---------|------|----------|------|
| transId | string | 是 | 消息唯一id消息的唯一标识符与请求id一致 |
| timestamp | long | 是 | 时间戳 |
| code | int | 是 | 接口返回的状态码200 请求成功400 请求失败并在msg内返回原因 |
| msg | string | 是 | 接口成功/失败的原因或者附加提示信息 |
示例:
responseData:
{
"code": 200,
"msg": "success",
"transId": "68f79d1a-e27f-11ed-b28c-2cf05d9c2649",
"timestamp": 1736175610
}