Skip to content

Commit

Permalink
added simulation time
Browse files Browse the repository at this point in the history
  • Loading branch information
vancony23 committed Aug 14, 2022
1 parent 72f1075 commit 8a28604
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ROAR_Sim
6 changes: 4 additions & 2 deletions runner_competition_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}")
Expand Down
1 change: 0 additions & 1 deletion runner_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 8a28604

Please sign in to comment.