fixed issue of incorrectly retrieving the current position for metaworld tasks

This commit is contained in:
ottofabian 2021-09-16 11:48:14 +02:00
parent cc01ca2d18
commit 1983e9d96e
4 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ class MPWrapper(MPEnvWrapper):
@property @property
def current_pos(self) -> Union[float, int, np.ndarray]: def current_pos(self) -> Union[float, int, np.ndarray]:
r_close = self.env.data.get_joint_qpos("r_close") r_close = self.env.data.get_joint_qpos("r_close")
return np.hstack([self.env.data.mocap_pos.flatten(), r_close]) return np.hstack([self.env.data.mocap_pos.flatten() / self.env.action_scale, r_close])
@property @property
def current_vel(self) -> Union[float, int, np.ndarray, Tuple]: def current_vel(self) -> Union[float, int, np.ndarray, Tuple]:

View File

@ -53,7 +53,7 @@ class MPWrapper(MPEnvWrapper):
@property @property
def current_pos(self) -> Union[float, int, np.ndarray]: def current_pos(self) -> Union[float, int, np.ndarray]:
r_close = self.env.data.get_joint_qpos("r_close") r_close = self.env.data.get_joint_qpos("r_close")
return np.hstack([self.env.data.mocap_pos.flatten(), r_close]) return np.hstack([self.env.data.mocap_pos.flatten() / self.env.action_scale, r_close])
@property @property
def current_vel(self) -> Union[float, int, np.ndarray, Tuple]: def current_vel(self) -> Union[float, int, np.ndarray, Tuple]:

View File

@ -53,7 +53,7 @@ class MPWrapper(MPEnvWrapper):
@property @property
def current_pos(self) -> Union[float, int, np.ndarray]: def current_pos(self) -> Union[float, int, np.ndarray]:
r_close = self.env.data.get_joint_qpos("r_close") r_close = self.env.data.get_joint_qpos("r_close")
return np.hstack([self.env.data.mocap_pos.flatten(), r_close]) return np.hstack([self.env.data.mocap_pos.flatten() / self.env.action_scale, r_close])
@property @property
def current_vel(self) -> Union[float, int, np.ndarray, Tuple]: def current_vel(self) -> Union[float, int, np.ndarray, Tuple]:

View File

@ -53,7 +53,7 @@ class MPWrapper(MPEnvWrapper):
@property @property
def current_pos(self) -> Union[float, int, np.ndarray]: def current_pos(self) -> Union[float, int, np.ndarray]:
r_close = self.env.data.get_joint_qpos("r_close") r_close = self.env.data.get_joint_qpos("r_close")
return np.hstack([self.env.data.mocap_pos.flatten(), r_close]) return np.hstack([self.env.data.mocap_pos.flatten() / self.env.action_scale, r_close])
@property @property
def current_vel(self) -> Union[float, int, np.ndarray, Tuple]: def current_vel(self) -> Union[float, int, np.ndarray, Tuple]: