Fix: Return for invalid trajectories did not follow new gym spec
This commit is contained in:
parent
6f1a36d18c
commit
80de15fd14
@ -158,9 +158,9 @@ class BlackBoxWrapper(gym.ObservationWrapper):
|
|||||||
done = False
|
done = False
|
||||||
|
|
||||||
if not traj_is_valid:
|
if not traj_is_valid:
|
||||||
obs, trajectory_return, done, infos = self.env.invalid_traj_callback(action, position, velocity,
|
obs, trajectory_return, terminated, truncated, infos = self.env.invalid_traj_callback(action, position, velocity,
|
||||||
self.return_context_observation)
|
self.return_context_observation)
|
||||||
return self.observation(obs), trajectory_return, done, infos
|
return self.observation(obs), trajectory_return, terminated, truncated, infos
|
||||||
|
|
||||||
self.plan_steps += 1
|
self.plan_steps += 1
|
||||||
for t, (pos, vel) in enumerate(zip(position, velocity)):
|
for t, (pos, vel) in enumerate(zip(position, velocity)):
|
||||||
|
@ -108,7 +108,8 @@ class RawInterfaceWrapper(gym.Wrapper):
|
|||||||
Returns:
|
Returns:
|
||||||
obs: artificial observation if the trajectory is invalid, by default a zero vector
|
obs: artificial observation if the trajectory is invalid, by default a zero vector
|
||||||
reward: artificial reward if the trajectory is invalid, by default 0
|
reward: artificial reward if the trajectory is invalid, by default 0
|
||||||
done: artificial done if the trajectory is invalid, by default True
|
terminated: artificial terminated if the trajectory is invalid, by default True
|
||||||
|
truncated: artificial truncated if the trajectory is invalid, by default False
|
||||||
info: artificial info if the trajectory is invalid, by default empty dict
|
info: artificial info if the trajectory is invalid, by default empty dict
|
||||||
"""
|
"""
|
||||||
return np.zeros(1), 0, True, {}
|
return np.zeros(1), 0, True, False, {}
|
||||||
|
Loading…
Reference in New Issue
Block a user