This folder contains gRPC definitions for interoperation between alpasim components and certain common utility functions.
Refer to CONTRIBUTING.md for the coordinate frame conventions shared across the runtime and gRPC APIs.
The APIs defined in this repository are used by the alpasim components, including in additional repositories:
- Neural rendering engine
- Traffic model (coming soon)
- Physics model
- Driver
Protobuf definitions compiled into python are not packaged and must be compiled first with running
uv run compile-protosfrom this folder. This does not happen automatically when installing the
gRPC package!
This command also re-compiles them after you changed the definitions.
You can also clean them with
uv run clean-protosPrimarily this repository contains protobufs specifying the microservice APIs. After installing usage is as follows:
import grpc
from alpasim_grpc.v0.sensorsim_pb2 import RenderRequest, RenderReturn
from alpasim_grpc.v0.sensorsim_pb2_grpc import SensorsimServiceStub
with grpc.insecure_channel('host:port') as channel:
service = SensorsimServiceStub(channel)
render_request = RenderRequest(
scene_id="scene_id",
# ...
)
response: RenderReturn = service.render(render_request)