Skip to content

SRBC gRPC Protobuf Definitions

This repository contains the Protocol Buffers contracts used by the srbc_grpc package. The files define shared gRPC services and messages for camera streaming, diagnostics, localization, vehicle telemetry, and common utility types.

Project Structure

File Purpose
camera.proto Defines camera stream control, image payloads, heartbeat messages, and last saved image retrieval.
diag.proto Defines the diagnostics streaming service and aggregates robot, vehicle, localization, and autonomy status messages.
localization.proto Defines robot localization, GNSS/RTK status, pose, orientation, and localization status flags.
vehicle.proto Defines vehicle telemetry such as motors, battery, cylinders, IMU values, and input states.
geometry2d.proto Defines reusable 2D pose, twist, and odometry messages in SI units.
empty.proto Defines an empty request/response message for RPCs that do not require parameters.
success.proto Defines a simple success response message.

Package

All protobuf files use the same package:

package srbc_grpc;

Generated code should therefore expose all messages and services under the srbc_grpc namespace/package for the target language.

Services

CameraService

CameraService provides camera-related streaming and image retrieval RPCs:

service CameraService {
    rpc GetCameraStream(stream CameraStreamControl) returns (stream CameraStreamMessage);
    rpc GetLastSavedImages(GetLastSavedImagesRequest) returns (GetLastSavedImagesResponse);
}
  • GetCameraStream is a bidirectional stream used to start or stop camera streaming and receive image or heartbeat payloads.
  • GetLastSavedImages returns the latest saved images and can confirm that the client received them.

DiagService

DiagService provides a diagnostics stream:

service DiagService {
    rpc GetDiag(Empty) returns (stream DiagStreamMessage){}
}
  • GetDiag streams diagnostic payloads and heartbeat messages for robot status monitoring.

Status Flags

Several messages expose status fields as unsigned 64-bit bitmasks:

  • VehicleStatus.status
  • AutoStatus.status
  • Localization.loc_status

The enums grouped as Info, Warn, and Error document the intended bit ranges:

  • Info bits: [0-15]
  • Warning bits: [16-31]
  • Error bits: [32-63]

Generate Code

Install protoc and the gRPC plugin for your target language before running code generation.

Example for Python:

python -m grpc_tools.protoc \
  -I . \
  --python_out=. \
  --grpc_python_out=. \
  *.proto

Example for C++:

protoc \
  -I . \
  --cpp_out=. \
  --grpc_out=. \
  --plugin=protoc-gen-grpc="$(which grpc_cpp_plugin)" \
  *.proto

Run the commands from the repository root so imports such as geometry2d.proto and empty.proto resolve correctly.

Compatibility Notes

  • Keep existing field numbers stable once messages are consumed by clients or servers.
  • Add new fields with new field numbers instead of reusing removed ones.
  • Prefer adding new enum values rather than changing the meaning of existing values.

About

SRBC gRPC Protobuf Definitions

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors