SendTeleopCommand

Bidi Stream:客户端持续发送 VELOCITY 帧,服务端 Stream 应答。与其他 Command 互斥watchdog_timeout_sec 内无 VELOCITY 则自动 STOP / TIMEOUT


10.1 方法签名

rpc SendTeleopCommand(stream TeleopCommandRequest)
    returns (stream TeleopCommandResponse);

10.2 Proto 定义

源文件:autonomy/bridge/proto/external_command_service.proto

enum TeleopCommand {
  TELEOP_CMD_UNSPECIFIED = 0;
  TELEOP_CMD_START = 1;
  TELEOP_CMD_STOP = 2;
  TELEOP_CMD_VELOCITY = 3;
}

enum TeleopStatus {
  TELEOP_STATUS_UNKNOWN = 0;
  TELEOP_STATUS_IDLE = 1;
  TELEOP_STATUS_ACTIVE = 2;
  TELEOP_STATUS_TIMEOUT = 3;
  TELEOP_STATUS_REJECTED = 4;
}

message TeleopCommandRequest {
  RequestHeader header = 1;
  TeleopCommand command = 2;
  commsgs.proto.geometry_msgs.TwistStamped velocity = 3;  // VELOCITY 时必填
  commsgs.proto.builtin_interfaces.Duration session_timeout = 4;
  float max_linear_speed = 5;
  float max_angular_speed = 6;
  float watchdog_timeout_sec = 7;   // 无速度指令超时自动 STOP,0 = 默认
  bool disable_collision_checks = 8;
}

message TeleopCommandResponse {
  CommandAck ack = 1;
  TeleopStatus status = 2;
}

10.3 字段说明

Request · TeleopCommandRequest

字段

类型

必填

说明

header

RequestHeader

03 §3.1

command

TeleopCommand

子命令;见下表

velocity

TwistStamped

VELOCITY

速度指令;Bidi 高频发送

session_timeout

Duration

会话总超时

max_linear_speed

float

线速度上限 (m/s)

max_angular_speed

float

角速度上限 (rad/s)

watchdog_timeout_sec

float

VELOCITY 超时;0 = 默认

disable_collision_checks

bool

是否跳过碰撞检测

TeleopCommand 枚举

常量

说明

1

TELEOP_CMD_START

开启遥操会话

2

TELEOP_CMD_STOP

结束会话 → IDLE

3

TELEOP_CMD_VELOCITY

发送速度(需会话 ACTIVE

Response · TeleopCommandResponse

字段

类型

说明

ack

CommandAck

流应答;末帧 final=true · 03 §3.2

status

TeleopStatus

遥操阶段

TeleopStatusIDLE(1) · ACTIVE(2) · TIMEOUT(3) · REJECTED(4)

VELOCITY 不改变 TeleopStatus(保持 ACTIVE),仅驱动底盘运动;连续发送见 13 §13.14


10.4 示例(grpcurl)

环境01 §1.1 · TC 全集13 §13.9 · Bidi 完整测试13 §13.14

Bidi Stream:上方 发送指令(蓝)、下方 收到结果(绿)。连续 VELOCITY 需 Python 客户端;grpcurl 仅适合 START / 看门狗超时探测。

10.4.1 示例索引

编号

在干什么

command

末帧预期

TC

TEL-01

前置检查 · 确认无冲突任务

无活跃任务

TEL-02

开启会话并测看门狗

1

无 VELOCITY → TIMEOUT

TC-TEL-001

TEL-03

结束遥操会话

2

IDLE

TC-TEL-003

TEL-04

连续 VELOCITY(Bidi)

3

ACTIVE

TC-TEL-002


10.4.2 TEL-01 · 前置检查

START 前确认无其他 Command 占用任务槽(遥操与其他任务互斥)。


10.4.3 TEL-02 · START 看门狗

仅发送 START,不跟 VELOCITYwatchdog_timeout_sec 到期后 Stream 末帧为 TIMEOUT

10.4.4 TEL-03 · STOP

结束遥操会话,底盘停止,任务槽释放。

前提:已有 ACTIVE 遥操会话(TEL-02 或 Python Bidi)。

10.4.5 TEL-04 · VELOCITY(Python)

连续发送 command=3 + velocityBidi Stream,grpcurl 无法完整模拟。

完整脚本 → 13 §13.14