AgentGameLoop module
The source code is hosted at AgentGameLoop.py.
Example of a game loop for the LunaticAgent class.
- AgentGameLoop.AMOUNT_ACTORS = 12
How many other actors to spawn
- AgentGameLoop.EGO_SPAWN_IDX = 3
Changes the start position of the ego vehicle
- AgentGameLoop.PRINT_RULES = False
Print the rules to the console. This is messy.
- AgentGameLoop.game_loop(args: LaunchConfig)[source]
Main loop of the simulation.
It sets up the simulation, spawns the vehicles, and initializes the agent. In the
whileloop, the agent calculates onecarla.VehicleControlevery iteration.The
GameFrameworkcontext manager takes care of the simulation tick, and camera updates.- Parameters:
args (LaunchConfig)
- AgentGameLoop.main(args: LaunchConfig)
This is the main function wrapped with the @hydra method that takes care of the configuration merge and sets up logging.
- Parameters:
args (LaunchConfig) – The configuration object that is created by Hydra, it contains all the settings from the YAML files merged with the command line arguments. From a high-level perspective is it a dictionary that also allows dot access to its keys, e.g.
args.hostinstead ofargs["host"].