cmvr-es/protos/cmvr/api/agv_command.proto
2026-06-17 14:50:37 +08:00

425 lines
12 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

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.

syntax = "proto3";
import "cmvr/api/common.proto";
package cmvr.api;
// AGV状态信息
message AgvStatusInfo {
optional string id = 1; // AGV ID
optional string vehicle_id = 2; // 车辆ID
optional string version = 3; // 软件版本
optional string model = 4; // 型号
optional string dsp_version = 5; // DSP版本
optional string current_ip = 6; // 当前IP地址
optional string mac = 7; // MAC地址
optional int32 rssi = 8; // 信号强度
optional int32 ret_code = 9; // 返回码
optional string err_msg = 10; // 错误信息
}
// 获取AGV状态命令
message GetAgvStatusInfoCommand {
message Request {
CommandHeader.Request header = 1;
}
message Feedback {
CommandHeader.Feedback header = 1;
AgvStatusInfo status = 2;
}
}
// ===================== 电池状态查询 =====================
message AgvBatteryStatus {
optional double battery_level = 1; // 电池电量 [0,1]
optional double battery_temp = 2; // 电池温度 ℃
optional bool charging = 3; // 是否正在充电
optional double voltage = 4; // 电压 V
optional double current = 5; // 电流 A
optional double max_charge_voltage = 6; // 最大充电电压,-1=不支持
optional double max_charge_current = 7; // 最大充电电流,-1=不支持
optional bool manual_charge = 8; // 手动充电状态
optional bool auto_charge = 9; // 自动充电状态
optional int32 battery_cycle = 10; // 电池循环次数
optional string battery_user_data = 11; // 电池自定义数据
optional string extra = 12; // 客户自定义数据
optional int32 ret_code = 13; // 错误码
optional string create_on = 14; // 时间戳
optional string err_msg = 15; // 错误信息
}
message RobotStatusBatteryRequestData {
optional bool simple = 1; // true:仅简单数据 false:全量数据默认false
}
message RobotStatusBatteryCommand {
message Request {
CommandHeader.Request header = 1;
RobotStatusBatteryRequestData data = 2;
}
message Feedback {
CommandHeader.Feedback header = 1;
AgvBatteryStatus status = 2;
}
}
// ===================== 机器人位置查询 =====================
message AgvRobotLocation {
optional double x = 1; // X坐标(m)
optional double y = 2; // Y坐标(m)
optional double angle = 3; // 姿态角(rad)
optional double confidence = 4; // 定位置信度[0,1]
optional string current_station = 5; // 当前最近站点ID
optional string last_station = 6; // 上一站点ID
optional int32 loc_method = 7; // 定位方式
optional int32 ret_code = 8; // 错误码
optional string create_on = 9; // 时间戳
optional string err_msg = 10; // 错误信息
}
message RobotStatusLocCommand {
message Request {
CommandHeader.Request header = 1;
}
message Feedback {
CommandHeader.Feedback header = 1;
AgvRobotLocation status = 2;
}
}
// ===================== 地图下载 =====================
message RobotConfigDownloadMapRequestData {
optional string map_name = 1;
}
message AgvDownloadMapResult {
optional int32 ret_code = 1;
optional string create_on = 2;
optional string err_msg = 3;
optional string map_content = 4;
}
message RobotConfigDownloadMapCommand {
message Request {
CommandHeader.Request header = 1;
RobotConfigDownloadMapRequestData data = 2;
}
message Feedback {
CommandHeader.Feedback header = 1;
AgvDownloadMapResult status = 2;
}
}
// 单条地图文件信息
message MapFileInfo {
optional string name = 1;
optional string modified = 2;
optional int64 size = 3;
}
// 地图查询响应
message AgvMapStatus {
optional string current_map = 1;
optional string current_map_md5 = 2;
repeated string maps = 3;
repeated MapFileInfo map_files_info = 4;
optional int32 ret_code = 5;
optional string create_on = 6;
optional string err_msg = 7;
}
// 查询地图状态命令
message RobotStatusMapCommand {
message Request {
CommandHeader.Request header = 1;
}
message Feedback {
CommandHeader.Feedback header = 1;
AgvMapStatus status = 2;
}
}
// ===================== 上传地图 =====================
message RobotConfigUploadMapRequestData {
optional string map_content = 1;
}
message AgvUploadMapResult {
optional int32 ret_code = 1;
optional string create_on = 2;
optional string err_msg = 3;
}
message RobotConfigUploadMapCommand {
message Request {
CommandHeader.Request header = 1;
RobotConfigUploadMapRequestData data = 2;
}
message Feedback {
CommandHeader.Feedback header = 1;
AgvUploadMapResult status = 2;
}
}
// ===================== 抢占控制权 ======================
// 抢占控制权 请求参数
message RobotConfigLockRequestData {
// 控制权抢占者名称,必填
optional string nick_name = 1;
}
// 抢占控制权 返回结果
message AgvLockResult {
// API错误码
optional int32 ret_code = 1;
// API上传时间戳
optional string create_on = 2;
// 错误描述信息
optional string err_msg = 3;
}
// 抢占控制权 命令封装
message RobotConfigLockCommand {
message Request {
CommandHeader.Request header = 1;
// 请求业务参数
RobotConfigLockRequestData data = 2;
}
message Feedback {
CommandHeader.Feedback header = 1;
// 抢占控制权响应数据
AgvLockResult status = 2;
}
}
// ===================== 查询当前控制权所有者 ======================
// 查询当前控制权所有者响应结构体
message AgvCurrentLockStatus {
// 当前控制权是否被抢占
optional bool locked = 1;
// 抢占方IP
optional string ip = 2;
// 抢占方端口
optional int32 port = 3;
// 抢占者类型 0=default 2=roboshop 0xDD=srd
optional uint32 type = 4;
// 抢占者昵称
optional string nick_name = 5;
// 抢占时间戳 单位秒
optional int64 time_t = 6;
// 抢占方描述信息
optional string desc = 7;
// 接口错误码
optional int32 ret_code = 8;
// 接口时间戳
optional string create_on = 9;
// 错误信息
optional string err_msg = 10;
}
// 查询当前控制权指令
message RobotStatusCurrentLockCommand {
message Request {
CommandHeader.Request header = 1;
}
message Feedback {
CommandHeader.Feedback header = 1;
AgvCurrentLockStatus status = 2;
}
}
//==================== 开环速度运动控制 命令码2010(0x07DA) ====================
// 下发指令会强制取消当前正在执行的自动导航任务
// 多舵轮设备仅解析vx/vy/wsteer、real_steer仅单舵轮设备生效
// vxX轴速度 m/svyY轴速度 m/sw旋转角速度 rad/s逆时针为正、顺时针为负
// steer单舵轮档位控制 -2回零 / ±15°增减real_steer目标舵角rad优先级高于steer
// duration持续时间ms0=永久运行缺省读取全局参数ControlMotionDuration(默认500ms)
message RobotMotionControlRequestData {
optional double vx = 1;
optional double vy = 2;
optional double w = 3;
optional double steer = 4;
optional double real_steer = 5;
optional int64 duration = 6;
}
message RobotMotionControlResult {
optional int32 ret_code = 1;
optional string create_on = 2;
optional string err_msg = 3;
}
message RobotMotionControlCommand {
message Request {
CommandHeader.Request header = 1;
RobotMotionControlRequestData data = 2;
}
message Feedback {
CommandHeader.Feedback header = 1;
RobotMotionControlResult status = 2;
}
}
//==================== 切换载入地图 命令码2022(0x07E6) ====================
// 切换指定地图合法地图会更新设备current_map字段
message RobotLoadMapRequestData {
optional string map_name = 1; // 地图名,仅字母数字-_不可缺省
}
message RobotLoadMapResult {
optional int32 ret_code = 1;
optional string create_on = 2;
optional string err_msg = 3;
}
message RobotLoadMapCommand {
message Request {
CommandHeader.Request header = 1;
RobotLoadMapRequestData data = 2;
}
message Feedback {
CommandHeader.Feedback header = 1;
RobotLoadMapResult status = 2;
}
}
//==================== 查询地图载入状态 命令码1022(0x03FE) ====================
// loadmap_status:0失败 1成功 2载入中LOADING状态不可重定位
message RobotQueryLoadMapStatusResult {
optional int32 loadmap_status = 1;
optional int32 ret_code = 2;
optional string create_on = 3;
optional string err_msg = 4;
}
message RobotQueryLoadMapStatusCommand {
message Request {
CommandHeader.Request header = 1;
}
message Feedback {
CommandHeader.Feedback header = 1;
RobotQueryLoadMapStatusResult status = 2;
}
}
//==================== 查询当前地图所有站点信息 命令码1301(0x0515) ====================
message StationItem {
optional string id = 1;
optional string type = 2;
optional double x = 3;
optional double y = 4;
optional double r = 5;
optional string desc = 6;
optional string executor = 7;
optional string prepoint = 8;
optional string recfile = 9;
optional bool spin = 10;
optional bool use_down_pgv = 11;
}
message QueryStationListResult {
repeated StationItem stations = 1;
optional int32 ret_code = 2;
optional string create_on = 3;
optional string err_msg = 4;
}
message QueryStationListCommand {
message Request {
CommandHeader.Request header = 1;
}
message Feedback {
CommandHeader.Feedback header = 1;
QueryStationListResult status = 2;
}
}
//==================== 指定路径导航 命令码3066(0x0BFA) ====================
// 单段导航任务单元
message MoveTaskItem {
optional string task_id = 1;
optional string source_id = 2;
optional string id = 3;
optional string operation = 4;
optional double jack_height = 5;
}
// 指定路径导航请求体
message RobotGoTargetListRequestData {
repeated MoveTaskItem move_task_list = 1;
}
// 指定路径导航返回结果
message RobotGoTargetListResult {
optional int32 ret_code = 1;
optional string create_on = 2;
optional string err_msg = 3;
}
message RobotGoTargetListCommand {
message Request {
CommandHeader.Request header = 1;
RobotGoTargetListRequestData data = 2;
}
message Feedback {
CommandHeader.Feedback header = 1;
RobotGoTargetListResult status = 2;
}
}
//==================== 查询当前导航状态 robot_status_task_req 1020(0x03FC) 应答0x2B0C ====================
message QueryCurrentNavReqData {
optional bool simple = 1;
}
message NavContainerItem {
optional string container_name = 1;
optional string desc = 2;
optional string goods_id = 3;
optional bool has_goods = 4;
}
message QueryCurrentNavResData {
optional int32 task_status = 1;
optional int32 task_type = 2;
optional string target_id = 3;
repeated double target_point = 4;
repeated string finished_path = 5;
repeated string unfinished_path = 6;
optional string move_status_info = 7;
repeated NavContainerItem containers = 8;
optional int32 ret_code = 9;
optional string create_on = 10;
optional string err_msg = 11;
}
message RobotStatusTaskCommand {
message Request {
CommandHeader.Request header = 1;
QueryCurrentNavReqData data = 2;
}
message Feedback {
CommandHeader.Feedback header = 1;
QueryCurrentNavResData data = 2;
}
}