mani_skill.envs.tasks.control ============================= .. py:module:: mani_skill.envs.tasks.control Submodules ---------- .. toctree:: :maxdepth: 1 /api/mani_skill/envs/tasks/control/ant/index /api/mani_skill/envs/tasks/control/cartpole/index /api/mani_skill/envs/tasks/control/hopper/index /api/mani_skill/envs/tasks/control/humanoid/index Classes ------- .. autoapisummary:: mani_skill.envs.tasks.control.AntRun mani_skill.envs.tasks.control.AntWalk mani_skill.envs.tasks.control.CartpoleBalanceEnv mani_skill.envs.tasks.control.CartpoleSwingUpEnv mani_skill.envs.tasks.control.HopperHopEnv mani_skill.envs.tasks.control.HopperStandEnv mani_skill.envs.tasks.control.HumanoidRun mani_skill.envs.tasks.control.HumanoidStand mani_skill.envs.tasks.control.HumanoidWalk Package Contents ---------------- .. py:class:: AntRun(*args, **kwargs) Bases: :py:obj:`AntEnv` **Task Description:** Ant moves in x direction at 4 m/s **Randomizations:** - Ant qpos and qvel have added noise from uniform distribution [-1e-2, 1e-2] **Success Conditions:** - No specific success conditions. .. py:class:: AntWalk(*args, **kwargs) Bases: :py:obj:`AntEnv` **Task Description:** Ant moves in x direction at 0.5 m/s **Randomizations:** - Ant qpos and qvel have added noise from uniform distribution [-1e-2, 1e-2] **Success Conditions:** - No specific success conditions. .. py:class:: CartpoleBalanceEnv(*args, **kwargs) Bases: :py:obj:`CartpoleEnv` **Task Description:** Use the Cartpole robot to balance a pole on a cart. **Randomizations:** - Pole direction is randomized around the vertical axis. the range is [-0.05, 0.05] radians. **Fail Conditions:** - Pole is lower than the horizontal plane .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/MS-CartpoleBalance-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:class:: CartpoleSwingUpEnv(*args, **kwargs) Bases: :py:obj:`CartpoleEnv` **Task Description:** Use the Cartpole robot to swing up a pole on a cart. **Randomizations:** - Pole direction is randomized around the whole circle. the range is [-pi, pi] radians. **Success Conditions:** - No specific success conditions. The task is considered successful if the pole is upright for the whole episode. .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:attribute:: SUPPORTED_REWARD_MODES :value: ('normalized_dense', 'dense', 'none') .. py:class:: HopperHopEnv(*args, **kwargs) Bases: :py:obj:`HopperEnv` **Task Description:** Hopper robot stays upright and moves in positive x direction with hopping motion **Randomizations:** - Hopper robot is randomly rotated [-pi, pi] radians about y axis. - Hopper qpos are uniformly sampled within their allowed ranges **Success Conditions:** - No specific success conditions. The task is considered successful if the hopper hops for the whole episode. .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:class:: HopperStandEnv(*args, **kwargs) Bases: :py:obj:`HopperEnv` **Task Description:** Hopper robot stands upright **Randomizations:** - Hopper robot is randomly rotated [-pi, pi] radians about y axis. - Hopper qpos are uniformly sampled within their allowed ranges **Success Conditions:** - No specific success conditions. .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:class:: HumanoidRun(*args, robot_uids='humanoid', **kwargs) Bases: :py:obj:`HumanoidEnvStandard` **Task Description:** Humanoid moves in x direction at running pace **Randomizations:** - Humanoid qpos and qvel have added noise from uniform distribution [-1e-2, 1e-2] **Fail Conditions:** - Humanoid robot torso link leaves z range [0.7, 1.0] .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:attribute:: agent :type: Union[mani_skill.agents.robots.humanoid.Humanoid] .. py:class:: HumanoidStand(*args, robot_uids='humanoid', **kwargs) Bases: :py:obj:`HumanoidEnvStandard` **Task Description:** Humanoid robot stands upright **Randomizations:** - Humanoid robot is randomly rotated [-pi, pi] radians about z axis. - Humanoid qpos and qvel have added noise from uniform distribution [-1e-2, 1e-2] **Fail Conditions:** - Humanoid robot torso link leaves z range [0.7, 1.0] .. py:method:: _get_obs_state_dict(info) Get (ground-truth) state-based observations. .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:attribute:: agent :type: Union[mani_skill.agents.robots.humanoid.Humanoid] .. py:class:: HumanoidWalk(*args, robot_uids='humanoid', **kwargs) Bases: :py:obj:`HumanoidEnvStandard` **Task Description:** Humanoid moves in x direction at walking pace **Randomizations:** - Humanoid qpos and qvel have added noise from uniform distribution [-1e-2, 1e-2] **Fail Conditions:** - Humanoid robot torso link leaves z range [0.7, 1.0] .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:attribute:: agent :type: Union[mani_skill.agents.robots.humanoid.Humanoid]