CoSIM Manager
The CoSim Manager is responsible for managing the simulation, calling the various client scripts, passing them data and starting and stopping scenarios.
A high-level architecture is shown here.
Here we list the identifier of the functions/class we commented
cosimManager.py
src.sim.cosimManager.ActorSnapshots()
src.sim.cosimManager.ActorSnapshots.parseActorSnapshot(snap, obsIDList, actorList, carlamap)
Parse the Carla snapshot to extract actor data. This is subsequently used to generate the actor ground truth message for the ADS.
Parameters:
-
snap
(Snapshot
) –Carla snapshot to be parsed
-
obsIDList
–List of actor IDs to be included in the output
-
actorList
–List of carla.actors used to retrieve static information
-
carlamap
–Carla world.map object used to get properties such as those for geolocation transformation
Returns: A tuple including all actor properties for each actor
src.sim.cosimManager.actorReader(CARLA_HOST, CARLA_PORT)
Manager function to send actor data using the bridge
Parameters:
-
CARLA_HOST
(string
) –Host IP of Carla server
-
CARLA_PORT
(int
) –Port of Carla server
src.sim.cosimManager.camReader(CARLA_HOST, CARLA_PORT)
Manager function to send camera on the bridge
Parameters:
-
CARLA_HOST
(string
) –Host IP of Carla server
-
CARLA_PORT
(int
) –Port of Carla server
src.sim.cosimManager.egoReader(CARLA_HOST, CARLA_PORT)
Manager function to send ego data on the bridge + more things TODO
Parameters:
-
CARLA_HOST
(string
) –Host IP of Carla server
-
CARLA_PORT
(int
) –Port of Carla server
src.sim.cosimManager.egoWriter(CARLA_HOST, CARLA_PORT)
Manager function to receive data from the ADS and control the ego vehicle in Carla accordingly
Parameters:
-
CARLA_HOST
(string
) –Host IP of Carla server
-
CARLA_PORT
(int
) –Port of Carla server
src.sim.cosimManager.lidarReader(CARLA_HOST, CARLA_PORT)
Manager function to send Lidar data on the bridge
Parameters:
-
CARLA_HOST
(string
) –Host IP of Carla server
-
CARLA_PORT
(int
) –Port of Carla server
src.sim.cosimManager.parseEgoSnapshot(snap, egoID, carlamap, throttle, brake, steering)
Parse the Carla snapshot to extract ego vehicle data
Parameters:
-
snap
(Snapshot
) –Carla snapshot to be parsed
-
egoID
–ID of the ego vehicle which is a carla.actor
-
carlamap
–Carla world.map object used to get properties such as those for geolocation transformation
-
throttle
–Throttle value taken from the ADS to be fed back in the ego state message
-
brake
–Brake value taken from the ADS to be fed back in the ego state message
-
steering
–Steering value taken from the ADS to be fed back in the ego state message
Returns: A tuple including all properties pertaining to the ego vehicle state
src.sim.cosimManager.scenarioPlayer(CARLA_HOST, CARLA_PORT)
Manager function to control carla actors
Parameters:
-
CARLA_HOST
(string
) –Host IP of Carla server
-
CARLA_PORT
(int
) –Port of Carla server