syntax = "proto3";

package device.proto.robotics.nav;
option csharp_namespace = "Al.Proto.Api.Robotics.Nav";

import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/struct.proto";

//平面2d位姿
message Pose2d {
  double x = 1; //平移x
  double y = 2; //平移y
  double yaw = 3; //角度
}

message NavigateThroughPosesRequest {
    repeated Pose2d pose2ds = 1;
}

//摇杆控制请求
message JoyAgvRequest {
    //x方向的速度
    double vx = 1;
    //y方向的速度
    double vy = 2;
    //角速度
    double angle = 3;
}

message Response {
    //响应的状态码
    string status_code = 1;
    //失败时的错误原因
    string message = 2;
    //附带的响应内容
    google.protobuf.Struct data = 3;
}

service ChassisNavigationService {
    //订阅车体位姿更新
    rpc OnVehiclePoseUpdated(google.protobuf.Empty) returns (stream Response) {}
    //订阅跟踪的物体的位姿更新
    rpc OnTrackingPoseUpdated(google.protobuf.Empty) returns (stream Response) {}
    //导航到指定位姿
    rpc NavigateToPose(Pose2d) returns (Response) {}
    //路径导航
    rpc NavigateThroughPoses(NavigateThroughPosesRequest) returns (Response) {}
    //货叉纵向控制
    rpc ForkControl(google.protobuf.DoubleValue) returns (Response) {}
    //订阅机器人状态更新
    rpc OnRobotStateUpdated(google.protobuf.Empty) returns (stream Response) {}
    //监听订阅底盘主IMU数据的更新
    rpc OnChassesMainImuDataUpdated(google.protobuf.Empty) returns (stream Response) {}
    //监听车体用于定位的里程计更新
    rpc OnChassesOdometryUpdated(google.protobuf.Empty) returns (stream Response) {}
    //监听雷达里程计更新
    rpc OnPerceptionLaserOdometryUpdated(google.protobuf.Empty) returns (stream Response) {}
    //监听轮式里程计更新
    rpc OnWheelOdometryUpdated(google.protobuf.Empty) returns (stream Response) {}
    //机器人故障状态
    rpc OnRobotFaultStatusUpdated(google.protobuf.Empty) returns (stream Response) {}
    //摇杆车体运动控制
    rpc JoyAgvControl(JoyAgvRequest) returns (Response) {}
    //摇杆货叉运动控制
    rpc JoyForkControl(google.protobuf.Struct) returns (Response) {}
}




