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, get_infractions: bool = False, random_seed: Optional[int] = 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] corrdinate 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.

  • 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.

  • 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.


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])[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.

recurrent_states: List[RecurrentState]#

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