First of all, thank you for open-sourcing this excellent work.
I have a question regarding the prepare function. I noticed that traj_len is set to 1000, and a reset operation is triggered when t == 0.9 * traj_len.
Does this imply that the first 100 frames of the reference motion are effectively skipped? I was wondering if you could elaborate on the rationale behind this design choice?
def prepare(self, init_motor_angle=None):
if init_motor_angle is not None:
desired_motor_angle = init_motor_angle
else:
desired_motor_angle = self.policy.get_init_dof_pos()
# logger.info(f"{desired_motor_angle=}")
current_motor_angle = np.array(self.env.dof_pos)
# logger.info(f"{current_motor_angle=}")
traj_len = 1000
last_step_time = time.time()
logger.warning("prepare_init")
pbar = ProgressBar("Prepare", traj_len)
for t in range(traj_len):
current_motor_angle = np.array(self.env.dof_pos)
blend_ratio = np.minimum(t / 300, 1)
action = (1 - blend_ratio) * current_motor_angle + blend_ratio * desired_motor_angle
# warm up network
self.step(dry_run=True)
self.env.step(action)
time_diff = last_step_time + self.dt - time.time()
if time_diff > 0:
time.sleep(time_diff)
else:
logger.error("Warning: frame drop")
last_step_time = time.time()
pbar.update()
if t == 0.9 * traj_len:
logger.info(f"{'=' * 10} RESET ZERO POSITION {'=' * 10}")
self.reset()
time.sleep(0.01)
pbar.close()
logger.warning("prepare_done")
First of all, thank you for open-sourcing this excellent work.
I have a question regarding the prepare function. I noticed that traj_len is set to 1000, and a reset operation is triggered when t == 0.9 * traj_len.
Does this imply that the first 100 frames of the reference motion are effectively skipped? I was wondering if you could elaborate on the rationale behind this design choice?