-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
88 lines (65 loc) · 1.96 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
from training_gym.level import Level
LEVEL_NAME = Level.GRASS
# Steps per second
SPS = 100
# Steps between observations
STEPS_INTERVAL = 2
FOV = 120
# Raw camera input
CAMERA_HEIGHT = 120
CAMERA_WIDTH = 160
CAMERA_RESOLUTION = (CAMERA_WIDTH, CAMERA_HEIGHT)
MARGIN_TOP = CAMERA_HEIGHT // 3
# Region of Interest
# r = [margin_left, margin_top, width, height]
ROI = [0, MARGIN_TOP, CAMERA_WIDTH, CAMERA_HEIGHT - MARGIN_TOP]
# Input dimension for VAE
IMAGE_WIDTH = ROI[2]
IMAGE_HEIGHT = ROI[3]
N_CHANNELS = 3
INPUT_DIM = (IMAGE_HEIGHT, IMAGE_WIDTH, N_CHANNELS)
# Reward parameters
THROTTLE_REWARD_WEIGHT = 0.1
MID_DIST_PENALTY_WEIGHT = 0.7
# Max distance to the center of the lane
MAX_DIST = 1.1
MAX_VELOCITY = 40
# Desired velocity in km/h
TARGET_VELOCITY = 50
VELOCITY_WEIGHT = 0.1
JERK_REWARD_WEIGHT = 0.0
# Very smooth control: 10% -> 0.2 diff in steering allowed (requires more training)
# Smooth control: 15% -> 0.3 diff in steering allowed
MAX_STEERING_DIFF = 0.15
REWARD_STEP = 1
# Negative reward for getting off the road
REWARD_CRASH = -10
# Penalize the agent even more when being fast
CRASH_SPEED_WEIGHT = 5
# Symmetric steering
MAX_STEERING = 1
MIN_STEERING = - MAX_STEERING
CHECKPOINTS = False
# Simulation config
MIN_THROTTLE = 0.08
# max_throttle: 0.6 for level 0 and 0.5 for level 1
MAX_THROTTLE = 0.2
# Number of past commands to concatenate with the input
N_COMMAND_HISTORY = 20
# Max cross track error (used in normal mode to reset the car)
MAX_CTE_ERROR = 2.0
# Level to use for training
LEVEL = 0
# Action repeat
FRAME_SKIP = 1
Z_SIZE = 512 # Only used for random features
TEST_FRAME_SKIP = 1
BEAMNG_HOME = 'C:\\Users\\Tim\\Documents\\research_new\\trunk'
BASE_ENV = "BeamNG"
ENV_ID = "BeamNG-{}".format(LEVEL)
# Params that are logged
SIM_PARAMS = ['MIN_THROTTLE', 'MAX_THROTTLE', 'FRAME_SKIP',
'MAX_CTE_ERROR', 'N_COMMAND_HISTORY', 'MAX_STEERING_DIFF']
# DEBUG PARAMS
# Show input and reconstruction in the teleop panel
SHOW_IMAGES_TELEOP = True