2022-07-06 09:19:21 +02:00
|
|
|
from typing import Union, Tuple
|
|
|
|
|
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper
|
|
|
|
|
|
|
|
|
|
|
|
class MPWrapper(RawInterfaceWrapper):
|
|
|
|
|
|
|
|
@property
|
|
|
|
def context_mask(self):
|
|
|
|
return np.hstack([
|
|
|
|
[False] * 111, # ant has 111 dimensional observation space !!
|
|
|
|
[True] # goal height
|
|
|
|
])
|
|
|
|
|
|
|
|
@property
|
|
|
|
def current_pos(self) -> Union[float, int, np.ndarray]:
|
2022-07-13 13:28:39 +02:00
|
|
|
return self.data.qpos[7:15].copy()
|
2022-07-06 09:19:21 +02:00
|
|
|
|
|
|
|
@property
|
|
|
|
def current_vel(self) -> Union[float, int, np.ndarray, Tuple]:
|
2022-07-13 13:28:39 +02:00
|
|
|
return self.data.qvel[6:14].copy()
|