new best
This commit is contained in:
parent
a7ecf50a00
commit
fac8cb7e94
@ -285,12 +285,12 @@ class sprint(gym.Env):
|
|||||||
def generate_random_target(self, position):
|
def generate_random_target(self, position):
|
||||||
while True:
|
while True:
|
||||||
angle = np.random.uniform(0, 2 * np.pi)
|
angle = np.random.uniform(0, 2 * np.pi)
|
||||||
X = position[0] * 10 * np.cos(angle)
|
x = position[0] + 10 * np.cos(angle)
|
||||||
Y = position[1] * 10 * np.sin(angle)
|
y = position[1] + 10 * np.sin(angle)
|
||||||
if -13 <= X <= 13 and -8 <= Y <= 8:
|
if -13 <= x <= 13 and -8 <= y <= 8:
|
||||||
break
|
break
|
||||||
|
|
||||||
self.walk_target = np.array([X, Y])
|
self.walk_target = np.array([x, y])
|
||||||
|
|
||||||
def step(self, action):
|
def step(self, action):
|
||||||
|
|
||||||
@ -362,9 +362,9 @@ class Train(Train_Base):
|
|||||||
def train(self, args):
|
def train(self, args):
|
||||||
|
|
||||||
# --------------------------------------- Learning parameters
|
# --------------------------------------- Learning parameters
|
||||||
n_envs = min(10, os.cpu_count())
|
n_envs = min(12, os.cpu_count())
|
||||||
n_steps_per_env = 1024 # RolloutBuffer is of size (n_steps_per_env * n_envs)
|
n_steps_per_env = 1024 # RolloutBuffer is of size (n_steps_per_env * n_envs)
|
||||||
minibatch_size = 256 # should be a factor of (n_steps_per_env * n_envs)
|
minibatch_size = 64 # should be a factor of (n_steps_per_env * n_envs)
|
||||||
total_steps = 50000000
|
total_steps = 50000000
|
||||||
learning_rate = 3e-4
|
learning_rate = 3e-4
|
||||||
folder_name = f'Sprint_R{self.robot_type}'
|
folder_name = f'Sprint_R{self.robot_type}'
|
||||||
|
@ -292,7 +292,7 @@ class sprint(gym.Env):
|
|||||||
self.walk_rel_orientation = M.vector_angle(self.walk_rel_target) * 0.3
|
self.walk_rel_orientation = M.vector_angle(self.walk_rel_target) * 0.3
|
||||||
|
|
||||||
# exponential moving average
|
# exponential moving average
|
||||||
self.act = 0.8 * self.act + 0.2 * action * action_mult * 0.7
|
self.act = 0.6 * self.act + 0.4 * action
|
||||||
|
|
||||||
# execute Step behavior to extract the target positions of each leg (we will override these targets)
|
# execute Step behavior to extract the target positions of each leg (we will override these targets)
|
||||||
lfy, lfz, rfy, rfz = self.step_generator.get_target_positions(self.step_counter == 0, self.STEP_DUR,
|
lfy, lfz, rfy, rfz = self.step_generator.get_target_positions(self.step_counter == 0, self.STEP_DUR,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user