Skip to content
Snippets Groups Projects
Commit e2dc57dd authored by Armin Co's avatar Armin Co
Browse files

Added new environment options

parent 8e575e06
No related branches found
No related tags found
No related merge requests found
...@@ -247,15 +247,23 @@ class World: ...@@ -247,15 +247,23 @@ class World:
carla.Rotation(pitch=0.000000, yaw=-175.922913, roll=-6.221135)) carla.Rotation(pitch=0.000000, yaw=-175.922913, roll=-6.221135))
pos_diff = math.sqrt((target.location.x - x)**2 + (target.location.y - y)**2) pos_diff = math.sqrt((target.location.x - x)**2 + (target.location.y - y)**2)
rot_diff = ((target.rotation.yaw / 180) - yaw)
v = math.sqrt((vx)**2 + (vy)**2) v = math.sqrt((vx)**2 + (vy)**2)
r = -0.1 r = -0.1
r += -0.01 * pos_diff r += -0.01 * pos_diff
done = False LEARN_FINAL_ORIENTATION = False
if LEARN_FINAL_ORIENTATION:
target_yaw = (-175.922913) / 180
yaw_dif = math.sqrt((target_yaw**2) - (yaw**2))
r += -0.01 * yaw_dif
INSENTIVE_MOVING = False
if v < 0.01 and INSENTIVE_MOVING:
r -= 0.02
done = False
if pos_diff < 1.5: if pos_diff < 1.5:
done = True done = True
r += 100 r += 100
......
...@@ -22,6 +22,7 @@ class Config: ...@@ -22,6 +22,7 @@ class Config:
learn_rate= 0.001 learn_rate= 0.001
learn_iterations = 1 learn_iterations = 1
run_episodes = 20 run_episodes = 20
offline_batchsize = 2048
offline_epochs = 1000 offline_epochs = 1000
offline_validate_every_x_iteration = 10 offline_validate_every_x_iteration = 10
load_ann = False load_ann = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment