resample the context if target is too near to the start position

This commit is contained in:
Hongyi Zhou
2022-10-13 14:58:28 +02:00
parent eec171e04a
commit 1fd4a1e848
4 changed files with 11 additions and 9 deletions
+4 -3
View File
@@ -81,9 +81,10 @@ class BlackBoxWrapper(gym.ObservationWrapper):
bc_time = np.array(0 if not self.do_replanning else self.current_traj_steps * self.dt)
# TODO we could think about initializing with the previous desired value in order to have a smooth transition
# at least from the planning point of view.
self.traj_gen.set_boundary_conditions(torch.as_tensor(bc_time),
torch.as_tensor(self.current_pos),
torch.as_tensor(self.current_vel))
self.traj_gen.set_boundary_conditions(bc_time,
self.current_pos,
self.current_vel)
duration = None if self.learn_sub_trajectories else self.duration
self.traj_gen.set_duration(duration, self.dt)
# traj_dict = self.traj_gen.get_trajs(get_pos=True, get_vel=True)