magail4autodrive: first commit
This commit is contained in:
18
Env/simple_idm_policy.py
Normal file
18
Env/simple_idm_policy.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import numpy as np
|
||||
|
||||
class ConstantVelocityPolicy:
|
||||
def __init__(self, target_speed=50):
|
||||
self.step_num = 0
|
||||
|
||||
def act(self):
|
||||
self.step_num += 1
|
||||
if self.step_num % 30 < 15:
|
||||
throttle = 1.0
|
||||
else:
|
||||
throttle = 1.0
|
||||
|
||||
steering = 0.1
|
||||
|
||||
# return [steering, throttle]
|
||||
|
||||
return [0.0,0.05]
|
||||
Reference in New Issue
Block a user