QDAirPortBackendTest/接口文档2.md
2026-01-21 16:20:16 +08:00

6.7 KiB
Raw Permalink Blame History

好的,我已经将您提供的“中机科文档接口文档”内容整理成了标准的 Markdown 格式。我已经去除了原文中的行号和干扰字符,并对 JSON 代码块进行了格式化。


中机科文档接口文档

车辆信息获取接口

1. 接口概述

  • 接口描述:该接口用于上层系统从 FMS 获取车辆信息,按照上层系统提供的测试接口文档返回数据。对于没有数据的字段会标记出来(返回默认值)。
  • 协议名称HTTP
  • 接口地址/api/vehicle_manager/v1/vehicles/{vehicleId}/status
  • 请求方法POST

2. 请求参数

参数位置:路径参数 (Path Parameter) / 查询参数 (Query Parameter)

参数名称 参数类型 是否必须 描述
vehicleId str 查询车号

3. 响应数据

顶层结构

参数名称 参数类型 描述
code int 状态码
message str 响应状态
timestamp float 时间戳
data dict 响应数据详情(见下表)

data 结构详情

字段路径 参数名 类型 描述 备注/默认值
vehicleInfo 车辆信息 dict
vehicleId str 车号
operationalStatus 运行状态 dict
powerStatus str 上电状态 ON/OFF
systemHealth str 系统监控状态 无数据时默认: HEALTHY
operationalMode str 运作模式 无数据时默认: AUTONOMOUS
emergencyStatus str 紧急状态 无数据时默认: NORMAL
lastHeartbeat float 最后心跳
controlStatus 控制状态 dict
controlMode str 控制模式 无数据时默认: MANUAL
controlAuthority str 控制权限 无数据时默认: SYSTEM
remoteControlActive bool 是否激活远控 无数据时默认: true
motionStatus 运动状态 dict
position 位置信息 dict
  ├ latitude float 经度
  └ longitude float 维度
velocity 速度 dict
  ├ speed float 速度
  └ direction float 角度
safetyStatus 安全状态 dict
collisionAvoidanceActive bool 主动避障 无数据时默认: true
emergencyBrakingReady bool 紧急制动
pathPlanningStatus str 路径规划状态 无数据时默认: ACTIVE
obstacleDetectionStatus str 障碍物检测状态 无数据时默认: ACTIVE
minimumRiskManeuverTriggered bool 触发最小风险机动 无数据时默认: true
sensorStatus 传感器状态 dict
gps gps dict
  ├ status str GPS状态 无数据时默认: ACTIVE
  ├ accuracy float 精度 无数据时默认: 0.5
  └ lastUpdate float 最后心跳
batteryStatus 电量信息 dict
mainBattery float (原文此处类型标注可能为dict)
  ├ chargeLevel float 电量
  ├ voltage float 电压 无数据时默认: 0
  ├ current float 电流 无数据时默认: 0
  ├ temperature float 温度 无数据时默认: 0
  └ chargingStatus str 充电状态 无数据时默认: DISCHARGING
communicationStatus 通信状态 dict
v2xStatus string v2x状态 无数据时默认: CONNECTED
cellularSignalStrength int 信号强度 无数据时默认: 0
wifiStatus string 无线网络状态 无数据时默认: CONNECTED
cloudConnectivity string 云连接 无数据时默认: ONLINE
missionContext 任务上下文 dict
currentMission 当前任务 dict
  ├ missionId str 任务ID
  ├ missionType str 任务类型
  ├ startTime float 开始时间
  ├ estimatedEndTime float 预计结束时间 无数据时给默认数据
  ├ progress float 任务进度百分比 无数据时默认: 0
  └ totalMileage float 总里程 无数据时默认: 0
waypoints 路径点列表 list
  └ waypointId str 路径点唯一标识符 无数据时默认: 计数
  └ latitude float 路径点纬度
  └ longitude float 路径点经度
  └ status str 路径点状态 无数据时默认: PENDING

4. 请求示例

curl -X 'POST' \
  'http://10.3.8.22:8020/api/vehicle_manager/v1/vehicles/AET01/status' \
  -H 'accept: application/json' \
  -d ''

5. 响应示例

{
  "code": 200,
  "message": "success",
  "data": {
    "vehicleInfo": {
      "vehicleId": "AET01"
    },
    "operationalStatus": {
      "powerStatus": "ON",
      "systemHealth": "HEALTHY",
      "operationalMode": "AUTONOMOUS",
      "emergencyStatus": "NORMAL",
      "lastHeartbeat": 1767838334301.7153
    },
    "controlStatus": {
      "controlMode": "MANUAL",
      "controlAuthority": "SYSTEM",
      "remoteControlActive": true
    },
    "motionStatus": {
      "position": {
        "latitude": 142.2157,
        "longitude": 148.92
      },
      "velocity": {
        "speed": 0,
        "direction": -1.0080692e-10
      }
    },
    "safetyStatus": {
      "collisionAvoidanceActive": true,
      "emergencyBrakingReady": true,
      "pathPlanningStatus": "ACTIVE",
      "obstacleDetectionStatus": "ACTIVE",
      "minimumRiskManeuverTriggered": true
    },
    "sensorStatus": {
      "gps": {
        "status": "ACTIVE",
        "accuracy": 0.5,
        "lastUpdate": 1767838334301.7153
      }
    },
    "batteryStatus": {
      "mainBattery": {
        "chargeLevel": "0.0",
        "voltage": 0,
        "current": 0,
        "temperature": 0,
        "chargingStatus": "DISCHARGING"
      }
    },
    "communicationStatus": {
      "v2xStatus": "CONNECTED",
      "cellularSignalStrength": 0,
      "wifiStatus": "CONNECTED",
      "cloudConnectivity": "ONLINE"
    },
    "missionContext": {
      "currentMission": {
        "missionId": null,
        "missionType": "",
        "startTime": 0,
        "estimatedEndTime": 0,
        "progress": 0,
        "totalMileage": 0
      },
      "waypoints": []
    }
  },
  "timestamp": 1767838334301.7153
}