minor bug fixes

This commit is contained in:
Fabian 2022-07-25 11:18:05 +02:00
parent 5590318329
commit ce795669a9
2 changed files with 5 additions and 5 deletions

View File

@ -158,12 +158,12 @@ class BlackBoxWrapper(gym.ObservationWrapper):
if self.verbose >= 2:
infos['positions'] = trajectory
infos['velocities'] = velocity
infos['step_actions'] = actions[:t + 1]
infos['step_actions'] = actions[:t]
infos['step_observations'] = observations[:t + 1]
infos['step_rewards'] = rewards[:t + 1]
infos['step_rewards'] = rewards[:t]
infos['trajectory_length'] = t + 1
trajectory_return = self.reward_aggregation(rewards[:t + 1])
trajectory_return = self.reward_aggregation(rewards[:t])
return self.observation(obs), trajectory_return, done, infos
def render(self, **kwargs):

View File

@ -148,9 +148,9 @@ def make_bb(
raise ValueError('Cannot used sub-trajectory learning and replanning together.')
# add time_step observation when replanning
if (learn_sub_trajs or do_replanning) and not any(issubclass(w, TimeAwareObservation) for w in kwargs['wrappers']):
if (learn_sub_trajs or do_replanning) and not any(issubclass(w, TimeAwareObservation) for w in wrappers):
# Add as first wrapper in order to alter observation
kwargs['wrappers'].insert(0, TimeAwareObservation)
wrappers.insert(0, TimeAwareObservation)
env = _make_wrapped_env(env_id=env_id, wrappers=wrappers, seed=seed, **kwargs)