def reset_target(self):
# Randomize goal position within specified bounds
self.goal = np.random.rand(3) * (self.target_bounds[:, 1] -
self.target_bounds[:, 0]
) + self.target_bounds[:, 0]
geom_positions = self.sim.model.geom_pos.copy()
prev_goal_location = geom_positions[1]
while (np.linalg.norm(prev_goal_location - self.goal) <
self.target_reset_distance):
self.goal = np.random.rand(3) * (self.target_bounds[:, 1] -
self.target_bounds[:, 0]
) + self.target_bounds[:, 0]
geom_positions[1] = self.goal
self.sim.model.geom_pos[:] = geom_positions
评论列表
文章目录