From 6b0dfd7c24be81854505b7d7456a66ffa82499f5 Mon Sep 17 00:00:00 2001 From: ottofabian Date: Thu, 24 Jun 2021 11:38:30 +0200 Subject: [PATCH] Added proper action clipping to MP --- alr_envs/utils/mps/mp_wrapper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/alr_envs/utils/mps/mp_wrapper.py b/alr_envs/utils/mps/mp_wrapper.py index c31072f..fc9e0bb 100644 --- a/alr_envs/utils/mps/mp_wrapper.py +++ b/alr_envs/utils/mps/mp_wrapper.py @@ -74,6 +74,7 @@ class MPWrapper(gym.Wrapper, ABC): for t, pos_vel in enumerate(zip(trajectory, velocity)): ac = self.policy.get_action(pos_vel[0], pos_vel[1]) + ac = np.clip(ac, self.env.action_space.low, self.env.action_space.high) obs, rew, done, info = self.env.step(ac) rewards += rew # TODO return all dicts?