added new mp wrappers to all environments

This commit is contained in:
Onur
2022-06-29 10:39:28 +02:00
parent 02b8a65bab
commit 6e06e11cfa
9 changed files with 180 additions and 5 deletions
@@ -2,8 +2,10 @@ from alr_envs.mp.black_box_wrapper import BlackBoxWrapper
from typing import Union, Tuple
import numpy as np
from alr_envs.mp.raw_interface_wrapper import RawInterfaceWrapper
class MPWrapper(BlackBoxWrapper):
class MPWrapper(RawInterfaceWrapper):
@property
def current_pos(self) -> Union[float, int, np.ndarray, Tuple]:
@@ -12,7 +14,7 @@ class MPWrapper(BlackBoxWrapper):
def current_vel(self) -> Union[float, int, np.ndarray, Tuple]:
return self.env.sim.data.qvel.flat[:self.env.n_links]
def get_context_mask(self):
def context_mask(self):
return np.concatenate([
[False] * self.env.n_links, # cos
[False] * self.env.n_links, # sin
@@ -21,4 +23,4 @@ class MPWrapper(BlackBoxWrapper):
[False] * 3, # goal distance
# self.get_body_com("target"), # only return target to make problem harder
[False], # step
])
])