robogym/envs/dactyl/goals/face_curriculum.py [15:59]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def __init__(
        self,
        mujoco_simulation,
        success_threshold: dict,
        face_geom_names: typing.List[str],
        goal_directions: typing.Optional[typing.List[str]] = None,
        round_target_face: bool = True,
        p_face_flip: float = 0.25,
    ):
        """
        Create new FaceCurriculumGoal object

        :param mujoco_simulation: A SimulationInterface object for a mujoco simulation considered
        :param success_threshold: Dictionary of threshold levels for cube orientation and face
            rotation, for which we consider the cube "aligned" with the goal
        :param face_geom_names: Names of 6 face geoms of the cube for which we measure the rotation
        :param goal_directions: Whether to rotate faces only clockwise, counterclockwise or both
        :param round_target_face: Whether target face rotations should be only round angles
            (multiplies of pi/2) or not
        :param p_face_flip: If the cube is aligned, what is the probability of flipping the cube
            vs rotating the face
        """
        super().__init__()

        assert len(face_geom_names) in {2, 6}, "Only supports full cube or face cube"

        self.mujoco_simulation = mujoco_simulation

        self.success_threshold = success_threshold
        self.face_geom_names = face_geom_names

        if goal_directions is None:
            self.goal_directions = ["cw", "ccw"]
        else:
            self.goal_directions = goal_directions

        self.round_target_face = round_target_face

        self.p_face_flip = p_face_flip

        self.goal_quat_for_face = cube_utils.face_up_quats(
            mujoco_simulation.sim, "cube:cube:rot", self.face_geom_names
        )

    def next_goal(self, random_state, current_state):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



robogym/envs/dactyl/goals/face_free.py [17:61]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def __init__(
        self,
        mujoco_simulation,
        success_threshold: dict,
        face_geom_names: typing.List[str],
        goal_directions: typing.Optional[typing.List[str]] = None,
        round_target_face: bool = True,
        p_face_flip: float = 0.25,
    ):
        """
        Create new FaceFreeGoal object

        :param mujoco_simulation: A SimulationInterface object for a mujoco simulation considered
        :param success_threshold: Dictionary of threshold levels for cube orientation and face
            rotation, for which we consider the cube "aligned" with the goal
        :param face_geom_names: Names of 6 face geoms of the cube for which we measure the rotation
        :param goal_directions: Whether to rotate faces only clockwise, counterclockwise or both
        :param round_target_face: Whether target face rotations should be only round angles
            (multiplies of pi/2) or not
        :param p_face_flip: If the cube is aligned, what is the probability of flipping the cube
            vs rotating the face
        """
        super().__init__()

        assert len(face_geom_names) in {2, 6}, "Only supports full cube or face cube"

        self.mujoco_simulation = mujoco_simulation

        self.success_threshold = success_threshold
        self.face_geom_names = face_geom_names

        if goal_directions is None:
            self.goal_directions = ["cw", "ccw"]
        else:
            self.goal_directions = goal_directions

        self.round_target_face = round_target_face

        self.p_face_flip = p_face_flip

        self.goal_quat_for_face = cube_utils.face_up_quats(
            mujoco_simulation.sim, "cube:cube:rot", self.face_geom_names
        )

    def next_goal(self, random_state, current_state):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



