syntax = "proto3";

package CompLib;

message Header {
  string message_type = 1;
}

message Status {
  bool successful = 1;
  string error_message = 2;
}

message GenericRequest {
  Header header = 1;
}

message GenericResponse {
  Header header = 1;
  Status status = 2;
}

message EncoderReadPositionsRequest {
  Header header = 1;
}

message EncoderReadPositionsResponse {
  Header header = 1;
  Status status = 2;
  repeated int32 positions = 3 [packed = true];
}

message EncoderReadVelocitiesRequest {
  Header header = 1;
}

message EncoderReadVelocitiesResponse {
  Header header = 1;
  Status status = 2;
  repeated double velocities = 3 [packed = true];
}

message IRSensorsEnableRequest {
  Header header = 1;
}

message IRSensorsDisableRequest {
  Header header = 1;
}

message IRSensorsReadAllRequest {
  Header header = 1;
}

message IRSensorsReadAllResponse {
  Header header = 1;
  Status status = 2;
  repeated uint32 data = 3 [packed = true];
}

message MotorsSetPowerRequest {
  Header header = 1;
  uint32 port = 2;
  double power = 3;
}

message MotorsSetSpeedRequest {
  Header header = 1;
  uint32 port = 2;
  double speed = 3;
}

message OdometryReadRequest {
  Header header = 1;
}

message OdometryReadResponse {
  Header header = 1;
  Status status = 2;
  double x_position = 3;
  double y_position = 4;
  double orientation = 5;
}

message DriveDistanceRequest {
  Header header = 1;
  double distance_m = 2;
  double velocity_m_s = 3;
}

message TurnDegreesRequest {
  Header header = 1;
  double angle_degrees = 2;
  double velocity_rad_s = 3;
}

message DriveRequest {
  Header header = 1;
  double linear_velocity_m_s = 2;
  double angular_velocity_rad_s = 3;
}