DRIVE#

invertedai.api.drive(location: str, agent_states: List[AgentState], agent_attributes: List[AgentAttributes], recurrent_states: List[RecurrentState], traffic_lights_states: Optional[Dict[int, TrafficLightState]] = None, get_birdview: bool = False, rendering_center: Optional[Tuple[float, float]] = None, rendering_fov: Optional[float] = None, get_infractions: bool = False, random_seed: Optional[int] = None, model_version: Optional[str] = None) DriveResponse[source]#
Parameters:
  • location – Location name in IAI format.

  • agent_states – Current states of all agents. The state must include x: [float], y: [float] coordinate in meters orientation: [float] in radians with 0 pointing along x and pi/2 pointing along y and speed: [float] in m/s.

  • agent_attributes – Static attributes of all agents. List of agent attributes. Each agent requires, length: [float] width: [float] and rear_axis_offset: [float] all in meters. agent_type: [str], currently only supports ‘car’, but support for ‘pedestrian’ will be added in the future

  • recurrent_states – Recurrent states for all agents, obtained from the previous call to drive() or initialize().

  • get_birdview – Whether to return an image visualizing the simulation state. This is very slow and should only be used for debugging.

  • rendering_center – Optional center coordinates for the rendered birdview.

  • rendering_fov – Optional fov for the rendered birdview.

  • get_infractions – Whether to check predicted agent states for infractions. This introduces some overhead, but it should be relatively small.

  • traffic_lights_states – If the location contains traffic lights within the supported area, their current state should be provided here. Any traffic light for which no state is provided will be ignored by the agents.

  • random_seed – Controls the stochastic aspects of agent behavior for reproducibility.

  • model_version – Optionally specify the version of the model. If None is passed which is by default, the best model will be used.


class invertedai.api.DriveResponse(*, agent_states: List[AgentState], recurrent_states: List[RecurrentState], birdview: Optional[Image] = None, infractions: Optional[List[InfractionIndicators]] = None, is_inside_supported_area: List[bool], model_version: str)[source]#

Response returned from an API call to iai.drive().

agent_states: List[AgentState]#

Predicted states for all agents at the next time step.

birdview: Optional[Image]#

If get_birdview was set, this contains the resulting image.

infractions: Optional[List[InfractionIndicators]]#

If get_infractions was set, they are returned here.

is_inside_supported_area: List[bool]#

For each agent, indicates whether the predicted state is inside supported area.

model_version: str#
recurrent_states: List[RecurrentState]#

To pass to iai.drive() at the subsequent time step.