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.
| 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. |
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.
CameraService provides camera-related streaming and image retrieval RPCs:
service CameraService {
rpc GetCameraStream(stream CameraStreamControl) returns (stream CameraStreamMessage);
rpc GetLastSavedImages(GetLastSavedImagesRequest) returns (GetLastSavedImagesResponse);
}GetCameraStreamis a bidirectional stream used to start or stop camera streaming and receive image or heartbeat payloads.GetLastSavedImagesreturns the latest saved images and can confirm that the client received them.
DiagService provides a diagnostics stream:
service DiagService {
rpc GetDiag(Empty) returns (stream DiagStreamMessage){}
}GetDiagstreams diagnostic payloads and heartbeat messages for robot status monitoring.
Several messages expose status fields as unsigned 64-bit bitmasks:
VehicleStatus.statusAutoStatus.statusLocalization.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]
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=. \
*.protoExample for C++:
protoc \
-I . \
--cpp_out=. \
--grpc_out=. \
--plugin=protoc-gen-grpc="$(which grpc_cpp_plugin)" \
*.protoRun the commands from the repository root so imports such as geometry2d.proto and empty.proto resolve correctly.
- 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.