invertedai_simulate package#
Subpackages#
Submodules#
invertedai_simulate.interface module#
- class invertedai_simulate.interface.IAIEnv(config)[source]#
Bases:
gym.core.Env
A gym environment that connects to the iai server application running the simulation
- action_space: gym.spaces.space.Space[gym.core.ActType]#
- close()[source]#
Override close in your subclass to perform any necessary cleanup.
Environments will automatically
close()
themselves when garbage collected or when the program exits.
- observation_space: gym.spaces.space.Space[gym.core.ObsType]#
- render_init(sensors_dict, renderer='pygame', scale=1, notebook_display=None, notebook_image=None)[source]#
- set_scenario(scenario_name, world_parameters=None, vehicle_physics=None, scenario_parameters=None, sensors=None)[source]#
- Parameters
scenario_name –
world_parameters –
vehicle_physics –
scenario_parameters –
sensors –
- Returns
- Return type
invertedai_simulate.utils module#
- class invertedai_simulate.utils.ClientSideBoundingBoxes[source]#
Bases:
object
This is a module responsible for creating 3D bounding boxes and drawing them client-side on pygame surface.
- static draw_bounding_boxes_on_array(img, actor_tracks, draw2d=False, occlusion=False)[source]#
Draws bounding boxes on the given image from the camera.
- class invertedai_simulate.utils.ControllerNoiseType[source]#
Bases:
object
- TEMPORAL = 'temporal'#
- UNIFORM = 'uniform'#
- class invertedai_simulate.utils.Display(res: invertedai_simulate.utils.Resolution = Resolution(width=1280, height=720))[source]#
Bases:
object
Base class for displays that does nothing with received image.
- Parameters
res (
Res
) – Resolution of this display.
- attach_to(feed) None [source]#
Attach to a specific camera.
- Parameters
feed (
sensors.Camera
) – Camera to attach to.
- destroy() None [source]#
Disconnect from camera and close self. Can’t be restarted after destroying.
- intercept_event(event: <module 'pygame.event' from '/home/docs/checkouts/readthedocs.org/user_builds/invertedai-simulate/envs/latest/lib/python3.8/site-packages/pygame/event.cpython-38-x86_64-linux-gnu.so'>) bool [source]#
- render(array: numpy.ndarray, offset: Tuple[int, int] = (0, 0)) None [source]#
Process the provided camera image.
- Parameters
array (np.array of np.uint8) – Height by width by 3 (RGB color channels) image array.
offset – Position of the top left corner in screen coordinates to start rendering from. Subclasses may ignore it if not supported.
- resize(res: invertedai_simulate.utils.Resolution) None [source]#
Change own resolution and reconnect to the camera, so it can adjust the images sent.
- Parameters
res (
Res
) – New resolution.
- exception invertedai_simulate.utils.NotSpawnedError[source]#
Bases:
RuntimeError
Indicates an attempt to use a sensor that is not instantiated in any world.
- class invertedai_simulate.utils.PyGameWindow(res: invertedai_simulate.utils.Resolution = Resolution(width=1280, height=720), fullscreen: bool = False)[source]#
Bases:
invertedai_simulate.utils.Display
PyGame window displayed on the monitor. Using fake display with pygame will make it invisible. The window is necessary to capture key strokes.
- intercept_event(event: <module 'pygame.event' from '/home/docs/checkouts/readthedocs.org/user_builds/invertedai-simulate/envs/latest/lib/python3.8/site-packages/pygame/event.cpython-38-x86_64-linux-gnu.so'>) bool [source]#
Intercepts window resizing events.
- render(array: numpy.ndarray, offset: Tuple[int, int] = (0, 0)) None [source]#
Process the provided camera image.
- Parameters
array (np.array of np.uint8) – Height by width by 3 (RGB color channels) image array.
offset – Position of the top left corner in screen coordinates to start rendering from. Subclasses may ignore it if not supported.
- resize(res: invertedai_simulate.utils.Resolution) None [source]#
Resize to new resolution. Underlying PyGame implementation is not very reliable.
- split_screen(res: invertedai_simulate.utils.Resolution, offset: Tuple[int, int]) invertedai_simulate.utils.SplitScreen [source]#
Create a smaller screen from a part of this one.
- class invertedai_simulate.utils.Res[source]#
Bases:
object
Some commonly used resolutions.
- BIRDVIEW = Resolution(width=256, height=256)#
- CIL = Resolution(width=200, height=88)#
- DEFAULT = Resolution(width=1280, height=720)#
- MD = Resolution(width=320, height=240)#
- SD = Resolution(width=640, height=480)#
- class invertedai_simulate.utils.Resolution(width, height)#
Bases:
tuple
- height#
Alias for field number 1
- width#
Alias for field number 0
- class invertedai_simulate.utils.SensorSettings[source]#
Bases:
object
- Available_Camera_types = ['rgb-camera', 'segmentation', 'depth-camera']#
- Available_Reference_Frame = ['carla']#
- Available_Sensors = ['camera']#
- Available_Tracked_Actors = ['vehicles', 'pedestrians', 'traffic-lights', 'parked_vehicles']#
- Default_Settings = {'boundingbox': {'attach_to_actor': 'ego', 'frame_of_reference': 'carla', 'location': Location(x=0, y=0, z=0), 'occlusion': False, 'radius': 100000, 'rotation': Rotation(yaw=0, pitch=0, roll=0), 'sensor_type': 'boundingbox', 'track_actor_types': ['vehicles', 'pedestrians', 'traffic-lights', 'parked_vehicles'], 'world_sensor': False}, 'camera': {'bounding_box': True, 'camera_type': 'rgb-camera', 'fov': 90.0, 'location': Location(x=1.6, y=0, z=1.7), 'resolution': Resolution(width=200, height=88), 'rotation': Rotation(yaw=0, pitch=0, roll=0), 'sensor_type': 'camera', 'show_bounding_boxes': True, 'track_actor_types': ['vehicles', 'pedestrians', 'traffic-lights', 'parked_vehicles'], 'world_sensor': False}}#
- class Location(x, y, z)#
Bases:
tuple
- x#
Alias for field number 0
- y#
Alias for field number 1
- z#
Alias for field number 2
- class invertedai_simulate.utils.SplitScreen(res: invertedai_simulate.utils.Resolution, offset: Tuple[int, int], parent: invertedai_simulate.utils.Display)[source]#
Bases:
invertedai_simulate.utils.Display
A split screen display uses a part of a larger display. Can only be used on displays that allow rendering with offset.
- Parameters
- intercept_event(event: <module 'pygame.event' from '/home/docs/checkouts/readthedocs.org/user_builds/invertedai-simulate/envs/latest/lib/python3.8/site-packages/pygame/event.cpython-38-x86_64-linux-gnu.so'>) bool [source]#
- render(array: numpy.ndarray, offset: Tuple[int, int] = (0, 0)) None [source]#
Process the provided camera image.
- Parameters
array (np.array of np.uint8) – Height by width by 3 (RGB color channels) image array.
offset – Position of the top left corner in screen coordinates to start rendering from. Subclasses may ignore it if not supported.
invertedai_simulate.zmq_client module#
- class invertedai_simulate.zmq_client.ApiMessagingClient(server_address, client_name)[source]#
Bases:
invertedai_simulate.zmq_client.ZMQClient
The concrete class that handles handshaking and other communications to the zmq server