MCPcopy
hub / github.com/Farama-Foundation/Metaworld / _get_obs

Method _get_obs

metaworld/sawyer_xyz_env.py:513–527  ·  view source on GitHub ↗

Frame stacks `_get_curr_obs_combined_no_goal()` and concatenates the goal position to form a single flat observation. Returns: The flat observation array (39 elements)

(self)

Source from the content-addressed store, hash-verified

511 return np.hstack((pos_hand, gripper_distance_apart, obs_obj_padded))
512
513 def _get_obs(self) -> npt.NDArray[np.float64]:
514 """Frame stacks `_get_curr_obs_combined_no_goal()` and concatenates the goal position to form a single flat observation.
515
516 Returns:
517 The flat observation array (39 elements)
518 """
519 # do frame stacking
520 pos_goal = self._get_pos_goal()
521 if self._partially_observable:
522 pos_goal = np.zeros_like(pos_goal)
523 curr_obs = self._get_curr_obs_combined_no_goal()
524 # do frame stacking
525 obs = np.hstack((curr_obs, self._prev_obs, pos_goal))
526 self._prev_obs = curr_obs
527 return obs
528
529 def _get_obs_dict(self) -> ObservationDict:
530 obs = self._get_obs()

Callers 15

_get_obs_dictMethod · 0.95
stepMethod · 0.95
reset_modelMethod · 0.95
reset_modelMethod · 0.80
reset_modelMethod · 0.80
reset_modelMethod · 0.80
reset_modelMethod · 0.80
reset_modelMethod · 0.80
reset_modelMethod · 0.80
reset_modelMethod · 0.80
reset_modelMethod · 0.80
reset_modelMethod · 0.80

Calls 2

_get_pos_goalMethod · 0.95

Tested by

no test coverage detected