Documentation Index Fetch the complete documentation index at: https://mintlify.com/NVlabs/alpasim/llms.txt
Use this file to discover all available pages before exploring further.
The Driver Service (EgodriverService) implements the autonomous driving policy. It receives sensor observations and produces planned trajectories for the ego vehicle.
Service Definition
service EgodriverService {
rpc start_session ( DriveSessionRequest ) returns ( common . SessionRequestStatus );
rpc close_session ( DriveSessionCloseRequest ) returns ( common . Empty );
rpc submit_image_observation ( RolloutCameraImage ) returns ( common . Empty );
rpc submit_egomotion_observation ( RolloutEgoTrajectory ) returns ( common . Empty );
rpc submit_route ( RouteRequest ) returns ( common . Empty );
rpc submit_recording_ground_truth ( GroundTruthRequest ) returns ( common . Empty );
rpc drive ( DriveRequest ) returns ( DriveResponse );
rpc get_version ( common . Empty ) returns ( common . VersionId );
rpc shut_down ( common . Empty ) returns ( common . Empty );
}
Methods
start_session
Initialize a driving session with vehicle and scene configuration.
Unique identifier for this driving session
Random seed for reproducible behavior
Vehicle specification Show RolloutSpec.VehicleDefinition
List of cameras available on the vehicle with intrinsics and extrinsics
Debug information (not present in benchmark runs) Scene identifier for debugging
submit_image_observation
Provide camera images to the driver for perception.
Frame capture start timestamp (microseconds)
Frame capture end timestamp (for rolling shutter)
Encoded image data (PNG/JPEG)
Camera identifier (e.g., “camera_front_wide_120fov”)
submit_egomotion_observation
Provide estimated ego vehicle trajectory (localization output).
Estimated ego rig pose as active transform local→rig_est. This can diverge from the true local→rig transform when error models are enabled.
Estimated velocities and accelerations at current timestamp in rig frame.
May include noise when error models are active.
submit_route
Provide high-level route waypoints to the driver.
Timestamp at which the route is valid
Waypoints expressed in rig frame at the provided timestamp
submit_recording_ground_truth
Provide ground truth trajectory from recording (for testing/validation).
Timestamp at which the ground truth is valid
Ground-truth trajectory from recording (actual path followed).
Each pose is expressed in rig frame at the provided timestamp.
drive
Request a planned trajectory from the driver.
Current simulation time (microseconds)
Time for which trajectory is requested
Optional arbitrary data from renderer for advanced use cases
Planned trajectory as active transform local→rig_est produced by the driver
Binary debug data with custom serialization
Alternative trajectories considered by planner
close_session
Release resources for a session.
Session identifier to close
Usage Example
From alpasim_runtime/services/driver_service.py:
from alpasim_grpc.v0 import egodriver_pb2, egodriver_pb2_grpc
import grpc
# Connect to driver service
channel = grpc.insecure_channel( 'localhost:50051' )
driver_stub = egodriver_pb2_grpc.EgodriverServiceStub(channel)
# Start session
session_request = egodriver_pb2.DriveSessionRequest(
session_uuid = "my-session" ,
random_seed = 42 ,
rollout_spec = egodriver_pb2.DriveSessionRequest.RolloutSpec(
vehicle = egodriver_pb2.DriveSessionRequest.RolloutSpec.VehicleDefinition(
available_cameras = camera_specs
)
)
)
driver_stub.start_session(session_request)
# Submit observations
driver_stub.submit_image_observation(
egodriver_pb2.RolloutCameraImage(
session_uuid = "my-session" ,
camera_image = egodriver_pb2.RolloutCameraImage.CameraImage(
frame_start_us = t_start,
frame_end_us = t_end,
image_bytes = image_data,
logical_id = "camera_front_wide_120fov"
)
)
)
driver_stub.submit_egomotion_observation(
egodriver_pb2.RolloutEgoTrajectory(
session_uuid = "my-session" ,
trajectory = ego_trajectory,
dynamic_state = ego_state
)
)
# Request driving plan
response = driver_stub.drive(
egodriver_pb2.DriveRequest(
session_uuid = "my-session" ,
time_now_us = current_time,
time_query_us = query_time
)
)
planned_trajectory = response.trajectory
print ( f "Planned { len (planned_trajectory.poses) } poses" )
# Clean up
driver_stub.close_session(
egodriver_pb2.DriveSessionCloseRequest( session_uuid = "my-session" )
)
Data Flow
The driver service follows this typical workflow:
Session Initialization : Configure vehicle and scene
Observation Loop :
Receive camera images via submit_image_observation
Receive localization via submit_egomotion_observation
Receive route via submit_route
Planning : Generate trajectory with drive
Session Cleanup : Close session when done