Skip to content

Steps to get the simulator up and running

Sohan Rudra edited this page Dec 12, 2018 · 2 revisions

The following steps assume that the simulator has been installed by following the installation steps.

Simulator Configuration

Before running an experiment make sure that TORCS is configured with the desired settings.

STEPS:

  1. Open a new terminal window and run torcs.
  2. Select Race -> Quick Race -> Configure Race.

This opens the torcs quick race config window.

NOTE:(After each tab press accept to save the settings)

  • Select the desired track
  • Select Driver (NOTE: Any number of drivers can be selected but you must select scr-server1 as it is where the agent will connect to the simulator. The final selected roster will be shown in the selected table)
  • Finally select the number of laps.

When you are satisfied with the final selection close torcs.

Environment configuration

This part can be completely skipped if you are satisfied with the default config.

In this part we configuar the Env Madras-v0.

STEPS:

  1. The file init.py contains max_episode_steps which can be changed if required.
  2. The reward structure is present in the file gym_torcs.py
  3. During running in headless mode i.e. without visualization, in order to maximize the simulators performance make sure to play with the timeout_value declared inside these files gym_madras.py, gym_torcs.py & snakeoil3_gym.py. The timeout_value specifies the speed of the simulator. The value is given in nanoseconds. (NOTE: the default value in visual mode the value is 10 millisecond.)

Changing Modes

The Env has two options for changing the running modes.

Modes

Visual

  • Toggle the variable visualise in gym_madras.py to switch visual modes.

Action Space

  • Toggle the variable pid_assist in gym_madras.py to switch between the two action spaces. (False: [acceleration,steer,brake] , True: [velocity,lane_pose])

Now the simulator is ready to run experiments 👍.