From 8a286043c74dd0f178950443b669e415d5079129 Mon Sep 17 00:00:00 2001 From: RedMellon Date: Sat, 13 Aug 2022 20:29:55 -0700 Subject: [PATCH] added simulation time --- ROAR_Sim | 2 +- runner_competition_evaluator.py | 6 ++++-- runner_sim.py | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ROAR_Sim b/ROAR_Sim index 4b7c2c55..12e6c772 160000 --- a/ROAR_Sim +++ b/ROAR_Sim @@ -1 +1 @@ -Subproject commit 4b7c2c5504773f33f29cedb3e1a5abf400c21246 +Subproject commit 12e6c77214839dd8436efe676c6ad7ea581ded78 diff --git a/runner_competition_evaluator.py b/runner_competition_evaluator.py index 49bdb168..dc4c8746 100644 --- a/runner_competition_evaluator.py +++ b/runner_competition_evaluator.py @@ -23,7 +23,9 @@ def compute_score(carla_runner: CarlaRunner) -> Tuple[float, int, int]: laps_completed: Number of laps completed """ - time_elapsed: float = carla_runner.end_simulation_time - carla_runner.start_simulation_time + # time_elapsed: float = carla_runner.end_simulation_time - carla_runner.start_simulation_time + # use simulation time, not real time + time_elapsed: float = carla_runner.end_sim_time - carla_runner.start_sim_time num_collision: int = carla_runner.agent_collision_counter laps_completed = 0 if carla_runner.completed_lap_count < 0 else carla_runner.completed_lap_count @@ -57,7 +59,7 @@ def run(agent_class, agent_config_file_path: Path, carla_config_file_path: Path, try: my_vehicle = carla_runner.set_carla_world() agent = agent_class(vehicle=my_vehicle, agent_settings=agent_config) - carla_runner.start_game_loop(agent=agent, use_manual_control=False) + carla_runner.start_game_loop(agent=agent, use_manual_control=True) return compute_score(carla_runner) except Exception as e: print(f"something bad happened during initialization: {e}") diff --git a/runner_sim.py b/runner_sim.py index 27fbf66e..676d9997 100644 --- a/runner_sim.py +++ b/runner_sim.py @@ -8,7 +8,6 @@ from misc.utils import str2bool from ROAR.agent_module.michael_pid_agent import PIDAgent from ROAR.agent_module.forward_only_agent import ForwardOnlyAgent -from ROAR.agent_module.full_mpc_agent import MPCAgent def main(args):