diff --git a/gym/__init__.py b/gym/__init__.py
index ef30030057f..4a4813f1cdf 100644
--- a/gym/__init__.py
+++ b/gym/__init__.py
@@ -3,7 +3,6 @@
from gym.core import (
Env,
- GoalEnv,
Wrapper,
ObservationWrapper,
ActionWrapper,
diff --git a/gym/core.py b/gym/core.py
index 55cc639cfa8..b859e5ac559 100644
--- a/gym/core.py
+++ b/gym/core.py
@@ -176,52 +176,6 @@ def __exit__(self, *args):
return False
-class GoalEnv(Env):
- """A goal-based environment. It functions just as any regular OpenAI Gym environment but it
- imposes a required structure on the observation_space. More concretely, the observation
- space is required to contain at least three elements, namely `observation`, `desired_goal`, and
- `achieved_goal`. Here, `desired_goal` specifies the goal that the agent should attempt to achieve.
- `achieved_goal` is the goal that it currently achieved instead. `observation` contains the
- actual observations of the environment as per usual.
- """
-
- def reset(self, seed: Optional[int] = None):
- super().reset(seed=seed)
- # Enforce that each GoalEnv uses a Goal-compatible observation space.
- if not isinstance(self.observation_space, gym.spaces.Dict):
- raise error.Error(
- "GoalEnv requires an observation space of type gym.spaces.Dict"
- )
- for key in ["observation", "achieved_goal", "desired_goal"]:
- if key not in self.observation_space.spaces:
- raise error.Error(
- 'GoalEnv requires the "{}" key to be part of the observation dictionary.'.format(
- key
- )
- )
-
- @abstractmethod
- def compute_reward(self, achieved_goal, desired_goal, info):
- """Compute the step reward. This externalizes the reward function and makes
- it dependent on a desired goal and the one that was achieved. If you wish to include
- additional rewards that are independent of the goal, you can include the necessary values
- to derive it in 'info' and compute it accordingly.
-
- Args:
- achieved_goal (object): the goal that was achieved during execution
- desired_goal (object): the desired goal that we asked the agent to attempt to achieve
- info (dict): an info dictionary with additional information
-
- Returns:
- float: The reward that corresponds to the provided achieved goal w.r.t. to the desired
- goal. Note that the following should always hold true:
-
- ob, reward, done, info = env.step()
- assert reward == env.compute_reward(ob['achieved_goal'], ob['desired_goal'], info)
- """
- raise NotImplementedError
-
-
class Wrapper(Env):
"""Wraps the environment to allow a modular transformation.
diff --git a/gym/envs/__init__.py b/gym/envs/__init__.py
index 6690122bac6..2034bf3feab 100644
--- a/gym/envs/__init__.py
+++ b/gym/envs/__init__.py
@@ -262,364 +262,6 @@
max_episode_steps=1000,
)
-# Robotics
-# ----------------------------------------
-
-
-def _merge(a, b):
- a.update(b)
- return a
-
-
-for reward_type in ["sparse", "dense"]:
- suffix = "Dense" if reward_type == "dense" else ""
- kwargs = {
- "reward_type": reward_type,
- }
-
- # Fetch
- register(
- id=f"FetchSlide{suffix}-v1",
- entry_point="gym.envs.robotics:FetchSlideEnv",
- kwargs=kwargs,
- max_episode_steps=50,
- )
-
- register(
- id=f"FetchPickAndPlace{suffix}-v1",
- entry_point="gym.envs.robotics:FetchPickAndPlaceEnv",
- kwargs=kwargs,
- max_episode_steps=50,
- )
-
- register(
- id=f"FetchReach{suffix}-v1",
- entry_point="gym.envs.robotics:FetchReachEnv",
- kwargs=kwargs,
- max_episode_steps=50,
- )
-
- register(
- id=f"FetchPush{suffix}-v1",
- entry_point="gym.envs.robotics:FetchPushEnv",
- kwargs=kwargs,
- max_episode_steps=50,
- )
-
- # Hand
- register(
- id=f"HandReach{suffix}-v0",
- entry_point="gym.envs.robotics:HandReachEnv",
- kwargs=kwargs,
- max_episode_steps=50,
- )
-
- register(
- id=f"HandManipulateBlockRotateZ{suffix}-v0",
- entry_point="gym.envs.robotics:HandBlockEnv",
- kwargs=_merge({"target_position": "ignore", "target_rotation": "z"}, kwargs),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockRotateZTouchSensors{suffix}-v0",
- entry_point="gym.envs.robotics:HandBlockTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "z",
- "touch_get_obs": "boolean",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockRotateZTouchSensors{suffix}-v1",
- entry_point="gym.envs.robotics:HandBlockTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "z",
- "touch_get_obs": "sensordata",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockRotateParallel{suffix}-v0",
- entry_point="gym.envs.robotics:HandBlockEnv",
- kwargs=_merge(
- {"target_position": "ignore", "target_rotation": "parallel"}, kwargs
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockRotateParallelTouchSensors{suffix}-v0",
- entry_point="gym.envs.robotics:HandBlockTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "parallel",
- "touch_get_obs": "boolean",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockRotateParallelTouchSensors{suffix}-v1",
- entry_point="gym.envs.robotics:HandBlockTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "parallel",
- "touch_get_obs": "sensordata",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockRotateXYZ{suffix}-v0",
- entry_point="gym.envs.robotics:HandBlockEnv",
- kwargs=_merge({"target_position": "ignore", "target_rotation": "xyz"}, kwargs),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockRotateXYZTouchSensors{suffix}-v0",
- entry_point="gym.envs.robotics:HandBlockTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "xyz",
- "touch_get_obs": "boolean",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockRotateXYZTouchSensors{suffix}-v1",
- entry_point="gym.envs.robotics:HandBlockTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "xyz",
- "touch_get_obs": "sensordata",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockFull{suffix}-v0",
- entry_point="gym.envs.robotics:HandBlockEnv",
- kwargs=_merge({"target_position": "random", "target_rotation": "xyz"}, kwargs),
- max_episode_steps=100,
- )
-
- # Alias for "Full"
- register(
- id=f"HandManipulateBlock{suffix}-v0",
- entry_point="gym.envs.robotics:HandBlockEnv",
- kwargs=_merge({"target_position": "random", "target_rotation": "xyz"}, kwargs),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockTouchSensors{suffix}-v0",
- entry_point="gym.envs.robotics:HandBlockTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "random",
- "target_rotation": "xyz",
- "touch_get_obs": "boolean",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateBlockTouchSensors{suffix}-v1",
- entry_point="gym.envs.robotics:HandBlockTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "random",
- "target_rotation": "xyz",
- "touch_get_obs": "sensordata",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateEggRotate{suffix}-v0",
- entry_point="gym.envs.robotics:HandEggEnv",
- kwargs=_merge({"target_position": "ignore", "target_rotation": "xyz"}, kwargs),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateEggRotateTouchSensors{suffix}-v0",
- entry_point="gym.envs.robotics:HandEggTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "xyz",
- "touch_get_obs": "boolean",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateEggRotateTouchSensors{suffix}-v1",
- entry_point="gym.envs.robotics:HandEggTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "xyz",
- "touch_get_obs": "sensordata",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateEggFull{suffix}-v0",
- entry_point="gym.envs.robotics:HandEggEnv",
- kwargs=_merge({"target_position": "random", "target_rotation": "xyz"}, kwargs),
- max_episode_steps=100,
- )
-
- # Alias for "Full"
- register(
- id=f"HandManipulateEgg{suffix}-v0",
- entry_point="gym.envs.robotics:HandEggEnv",
- kwargs=_merge({"target_position": "random", "target_rotation": "xyz"}, kwargs),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateEggTouchSensors{suffix}-v0",
- entry_point="gym.envs.robotics:HandEggTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "random",
- "target_rotation": "xyz",
- "touch_get_obs": "boolean",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulateEggTouchSensors{suffix}-v1",
- entry_point="gym.envs.robotics:HandEggTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "random",
- "target_rotation": "xyz",
- "touch_get_obs": "sensordata",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulatePenRotate{suffix}-v0",
- entry_point="gym.envs.robotics:HandPenEnv",
- kwargs=_merge({"target_position": "ignore", "target_rotation": "xyz"}, kwargs),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulatePenRotateTouchSensors{suffix}-v0",
- entry_point="gym.envs.robotics:HandPenTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "xyz",
- "touch_get_obs": "boolean",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulatePenRotateTouchSensors{suffix}-v1",
- entry_point="gym.envs.robotics:HandPenTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "ignore",
- "target_rotation": "xyz",
- "touch_get_obs": "sensordata",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulatePenFull{suffix}-v0",
- entry_point="gym.envs.robotics:HandPenEnv",
- kwargs=_merge({"target_position": "random", "target_rotation": "xyz"}, kwargs),
- max_episode_steps=100,
- )
-
- # Alias for "Full"
- register(
- id=f"HandManipulatePen{suffix}-v0",
- entry_point="gym.envs.robotics:HandPenEnv",
- kwargs=_merge({"target_position": "random", "target_rotation": "xyz"}, kwargs),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulatePenTouchSensors{suffix}-v0",
- entry_point="gym.envs.robotics:HandPenTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "random",
- "target_rotation": "xyz",
- "touch_get_obs": "boolean",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
- register(
- id=f"HandManipulatePenTouchSensors{suffix}-v1",
- entry_point="gym.envs.robotics:HandPenTouchSensorsEnv",
- kwargs=_merge(
- {
- "target_position": "random",
- "target_rotation": "xyz",
- "touch_get_obs": "sensordata",
- },
- kwargs,
- ),
- max_episode_steps=100,
- )
-
# Unit test
# ---------
diff --git a/gym/envs/robotics/README.md b/gym/envs/robotics/README.md
deleted file mode 100644
index 241d6c3cd18..00000000000
--- a/gym/envs/robotics/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-# Robotics environments
-
-Details and documentation on these robotics environments are available in our [blog post](https://blog.openai.com/ingredients-for-robotics-research/), the accompanying [technical report](https://arxiv.org/abs/1802.09464), and the [Gym website](https://gym.openai.com/envs/#robotics).
-
-If you use these environments, please cite the following paper:
-
-```
-@misc{1802.09464,
- Author = {Matthias Plappert and Marcin Andrychowicz and Alex Ray and Bob McGrew and Bowen Baker and Glenn Powell and Jonas Schneider and Josh Tobin and Maciek Chociej and Peter Welinder and Vikash Kumar and Wojciech Zaremba},
- Title = {Multi-Goal Reinforcement Learning: Challenging Robotics Environments and Request for Research},
- Year = {2018},
- Eprint = {arXiv:1802.09464},
-}
-```
-
-## Fetch environments
-
-
-[FetchReach-v0](https://gym.openai.com/envs/FetchReach-v0/): Fetch has to move its end-effector to the desired goal position.
-
-
-
-
-[FetchSlide-v0](https://gym.openai.com/envs/FetchSlide-v0/): Fetch has to hit a puck across a long table such that it slides and comes to rest on the desired goal.
-
-
-
-
-[FetchPush-v0](https://gym.openai.com/envs/FetchPush-v0/): Fetch has to move a box by pushing it until it reaches a desired goal position.
-
-
-
-
-[FetchPickAndPlace-v0](https://gym.openai.com/envs/FetchPickAndPlace-v0/): Fetch has to pick up a box from a table using its gripper and move it to a desired goal above the table.
-
-## Shadow Dexterous Hand environments
-
-
-[HandReach-v0](https://gym.openai.com/envs/HandReach-v0/): ShadowHand has to reach with its thumb and a selected finger until they meet at a desired goal position above the palm.
-
-
-
-
-[HandManipulateBlock-v0](https://gym.openai.com/envs/HandManipulateBlock-v0/): ShadowHand has to manipulate a block until it achieves a desired goal position and rotation.
-
-
-
-
-[HandManipulateEgg-v0](https://gym.openai.com/envs/HandManipulateEgg-v0/): ShadowHand has to manipulate an egg until it achieves a desired goal position and rotation.
-
-
-
-
-[HandManipulatePen-v0](https://gym.openai.com/envs/HandManipulatePen-v0/): ShadowHand has to manipulate a pen until it achieves a desired goal position and rotation.
diff --git a/gym/envs/robotics/__init__.py b/gym/envs/robotics/__init__.py
deleted file mode 100644
index 8ff166314ab..00000000000
--- a/gym/envs/robotics/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-from gym.envs.robotics.fetch_env import FetchEnv
-from gym.envs.robotics.fetch.slide import FetchSlideEnv
-from gym.envs.robotics.fetch.pick_and_place import FetchPickAndPlaceEnv
-from gym.envs.robotics.fetch.push import FetchPushEnv
-from gym.envs.robotics.fetch.reach import FetchReachEnv
-
-from gym.envs.robotics.hand.reach import HandReachEnv
-from gym.envs.robotics.hand.manipulate import HandBlockEnv
-from gym.envs.robotics.hand.manipulate import HandEggEnv
-from gym.envs.robotics.hand.manipulate import HandPenEnv
-
-from gym.envs.robotics.hand.manipulate_touch_sensors import HandBlockTouchSensorsEnv
-from gym.envs.robotics.hand.manipulate_touch_sensors import HandEggTouchSensorsEnv
-from gym.envs.robotics.hand.manipulate_touch_sensors import HandPenTouchSensorsEnv
diff --git a/gym/envs/robotics/assets/LICENSE.md b/gym/envs/robotics/assets/LICENSE.md
deleted file mode 100644
index 22ce9010d0b..00000000000
--- a/gym/envs/robotics/assets/LICENSE.md
+++ /dev/null
@@ -1,222 +0,0 @@
-# Fetch Robotics
-The model of the [Fetch](http://fetchrobotics.com/platforms-research-development/) is based on [models provided by Fetch](https://github.com/fetchrobotics/fetch_ros/tree/indigo-devel/fetch_description). It was adapted and refined by OpenAI.
-
-# ShadowHand
-The model of the [ShadowHand](https://www.shadowrobot.com/products/dexterous-hand/) is based on [models provided by ShadowRobot](https://github.com/shadow-robot/sr_common/tree/kinetic-devel/sr_description/hand/model), and on code used under the following license:
-
-(C) Vikash Kumar, CSE, UW. Licensed under Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-Additional license notices:
-
- Sources : 1) Manipulator and Manipulation in High Dimensional Spaces. Vikash Kumar, Ph.D. Thesis, CSE, Univ. of Washington. 2016.
-
- Mujoco :: Advanced physics simulation engine
- Source : www.roboti.us
- Version : 1.40
- Released : 17Jan'17
-
- Author :: Vikash Kumar
- Contacts : vikash@openai.com
- Last edits : 3Apr'17
diff --git a/gym/envs/robotics/assets/fetch/pick_and_place.xml b/gym/envs/robotics/assets/fetch/pick_and_place.xml
deleted file mode 100644
index 337032a8329..00000000000
--- a/gym/envs/robotics/assets/fetch/pick_and_place.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/fetch/push.xml b/gym/envs/robotics/assets/fetch/push.xml
deleted file mode 100644
index 8e12db248c1..00000000000
--- a/gym/envs/robotics/assets/fetch/push.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/gym/envs/robotics/assets/fetch/reach.xml b/gym/envs/robotics/assets/fetch/reach.xml
deleted file mode 100644
index c73d6249f3d..00000000000
--- a/gym/envs/robotics/assets/fetch/reach.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/fetch/robot.xml b/gym/envs/robotics/assets/fetch/robot.xml
deleted file mode 100644
index b627d4925d5..00000000000
--- a/gym/envs/robotics/assets/fetch/robot.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/fetch/shared.xml b/gym/envs/robotics/assets/fetch/shared.xml
deleted file mode 100644
index 5d61fef70dd..00000000000
--- a/gym/envs/robotics/assets/fetch/shared.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/fetch/slide.xml b/gym/envs/robotics/assets/fetch/slide.xml
deleted file mode 100644
index efbfb51bd06..00000000000
--- a/gym/envs/robotics/assets/fetch/slide.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/manipulate_block.xml b/gym/envs/robotics/assets/hand/manipulate_block.xml
deleted file mode 100644
index 83a6517e6cf..00000000000
--- a/gym/envs/robotics/assets/hand/manipulate_block.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/manipulate_block_touch_sensors.xml b/gym/envs/robotics/assets/hand/manipulate_block_touch_sensors.xml
deleted file mode 100644
index b649f102917..00000000000
--- a/gym/envs/robotics/assets/hand/manipulate_block_touch_sensors.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/manipulate_egg.xml b/gym/envs/robotics/assets/hand/manipulate_egg.xml
deleted file mode 100644
index d60217f761f..00000000000
--- a/gym/envs/robotics/assets/hand/manipulate_egg.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/manipulate_egg_touch_sensors.xml b/gym/envs/robotics/assets/hand/manipulate_egg_touch_sensors.xml
deleted file mode 100644
index 73af83c0f5d..00000000000
--- a/gym/envs/robotics/assets/hand/manipulate_egg_touch_sensors.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/manipulate_pen.xml b/gym/envs/robotics/assets/hand/manipulate_pen.xml
deleted file mode 100644
index 20a6fb5e06d..00000000000
--- a/gym/envs/robotics/assets/hand/manipulate_pen.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/manipulate_pen_touch_sensors.xml b/gym/envs/robotics/assets/hand/manipulate_pen_touch_sensors.xml
deleted file mode 100644
index 758839bfcb2..00000000000
--- a/gym/envs/robotics/assets/hand/manipulate_pen_touch_sensors.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/reach.xml b/gym/envs/robotics/assets/hand/reach.xml
deleted file mode 100644
index 71f6dfe6218..00000000000
--- a/gym/envs/robotics/assets/hand/reach.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/robot.xml b/gym/envs/robotics/assets/hand/robot.xml
deleted file mode 100644
index dbb9e43448e..00000000000
--- a/gym/envs/robotics/assets/hand/robot.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/robot_touch_sensors_92.xml b/gym/envs/robotics/assets/hand/robot_touch_sensors_92.xml
deleted file mode 100644
index fa6d41c0a85..00000000000
--- a/gym/envs/robotics/assets/hand/robot_touch_sensors_92.xml
+++ /dev/null
@@ -1,252 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/shared.xml b/gym/envs/robotics/assets/hand/shared.xml
deleted file mode 100644
index f27f265551c..00000000000
--- a/gym/envs/robotics/assets/hand/shared.xml
+++ /dev/null
@@ -1,254 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/shared_asset.xml b/gym/envs/robotics/assets/hand/shared_asset.xml
deleted file mode 100644
index ec9a0b08b64..00000000000
--- a/gym/envs/robotics/assets/hand/shared_asset.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/hand/shared_touch_sensors_92.xml b/gym/envs/robotics/assets/hand/shared_touch_sensors_92.xml
deleted file mode 100644
index 472c84ccb7c..00000000000
--- a/gym/envs/robotics/assets/hand/shared_touch_sensors_92.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gym/envs/robotics/assets/stls/.get b/gym/envs/robotics/assets/stls/.get
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/gym/envs/robotics/assets/stls/fetch/base_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/base_link_collision.stl
deleted file mode 100644
index 1ef459fd5bb..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/base_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/bellows_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/bellows_link_collision.stl
deleted file mode 100644
index a7e5ab75ca4..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/bellows_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/elbow_flex_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/elbow_flex_link_collision.stl
deleted file mode 100644
index b0eea0777a1..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/elbow_flex_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/estop_link.stl b/gym/envs/robotics/assets/stls/fetch/estop_link.stl
deleted file mode 100644
index f6d1c72e85f..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/estop_link.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/forearm_roll_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/forearm_roll_link_collision.stl
deleted file mode 100644
index fe468c54063..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/forearm_roll_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/gripper_link.stl b/gym/envs/robotics/assets/stls/fetch/gripper_link.stl
deleted file mode 100644
index 8a1487401a6..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/gripper_link.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/head_pan_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/head_pan_link_collision.stl
deleted file mode 100644
index c77b5b18725..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/head_pan_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/head_tilt_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/head_tilt_link_collision.stl
deleted file mode 100644
index 53c2ddc58c1..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/head_tilt_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/l_wheel_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/l_wheel_link_collision.stl
deleted file mode 100644
index 5c1752487ef..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/l_wheel_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/laser_link.stl b/gym/envs/robotics/assets/stls/fetch/laser_link.stl
deleted file mode 100644
index fa4882fc983..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/laser_link.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/r_wheel_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/r_wheel_link_collision.stl
deleted file mode 100644
index 3742b24694f..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/r_wheel_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/shoulder_lift_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/shoulder_lift_link_collision.stl
deleted file mode 100644
index c9aff0dda92..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/shoulder_lift_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/shoulder_pan_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/shoulder_pan_link_collision.stl
deleted file mode 100644
index ac17a943757..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/shoulder_pan_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/torso_fixed_link.stl b/gym/envs/robotics/assets/stls/fetch/torso_fixed_link.stl
deleted file mode 100644
index 7cf7fc147eb..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/torso_fixed_link.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/torso_lift_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/torso_lift_link_collision.stl
deleted file mode 100644
index 4ce5fcf9c58..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/torso_lift_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/upperarm_roll_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/upperarm_roll_link_collision.stl
deleted file mode 100644
index 120793232e4..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/upperarm_roll_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/wrist_flex_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/wrist_flex_link_collision.stl
deleted file mode 100644
index 3215d2e1de0..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/wrist_flex_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/fetch/wrist_roll_link_collision.stl b/gym/envs/robotics/assets/stls/fetch/wrist_roll_link_collision.stl
deleted file mode 100644
index 742bdd9197a..00000000000
Binary files a/gym/envs/robotics/assets/stls/fetch/wrist_roll_link_collision.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/F1.stl b/gym/envs/robotics/assets/stls/hand/F1.stl
deleted file mode 100644
index 515d3c90169..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/F1.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/F2.stl b/gym/envs/robotics/assets/stls/hand/F2.stl
deleted file mode 100644
index 7bc5e20e068..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/F2.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/F3.stl b/gym/envs/robotics/assets/stls/hand/F3.stl
deleted file mode 100644
index 223f06f5bfb..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/F3.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/TH1_z.stl b/gym/envs/robotics/assets/stls/hand/TH1_z.stl
deleted file mode 100644
index 400ee2d6256..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/TH1_z.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/TH2_z.stl b/gym/envs/robotics/assets/stls/hand/TH2_z.stl
deleted file mode 100644
index 5ace8388b9f..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/TH2_z.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/TH3_z.stl b/gym/envs/robotics/assets/stls/hand/TH3_z.stl
deleted file mode 100644
index 23485abc720..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/TH3_z.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/forearm_electric.stl b/gym/envs/robotics/assets/stls/hand/forearm_electric.stl
deleted file mode 100644
index 80f6f3da189..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/forearm_electric.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/forearm_electric_cvx.stl b/gym/envs/robotics/assets/stls/hand/forearm_electric_cvx.stl
deleted file mode 100644
index 3c30f57eaa9..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/forearm_electric_cvx.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/knuckle.stl b/gym/envs/robotics/assets/stls/hand/knuckle.stl
deleted file mode 100644
index 4faedd75409..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/knuckle.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/lfmetacarpal.stl b/gym/envs/robotics/assets/stls/hand/lfmetacarpal.stl
deleted file mode 100644
index 535cf4dbca5..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/lfmetacarpal.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/palm.stl b/gym/envs/robotics/assets/stls/hand/palm.stl
deleted file mode 100644
index 65e47eb65da..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/palm.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/stls/hand/wrist.stl b/gym/envs/robotics/assets/stls/hand/wrist.stl
deleted file mode 100644
index 420d5f9c678..00000000000
Binary files a/gym/envs/robotics/assets/stls/hand/wrist.stl and /dev/null differ
diff --git a/gym/envs/robotics/assets/textures/block.png b/gym/envs/robotics/assets/textures/block.png
deleted file mode 100644
index 0243b8f3312..00000000000
Binary files a/gym/envs/robotics/assets/textures/block.png and /dev/null differ
diff --git a/gym/envs/robotics/assets/textures/block_hidden.png b/gym/envs/robotics/assets/textures/block_hidden.png
deleted file mode 100644
index e08b8613c4d..00000000000
Binary files a/gym/envs/robotics/assets/textures/block_hidden.png and /dev/null differ
diff --git a/gym/envs/robotics/fetch/__init__.py b/gym/envs/robotics/fetch/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/gym/envs/robotics/fetch/pick_and_place.py b/gym/envs/robotics/fetch/pick_and_place.py
deleted file mode 100644
index 4e1a6d5313b..00000000000
--- a/gym/envs/robotics/fetch/pick_and_place.py
+++ /dev/null
@@ -1,33 +0,0 @@
-import os
-from gym import utils
-from gym.envs.robotics import fetch_env
-
-
-# Ensure we get the path separator correct on windows
-MODEL_XML_PATH = os.path.join("fetch", "pick_and_place.xml")
-
-
-class FetchPickAndPlaceEnv(fetch_env.FetchEnv, utils.EzPickle):
- def __init__(self, reward_type="sparse"):
- initial_qpos = {
- "robot0:slide0": 0.405,
- "robot0:slide1": 0.48,
- "robot0:slide2": 0.0,
- "object0:joint": [1.25, 0.53, 0.4, 1.0, 0.0, 0.0, 0.0],
- }
- fetch_env.FetchEnv.__init__(
- self,
- MODEL_XML_PATH,
- has_object=True,
- block_gripper=False,
- n_substeps=20,
- gripper_extra_height=0.2,
- target_in_the_air=True,
- target_offset=0.0,
- obj_range=0.15,
- target_range=0.15,
- distance_threshold=0.05,
- initial_qpos=initial_qpos,
- reward_type=reward_type,
- )
- utils.EzPickle.__init__(self, reward_type=reward_type)
diff --git a/gym/envs/robotics/fetch/push.py b/gym/envs/robotics/fetch/push.py
deleted file mode 100644
index 3227374e8cc..00000000000
--- a/gym/envs/robotics/fetch/push.py
+++ /dev/null
@@ -1,33 +0,0 @@
-import os
-from gym import utils
-from gym.envs.robotics import fetch_env
-
-
-# Ensure we get the path separator correct on windows
-MODEL_XML_PATH = os.path.join("fetch", "push.xml")
-
-
-class FetchPushEnv(fetch_env.FetchEnv, utils.EzPickle):
- def __init__(self, reward_type="sparse"):
- initial_qpos = {
- "robot0:slide0": 0.405,
- "robot0:slide1": 0.48,
- "robot0:slide2": 0.0,
- "object0:joint": [1.25, 0.53, 0.4, 1.0, 0.0, 0.0, 0.0],
- }
- fetch_env.FetchEnv.__init__(
- self,
- MODEL_XML_PATH,
- has_object=True,
- block_gripper=True,
- n_substeps=20,
- gripper_extra_height=0.0,
- target_in_the_air=False,
- target_offset=0.0,
- obj_range=0.15,
- target_range=0.15,
- distance_threshold=0.05,
- initial_qpos=initial_qpos,
- reward_type=reward_type,
- )
- utils.EzPickle.__init__(self, reward_type=reward_type)
diff --git a/gym/envs/robotics/fetch/reach.py b/gym/envs/robotics/fetch/reach.py
deleted file mode 100644
index 67520b95064..00000000000
--- a/gym/envs/robotics/fetch/reach.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import os
-from gym import utils
-from gym.envs.robotics import fetch_env
-
-
-# Ensure we get the path separator correct on windows
-MODEL_XML_PATH = os.path.join("fetch", "reach.xml")
-
-
-class FetchReachEnv(fetch_env.FetchEnv, utils.EzPickle):
- def __init__(self, reward_type="sparse"):
- initial_qpos = {
- "robot0:slide0": 0.4049,
- "robot0:slide1": 0.48,
- "robot0:slide2": 0.0,
- }
- fetch_env.FetchEnv.__init__(
- self,
- MODEL_XML_PATH,
- has_object=False,
- block_gripper=True,
- n_substeps=20,
- gripper_extra_height=0.2,
- target_in_the_air=True,
- target_offset=0.0,
- obj_range=0.15,
- target_range=0.15,
- distance_threshold=0.05,
- initial_qpos=initial_qpos,
- reward_type=reward_type,
- )
- utils.EzPickle.__init__(self, reward_type=reward_type)
diff --git a/gym/envs/robotics/fetch/slide.py b/gym/envs/robotics/fetch/slide.py
deleted file mode 100644
index ab47db7ff52..00000000000
--- a/gym/envs/robotics/fetch/slide.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import os
-import numpy as np
-
-from gym import utils
-from gym.envs.robotics import fetch_env
-
-
-# Ensure we get the path separator correct on windows
-MODEL_XML_PATH = os.path.join("fetch", "slide.xml")
-
-
-class FetchSlideEnv(fetch_env.FetchEnv, utils.EzPickle):
- def __init__(self, reward_type="sparse"):
- initial_qpos = {
- "robot0:slide0": 0.05,
- "robot0:slide1": 0.48,
- "robot0:slide2": 0.0,
- "object0:joint": [1.7, 1.1, 0.41, 1.0, 0.0, 0.0, 0.0],
- }
- fetch_env.FetchEnv.__init__(
- self,
- MODEL_XML_PATH,
- has_object=True,
- block_gripper=True,
- n_substeps=20,
- gripper_extra_height=-0.02,
- target_in_the_air=False,
- target_offset=np.array([0.4, 0.0, 0.0]),
- obj_range=0.1,
- target_range=0.3,
- distance_threshold=0.05,
- initial_qpos=initial_qpos,
- reward_type=reward_type,
- )
- utils.EzPickle.__init__(self, reward_type=reward_type)
diff --git a/gym/envs/robotics/fetch_env.py b/gym/envs/robotics/fetch_env.py
deleted file mode 100644
index bed9f6883f2..00000000000
--- a/gym/envs/robotics/fetch_env.py
+++ /dev/null
@@ -1,230 +0,0 @@
-import numpy as np
-
-from gym.envs.robotics import rotations, robot_env, utils
-
-
-def goal_distance(goal_a, goal_b):
- assert goal_a.shape == goal_b.shape
- return np.linalg.norm(goal_a - goal_b, axis=-1)
-
-
-class FetchEnv(robot_env.RobotEnv):
- """Superclass for all Fetch environments."""
-
- def __init__(
- self,
- model_path,
- n_substeps,
- gripper_extra_height,
- block_gripper,
- has_object,
- target_in_the_air,
- target_offset,
- obj_range,
- target_range,
- distance_threshold,
- initial_qpos,
- reward_type,
- ):
- """Initializes a new Fetch environment.
-
- Args:
- model_path (string): path to the environments XML file
- n_substeps (int): number of substeps the simulation runs on every call to step
- gripper_extra_height (float): additional height above the table when positioning the gripper
- block_gripper (boolean): whether or not the gripper is blocked (i.e. not movable) or not
- has_object (boolean): whether or not the environment has an object
- target_in_the_air (boolean): whether or not the target should be in the air above the table or on the table surface
- target_offset (float or array with 3 elements): offset of the target
- obj_range (float): range of a uniform distribution for sampling initial object positions
- target_range (float): range of a uniform distribution for sampling a target
- distance_threshold (float): the threshold after which a goal is considered achieved
- initial_qpos (dict): a dictionary of joint names and values that define the initial configuration
- reward_type ('sparse' or 'dense'): the reward type, i.e. sparse or dense
- """
- self.gripper_extra_height = gripper_extra_height
- self.block_gripper = block_gripper
- self.has_object = has_object
- self.target_in_the_air = target_in_the_air
- self.target_offset = target_offset
- self.obj_range = obj_range
- self.target_range = target_range
- self.distance_threshold = distance_threshold
- self.reward_type = reward_type
-
- super().__init__(
- model_path=model_path,
- n_substeps=n_substeps,
- n_actions=4,
- initial_qpos=initial_qpos,
- )
-
- # GoalEnv methods
- # ----------------------------
-
- def compute_reward(self, achieved_goal, goal, info):
- # Compute distance between goal and the achieved goal.
- d = goal_distance(achieved_goal, goal)
- if self.reward_type == "sparse":
- return -(d > self.distance_threshold).astype(np.float32)
- else:
- return -d
-
- # RobotEnv methods
- # ----------------------------
-
- def _step_callback(self):
- if self.block_gripper:
- self.sim.data.set_joint_qpos("robot0:l_gripper_finger_joint", 0.0)
- self.sim.data.set_joint_qpos("robot0:r_gripper_finger_joint", 0.0)
- self.sim.forward()
-
- def _set_action(self, action):
- assert action.shape == (4,)
- action = (
- action.copy()
- ) # ensure that we don't change the action outside of this scope
- pos_ctrl, gripper_ctrl = action[:3], action[3]
-
- pos_ctrl *= 0.05 # limit maximum change in position
- rot_ctrl = [
- 1.0,
- 0.0,
- 1.0,
- 0.0,
- ] # fixed rotation of the end effector, expressed as a quaternion
- gripper_ctrl = np.array([gripper_ctrl, gripper_ctrl])
- assert gripper_ctrl.shape == (2,)
- if self.block_gripper:
- gripper_ctrl = np.zeros_like(gripper_ctrl)
- action = np.concatenate([pos_ctrl, rot_ctrl, gripper_ctrl])
-
- # Apply action to simulation.
- utils.ctrl_set_action(self.sim, action)
- utils.mocap_set_action(self.sim, action)
-
- def _get_obs(self):
- # positions
- grip_pos = self.sim.data.get_site_xpos("robot0:grip")
- dt = self.sim.nsubsteps * self.sim.model.opt.timestep
- grip_velp = self.sim.data.get_site_xvelp("robot0:grip") * dt
- robot_qpos, robot_qvel = utils.robot_get_obs(self.sim)
- if self.has_object:
- object_pos = self.sim.data.get_site_xpos("object0")
- # rotations
- object_rot = rotations.mat2euler(self.sim.data.get_site_xmat("object0"))
- # velocities
- object_velp = self.sim.data.get_site_xvelp("object0") * dt
- object_velr = self.sim.data.get_site_xvelr("object0") * dt
- # gripper state
- object_rel_pos = object_pos - grip_pos
- object_velp -= grip_velp
- else:
- object_pos = (
- object_rot
- ) = object_velp = object_velr = object_rel_pos = np.zeros(0)
- gripper_state = robot_qpos[-2:]
- gripper_vel = (
- robot_qvel[-2:] * dt
- ) # change to a scalar if the gripper is made symmetric
-
- if not self.has_object:
- achieved_goal = grip_pos.copy()
- else:
- achieved_goal = np.squeeze(object_pos.copy())
- obs = np.concatenate(
- [
- grip_pos,
- object_pos.ravel(),
- object_rel_pos.ravel(),
- gripper_state,
- object_rot.ravel(),
- object_velp.ravel(),
- object_velr.ravel(),
- grip_velp,
- gripper_vel,
- ]
- )
-
- return {
- "observation": obs.copy(),
- "achieved_goal": achieved_goal.copy(),
- "desired_goal": self.goal.copy(),
- }
-
- def _viewer_setup(self):
- body_id = self.sim.model.body_name2id("robot0:gripper_link")
- lookat = self.sim.data.body_xpos[body_id]
- for idx, value in enumerate(lookat):
- self.viewer.cam.lookat[idx] = value
- self.viewer.cam.distance = 2.5
- self.viewer.cam.azimuth = 132.0
- self.viewer.cam.elevation = -14.0
-
- def _render_callback(self):
- # Visualize target.
- sites_offset = (self.sim.data.site_xpos - self.sim.model.site_pos).copy()
- site_id = self.sim.model.site_name2id("target0")
- self.sim.model.site_pos[site_id] = self.goal - sites_offset[0]
- self.sim.forward()
-
- def _reset_sim(self):
- self.sim.set_state(self.initial_state)
-
- # Randomize start position of object.
- if self.has_object:
- object_xpos = self.initial_gripper_xpos[:2]
- while np.linalg.norm(object_xpos - self.initial_gripper_xpos[:2]) < 0.1:
- object_xpos = self.initial_gripper_xpos[:2] + self.np_random.uniform(
- -self.obj_range, self.obj_range, size=2
- )
- object_qpos = self.sim.data.get_joint_qpos("object0:joint")
- assert object_qpos.shape == (7,)
- object_qpos[:2] = object_xpos
- self.sim.data.set_joint_qpos("object0:joint", object_qpos)
-
- self.sim.forward()
- return True
-
- def _sample_goal(self):
- if self.has_object:
- goal = self.initial_gripper_xpos[:3] + self.np_random.uniform(
- -self.target_range, self.target_range, size=3
- )
- goal += self.target_offset
- goal[2] = self.height_offset
- if self.target_in_the_air and self.np_random.uniform() < 0.5:
- goal[2] += self.np_random.uniform(0, 0.45)
- else:
- goal = self.initial_gripper_xpos[:3] + self.np_random.uniform(
- -self.target_range, self.target_range, size=3
- )
- return goal.copy()
-
- def _is_success(self, achieved_goal, desired_goal):
- d = goal_distance(achieved_goal, desired_goal)
- return (d < self.distance_threshold).astype(np.float32)
-
- def _env_setup(self, initial_qpos):
- for name, value in initial_qpos.items():
- self.sim.data.set_joint_qpos(name, value)
- utils.reset_mocap_welds(self.sim)
- self.sim.forward()
-
- # Move end effector into position.
- gripper_target = np.array(
- [-0.498, 0.005, -0.431 + self.gripper_extra_height]
- ) + self.sim.data.get_site_xpos("robot0:grip")
- gripper_rotation = np.array([1.0, 0.0, 1.0, 0.0])
- self.sim.data.set_mocap_pos("robot0:mocap", gripper_target)
- self.sim.data.set_mocap_quat("robot0:mocap", gripper_rotation)
- for _ in range(10):
- self.sim.step()
-
- # Extract information for sampling goals.
- self.initial_gripper_xpos = self.sim.data.get_site_xpos("robot0:grip").copy()
- if self.has_object:
- self.height_offset = self.sim.data.get_site_xpos("object0")[2]
-
- def render(self, mode="human", width=500, height=500):
- return super().render(mode, width, height)
diff --git a/gym/envs/robotics/hand/__init__.py b/gym/envs/robotics/hand/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/gym/envs/robotics/hand/manipulate.py b/gym/envs/robotics/hand/manipulate.py
deleted file mode 100644
index 7bf9fac04aa..00000000000
--- a/gym/envs/robotics/hand/manipulate.py
+++ /dev/null
@@ -1,354 +0,0 @@
-import os
-import numpy as np
-
-from gym import utils, error
-from gym.envs.robotics import rotations, hand_env
-from gym.envs.robotics.utils import robot_get_obs
-
-try:
- import mujoco_py
-except ImportError as e:
- raise error.DependencyNotInstalled(
- "{}. (HINT: you need to install mujoco_py, and also perform the setup instructions here: https://github.com/openai/mujoco-py/.)".format(
- e
- )
- )
-
-
-def quat_from_angle_and_axis(angle, axis):
- assert axis.shape == (3,)
- axis /= np.linalg.norm(axis)
- quat = np.concatenate([[np.cos(angle / 2.0)], np.sin(angle / 2.0) * axis])
- quat /= np.linalg.norm(quat)
- return quat
-
-
-# Ensure we get the path separator correct on windows
-MANIPULATE_BLOCK_XML = os.path.join("hand", "manipulate_block.xml")
-MANIPULATE_EGG_XML = os.path.join("hand", "manipulate_egg.xml")
-MANIPULATE_PEN_XML = os.path.join("hand", "manipulate_pen.xml")
-
-
-class ManipulateEnv(hand_env.HandEnv):
- def __init__(
- self,
- model_path,
- target_position,
- target_rotation,
- target_position_range,
- reward_type,
- initial_qpos=None,
- randomize_initial_position=True,
- randomize_initial_rotation=True,
- distance_threshold=0.01,
- rotation_threshold=0.1,
- n_substeps=20,
- relative_control=False,
- ignore_z_target_rotation=False,
- ):
- """Initializes a new Hand manipulation environment.
-
- Args:
- model_path (string): path to the environments XML file
- target_position (string): the type of target position:
- - ignore: target position is fully ignored, i.e. the object can be positioned arbitrarily
- - fixed: target position is set to the initial position of the object
- - random: target position is fully randomized according to target_position_range
- target_rotation (string): the type of target rotation:
- - ignore: target rotation is fully ignored, i.e. the object can be rotated arbitrarily
- - fixed: target rotation is set to the initial rotation of the object
- - xyz: fully randomized target rotation around the X, Y and Z axis
- - z: fully randomized target rotation around the Z axis
- - parallel: fully randomized target rotation around Z and axis-aligned rotation around X, Y
- ignore_z_target_rotation (boolean): whether or not the Z axis of the target rotation is ignored
- target_position_range (np.array of shape (3, 2)): range of the target_position randomization
- reward_type ('sparse' or 'dense'): the reward type, i.e. sparse or dense
- initial_qpos (dict): a dictionary of joint names and values that define the initial configuration
- randomize_initial_position (boolean): whether or not to randomize the initial position of the object
- randomize_initial_rotation (boolean): whether or not to randomize the initial rotation of the object
- distance_threshold (float, in meters): the threshold after which the position of a goal is considered achieved
- rotation_threshold (float, in radians): the threshold after which the rotation of a goal is considered achieved
- n_substeps (int): number of substeps the simulation runs on every call to step
- relative_control (boolean): whether or not the hand is actuated in absolute joint positions or relative to the current state
- """
- self.target_position = target_position
- self.target_rotation = target_rotation
- self.target_position_range = target_position_range
- self.parallel_quats = [
- rotations.euler2quat(r) for r in rotations.get_parallel_rotations()
- ]
- self.randomize_initial_rotation = randomize_initial_rotation
- self.randomize_initial_position = randomize_initial_position
- self.distance_threshold = distance_threshold
- self.rotation_threshold = rotation_threshold
- self.reward_type = reward_type
- self.ignore_z_target_rotation = ignore_z_target_rotation
-
- assert self.target_position in ["ignore", "fixed", "random"]
- assert self.target_rotation in ["ignore", "fixed", "xyz", "z", "parallel"]
- initial_qpos = initial_qpos or {}
-
- hand_env.HandEnv.__init__(
- self,
- model_path,
- n_substeps=n_substeps,
- initial_qpos=initial_qpos,
- relative_control=relative_control,
- )
-
- def _get_achieved_goal(self):
- # Object position and rotation.
- object_qpos = self.sim.data.get_joint_qpos("object:joint")
- assert object_qpos.shape == (7,)
- return object_qpos
-
- def _goal_distance(self, goal_a, goal_b):
- assert goal_a.shape == goal_b.shape
- assert goal_a.shape[-1] == 7
-
- d_pos = np.zeros_like(goal_a[..., 0])
- d_rot = np.zeros_like(goal_b[..., 0])
- if self.target_position != "ignore":
- delta_pos = goal_a[..., :3] - goal_b[..., :3]
- d_pos = np.linalg.norm(delta_pos, axis=-1)
-
- if self.target_rotation != "ignore":
- quat_a, quat_b = goal_a[..., 3:], goal_b[..., 3:]
-
- if self.ignore_z_target_rotation:
- # Special case: We want to ignore the Z component of the rotation.
- # This code here assumes Euler angles with xyz convention. We first transform
- # to euler, then set the Z component to be equal between the two, and finally
- # transform back into quaternions.
- euler_a = rotations.quat2euler(quat_a)
- euler_b = rotations.quat2euler(quat_b)
- euler_a[2] = euler_b[2]
- quat_a = rotations.euler2quat(euler_a)
-
- # Subtract quaternions and extract angle between them.
- quat_diff = rotations.quat_mul(quat_a, rotations.quat_conjugate(quat_b))
- angle_diff = 2 * np.arccos(np.clip(quat_diff[..., 0], -1.0, 1.0))
- d_rot = angle_diff
- assert d_pos.shape == d_rot.shape
- return d_pos, d_rot
-
- # GoalEnv methods
- # ----------------------------
-
- def compute_reward(self, achieved_goal, goal, info):
- if self.reward_type == "sparse":
- success = self._is_success(achieved_goal, goal).astype(np.float32)
- return success - 1.0
- else:
- d_pos, d_rot = self._goal_distance(achieved_goal, goal)
- # We weigh the difference in position to avoid that `d_pos` (in meters) is completely
- # dominated by `d_rot` (in radians).
- return -(10.0 * d_pos + d_rot)
-
- # RobotEnv methods
- # ----------------------------
-
- def _is_success(self, achieved_goal, desired_goal):
- d_pos, d_rot = self._goal_distance(achieved_goal, desired_goal)
- achieved_pos = (d_pos < self.distance_threshold).astype(np.float32)
- achieved_rot = (d_rot < self.rotation_threshold).astype(np.float32)
- achieved_both = achieved_pos * achieved_rot
- return achieved_both
-
- def _env_setup(self, initial_qpos):
- for name, value in initial_qpos.items():
- self.sim.data.set_joint_qpos(name, value)
- self.sim.forward()
-
- def _reset_sim(self):
- self.sim.set_state(self.initial_state)
- self.sim.forward()
-
- initial_qpos = self.sim.data.get_joint_qpos("object:joint").copy()
- initial_pos, initial_quat = initial_qpos[:3], initial_qpos[3:]
- assert initial_qpos.shape == (7,)
- assert initial_pos.shape == (3,)
- assert initial_quat.shape == (4,)
- initial_qpos = None
-
- # Randomization initial rotation.
- if self.randomize_initial_rotation:
- if self.target_rotation == "z":
- angle = self.np_random.uniform(-np.pi, np.pi)
- axis = np.array([0.0, 0.0, 1.0])
- offset_quat = quat_from_angle_and_axis(angle, axis)
- initial_quat = rotations.quat_mul(initial_quat, offset_quat)
- elif self.target_rotation == "parallel":
- angle = self.np_random.uniform(-np.pi, np.pi)
- axis = np.array([0.0, 0.0, 1.0])
- z_quat = quat_from_angle_and_axis(angle, axis)
- parallel_quat = self.parallel_quats[
- self.np_random.integers(len(self.parallel_quats))
- ]
- offset_quat = rotations.quat_mul(z_quat, parallel_quat)
- initial_quat = rotations.quat_mul(initial_quat, offset_quat)
- elif self.target_rotation in ["xyz", "ignore"]:
- angle = self.np_random.uniform(-np.pi, np.pi)
- axis = self.np_random.uniform(-1.0, 1.0, size=3)
- offset_quat = quat_from_angle_and_axis(angle, axis)
- initial_quat = rotations.quat_mul(initial_quat, offset_quat)
- elif self.target_rotation == "fixed":
- pass
- else:
- raise error.Error(
- f'Unknown target_rotation option "{self.target_rotation}".'
- )
-
- # Randomize initial position.
- if self.randomize_initial_position:
- if self.target_position != "fixed":
- initial_pos += self.np_random.normal(size=3, scale=0.005)
-
- initial_quat /= np.linalg.norm(initial_quat)
- initial_qpos = np.concatenate([initial_pos, initial_quat])
- self.sim.data.set_joint_qpos("object:joint", initial_qpos)
-
- def is_on_palm():
- self.sim.forward()
- cube_middle_idx = self.sim.model.site_name2id("object:center")
- cube_middle_pos = self.sim.data.site_xpos[cube_middle_idx]
- is_on_palm = cube_middle_pos[2] > 0.04
- return is_on_palm
-
- # Run the simulation for a bunch of timesteps to let everything settle in.
- for _ in range(10):
- self._set_action(np.zeros(20))
- try:
- self.sim.step()
- except mujoco_py.MujocoException:
- return False
- return is_on_palm()
-
- def _sample_goal(self):
- # Select a goal for the object position.
- target_pos = None
- if self.target_position == "random":
- assert self.target_position_range.shape == (3, 2)
- offset = self.np_random.uniform(
- self.target_position_range[:, 0], self.target_position_range[:, 1]
- )
- assert offset.shape == (3,)
- target_pos = self.sim.data.get_joint_qpos("object:joint")[:3] + offset
- elif self.target_position in ["ignore", "fixed"]:
- target_pos = self.sim.data.get_joint_qpos("object:joint")[:3]
- else:
- raise error.Error(
- f'Unknown target_position option "{self.target_position}".'
- )
- assert target_pos is not None
- assert target_pos.shape == (3,)
-
- # Select a goal for the object rotation.
- target_quat = None
- if self.target_rotation == "z":
- angle = self.np_random.uniform(-np.pi, np.pi)
- axis = np.array([0.0, 0.0, 1.0])
- target_quat = quat_from_angle_and_axis(angle, axis)
- elif self.target_rotation == "parallel":
- angle = self.np_random.uniform(-np.pi, np.pi)
- axis = np.array([0.0, 0.0, 1.0])
- target_quat = quat_from_angle_and_axis(angle, axis)
- parallel_quat = self.parallel_quats[
- self.np_random.integers(len(self.parallel_quats))
- ]
- target_quat = rotations.quat_mul(target_quat, parallel_quat)
- elif self.target_rotation == "xyz":
- angle = self.np_random.uniform(-np.pi, np.pi)
- axis = self.np_random.uniform(-1.0, 1.0, size=3)
- target_quat = quat_from_angle_and_axis(angle, axis)
- elif self.target_rotation in ["ignore", "fixed"]:
- target_quat = self.sim.data.get_joint_qpos("object:joint")
- else:
- raise error.Error(
- f'Unknown target_rotation option "{self.target_rotation}".'
- )
- assert target_quat is not None
- assert target_quat.shape == (4,)
-
- target_quat /= np.linalg.norm(target_quat) # normalized quaternion
- goal = np.concatenate([target_pos, target_quat])
- return goal
-
- def _render_callback(self):
- # Assign current state to target object but offset a bit so that the actual object
- # is not obscured.
- goal = self.goal.copy()
- assert goal.shape == (7,)
- if self.target_position == "ignore":
- # Move the object to the side since we do not care about it's position.
- goal[0] += 0.15
- self.sim.data.set_joint_qpos("target:joint", goal)
- self.sim.data.set_joint_qvel("target:joint", np.zeros(6))
-
- if "object_hidden" in self.sim.model.geom_names:
- hidden_id = self.sim.model.geom_name2id("object_hidden")
- self.sim.model.geom_rgba[hidden_id, 3] = 1.0
- self.sim.forward()
-
- def _get_obs(self):
- robot_qpos, robot_qvel = robot_get_obs(self.sim)
- object_qvel = self.sim.data.get_joint_qvel("object:joint")
- achieved_goal = (
- self._get_achieved_goal().ravel()
- ) # this contains the object position + rotation
- observation = np.concatenate(
- [robot_qpos, robot_qvel, object_qvel, achieved_goal]
- )
- return {
- "observation": observation.copy(),
- "achieved_goal": achieved_goal.copy(),
- "desired_goal": self.goal.ravel().copy(),
- }
-
-
-class HandBlockEnv(ManipulateEnv, utils.EzPickle):
- def __init__(
- self, target_position="random", target_rotation="xyz", reward_type="sparse"
- ):
- utils.EzPickle.__init__(self, target_position, target_rotation, reward_type)
- ManipulateEnv.__init__(
- self,
- model_path=MANIPULATE_BLOCK_XML,
- target_position=target_position,
- target_rotation=target_rotation,
- target_position_range=np.array([(-0.04, 0.04), (-0.06, 0.02), (0.0, 0.06)]),
- reward_type=reward_type,
- )
-
-
-class HandEggEnv(ManipulateEnv, utils.EzPickle):
- def __init__(
- self, target_position="random", target_rotation="xyz", reward_type="sparse"
- ):
- utils.EzPickle.__init__(self, target_position, target_rotation, reward_type)
- ManipulateEnv.__init__(
- self,
- model_path=MANIPULATE_EGG_XML,
- target_position=target_position,
- target_rotation=target_rotation,
- target_position_range=np.array([(-0.04, 0.04), (-0.06, 0.02), (0.0, 0.06)]),
- reward_type=reward_type,
- )
-
-
-class HandPenEnv(ManipulateEnv, utils.EzPickle):
- def __init__(
- self, target_position="random", target_rotation="xyz", reward_type="sparse"
- ):
- utils.EzPickle.__init__(self, target_position, target_rotation, reward_type)
- ManipulateEnv.__init__(
- self,
- model_path=MANIPULATE_PEN_XML,
- target_position=target_position,
- target_rotation=target_rotation,
- target_position_range=np.array([(-0.04, 0.04), (-0.06, 0.02), (0.0, 0.06)]),
- randomize_initial_rotation=False,
- reward_type=reward_type,
- ignore_z_target_rotation=True,
- distance_threshold=0.05,
- )
diff --git a/gym/envs/robotics/hand/manipulate_touch_sensors.py b/gym/envs/robotics/hand/manipulate_touch_sensors.py
deleted file mode 100644
index 57d0480aab2..00000000000
--- a/gym/envs/robotics/hand/manipulate_touch_sensors.py
+++ /dev/null
@@ -1,207 +0,0 @@
-import os
-import numpy as np
-
-from gym import utils, error, spaces
-from gym.envs.robotics.hand import manipulate
-
-# Ensure we get the path separator correct on windows
-MANIPULATE_BLOCK_XML = os.path.join("hand", "manipulate_block_touch_sensors.xml")
-MANIPULATE_EGG_XML = os.path.join("hand", "manipulate_egg_touch_sensors.xml")
-MANIPULATE_PEN_XML = os.path.join("hand", "manipulate_pen_touch_sensors.xml")
-
-
-class ManipulateTouchSensorsEnv(manipulate.ManipulateEnv):
- def __init__(
- self,
- model_path,
- target_position,
- target_rotation,
- target_position_range,
- reward_type,
- initial_qpos={},
- randomize_initial_position=True,
- randomize_initial_rotation=True,
- distance_threshold=0.01,
- rotation_threshold=0.1,
- n_substeps=20,
- relative_control=False,
- ignore_z_target_rotation=False,
- touch_visualisation="on_touch",
- touch_get_obs="sensordata",
- ):
- """Initializes a new Hand manipulation environment with touch sensors.
-
- Args:
- touch_visualisation (string): how touch sensor sites are visualised
- - "on_touch": shows touch sensor sites only when touch values > 0
- - "always": always shows touch sensor sites
- - "off" or else: does not show touch sensor sites
- touch_get_obs (string): touch sensor readings
- - "boolean": returns 1 if touch sensor reading != 0.0 else 0
- - "sensordata": returns original touch sensor readings from self.sim.data.sensordata[id]
- - "log": returns log(x+1) touch sensor readings from self.sim.data.sensordata[id]
- - "off" or else: does not add touch sensor readings to the observation
-
- """
- self.touch_visualisation = touch_visualisation
- self.touch_get_obs = touch_get_obs
- self._touch_sensor_id_site_id = []
- self._touch_sensor_id = []
- self.touch_color = [1, 0, 0, 0.5]
- self.notouch_color = [0, 0.5, 0, 0.2]
-
- manipulate.ManipulateEnv.__init__(
- self,
- model_path,
- target_position,
- target_rotation,
- target_position_range,
- reward_type,
- initial_qpos=initial_qpos,
- randomize_initial_position=randomize_initial_position,
- randomize_initial_rotation=randomize_initial_rotation,
- distance_threshold=distance_threshold,
- rotation_threshold=rotation_threshold,
- n_substeps=n_substeps,
- relative_control=relative_control,
- ignore_z_target_rotation=ignore_z_target_rotation,
- )
-
- for (
- k,
- v,
- ) in (
- self.sim.model._sensor_name2id.items()
- ): # get touch sensor site names and their ids
- if "robot0:TS_" in k:
- self._touch_sensor_id_site_id.append(
- (
- v,
- self.sim.model._site_name2id[
- k.replace("robot0:TS_", "robot0:T_")
- ],
- )
- )
- self._touch_sensor_id.append(v)
-
- if self.touch_visualisation == "off": # set touch sensors rgba values
- for _, site_id in self._touch_sensor_id_site_id:
- self.sim.model.site_rgba[site_id][3] = 0.0
- elif self.touch_visualisation == "always":
- pass
-
- obs = self._get_obs()
- self.observation_space = spaces.Dict(
- dict(
- desired_goal=spaces.Box(
- -np.inf, np.inf, shape=obs["achieved_goal"].shape, dtype="float32"
- ),
- achieved_goal=spaces.Box(
- -np.inf, np.inf, shape=obs["achieved_goal"].shape, dtype="float32"
- ),
- observation=spaces.Box(
- -np.inf, np.inf, shape=obs["observation"].shape, dtype="float32"
- ),
- )
- )
-
- def _render_callback(self):
- super()._render_callback()
- if self.touch_visualisation == "on_touch":
- for touch_sensor_id, site_id in self._touch_sensor_id_site_id:
- if self.sim.data.sensordata[touch_sensor_id] != 0.0:
- self.sim.model.site_rgba[site_id] = self.touch_color
- else:
- self.sim.model.site_rgba[site_id] = self.notouch_color
-
- def _get_obs(self):
- robot_qpos, robot_qvel = manipulate.robot_get_obs(self.sim)
- object_qvel = self.sim.data.get_joint_qvel("object:joint")
- achieved_goal = (
- self._get_achieved_goal().ravel()
- ) # this contains the object position + rotation
- touch_values = [] # get touch sensor readings. if there is one, set value to 1
- if self.touch_get_obs == "sensordata":
- touch_values = self.sim.data.sensordata[self._touch_sensor_id]
- elif self.touch_get_obs == "boolean":
- touch_values = self.sim.data.sensordata[self._touch_sensor_id] > 0.0
- elif self.touch_get_obs == "log":
- touch_values = np.log(self.sim.data.sensordata[self._touch_sensor_id] + 1.0)
- observation = np.concatenate(
- [robot_qpos, robot_qvel, object_qvel, touch_values, achieved_goal]
- )
-
- return {
- "observation": observation.copy(),
- "achieved_goal": achieved_goal.copy(),
- "desired_goal": self.goal.ravel().copy(),
- }
-
-
-class HandBlockTouchSensorsEnv(ManipulateTouchSensorsEnv, utils.EzPickle):
- def __init__(
- self,
- target_position="random",
- target_rotation="xyz",
- touch_get_obs="sensordata",
- reward_type="sparse",
- ):
- utils.EzPickle.__init__(
- self, target_position, target_rotation, touch_get_obs, reward_type
- )
- ManipulateTouchSensorsEnv.__init__(
- self,
- model_path=MANIPULATE_BLOCK_XML,
- touch_get_obs=touch_get_obs,
- target_rotation=target_rotation,
- target_position=target_position,
- target_position_range=np.array([(-0.04, 0.04), (-0.06, 0.02), (0.0, 0.06)]),
- reward_type=reward_type,
- )
-
-
-class HandEggTouchSensorsEnv(ManipulateTouchSensorsEnv, utils.EzPickle):
- def __init__(
- self,
- target_position="random",
- target_rotation="xyz",
- touch_get_obs="sensordata",
- reward_type="sparse",
- ):
- utils.EzPickle.__init__(
- self, target_position, target_rotation, touch_get_obs, reward_type
- )
- ManipulateTouchSensorsEnv.__init__(
- self,
- model_path=MANIPULATE_EGG_XML,
- touch_get_obs=touch_get_obs,
- target_rotation=target_rotation,
- target_position=target_position,
- target_position_range=np.array([(-0.04, 0.04), (-0.06, 0.02), (0.0, 0.06)]),
- reward_type=reward_type,
- )
-
-
-class HandPenTouchSensorsEnv(ManipulateTouchSensorsEnv, utils.EzPickle):
- def __init__(
- self,
- target_position="random",
- target_rotation="xyz",
- touch_get_obs="sensordata",
- reward_type="sparse",
- ):
- utils.EzPickle.__init__(
- self, target_position, target_rotation, touch_get_obs, reward_type
- )
- ManipulateTouchSensorsEnv.__init__(
- self,
- model_path=MANIPULATE_PEN_XML,
- touch_get_obs=touch_get_obs,
- target_rotation=target_rotation,
- target_position=target_position,
- target_position_range=np.array([(-0.04, 0.04), (-0.06, 0.02), (0.0, 0.06)]),
- randomize_initial_rotation=False,
- reward_type=reward_type,
- ignore_z_target_rotation=True,
- distance_threshold=0.05,
- )
diff --git a/gym/envs/robotics/hand/reach.py b/gym/envs/robotics/hand/reach.py
deleted file mode 100644
index 4ece62c750a..00000000000
--- a/gym/envs/robotics/hand/reach.py
+++ /dev/null
@@ -1,161 +0,0 @@
-import os
-import numpy as np
-
-from gym import utils
-from gym.envs.robotics import hand_env
-from gym.envs.robotics.utils import robot_get_obs
-
-
-FINGERTIP_SITE_NAMES = [
- "robot0:S_fftip",
- "robot0:S_mftip",
- "robot0:S_rftip",
- "robot0:S_lftip",
- "robot0:S_thtip",
-]
-
-
-DEFAULT_INITIAL_QPOS = {
- "robot0:WRJ1": -0.16514339750464327,
- "robot0:WRJ0": -0.31973286565062153,
- "robot0:FFJ3": 0.14340512546557435,
- "robot0:FFJ2": 0.32028208333591573,
- "robot0:FFJ1": 0.7126053607727917,
- "robot0:FFJ0": 0.6705281001412586,
- "robot0:MFJ3": 0.000246444303701037,
- "robot0:MFJ2": 0.3152655251085491,
- "robot0:MFJ1": 0.7659800313729842,
- "robot0:MFJ0": 0.7323156897425923,
- "robot0:RFJ3": 0.00038520700007378114,
- "robot0:RFJ2": 0.36743546201985233,
- "robot0:RFJ1": 0.7119514095008576,
- "robot0:RFJ0": 0.6699446327514138,
- "robot0:LFJ4": 0.0525442258033891,
- "robot0:LFJ3": -0.13615534724474673,
- "robot0:LFJ2": 0.39872030433433003,
- "robot0:LFJ1": 0.7415570009679252,
- "robot0:LFJ0": 0.704096378652974,
- "robot0:THJ4": 0.003673823825070126,
- "robot0:THJ3": 0.5506291436028695,
- "robot0:THJ2": -0.014515151997119306,
- "robot0:THJ1": -0.0015229223564485414,
- "robot0:THJ0": -0.7894883021600622,
-}
-
-
-# Ensure we get the path separator correct on windows
-MODEL_XML_PATH = os.path.join("hand", "reach.xml")
-
-
-def goal_distance(goal_a, goal_b):
- assert goal_a.shape == goal_b.shape
- return np.linalg.norm(goal_a - goal_b, axis=-1)
-
-
-class HandReachEnv(hand_env.HandEnv, utils.EzPickle):
- def __init__(
- self,
- distance_threshold=0.01,
- n_substeps=20,
- relative_control=False,
- initial_qpos=DEFAULT_INITIAL_QPOS,
- reward_type="sparse",
- ):
- utils.EzPickle.__init__(**locals())
- self.distance_threshold = distance_threshold
- self.reward_type = reward_type
-
- hand_env.HandEnv.__init__(
- self,
- MODEL_XML_PATH,
- n_substeps=n_substeps,
- initial_qpos=initial_qpos,
- relative_control=relative_control,
- )
-
- def _get_achieved_goal(self):
- goal = [self.sim.data.get_site_xpos(name) for name in FINGERTIP_SITE_NAMES]
- return np.array(goal).flatten()
-
- # GoalEnv methods
- # ----------------------------
-
- def compute_reward(self, achieved_goal, goal, info):
- d = goal_distance(achieved_goal, goal)
- if self.reward_type == "sparse":
- return -(d > self.distance_threshold).astype(np.float32)
- else:
- return -d
-
- # RobotEnv methods
- # ----------------------------
-
- def _env_setup(self, initial_qpos):
- for name, value in initial_qpos.items():
- self.sim.data.set_joint_qpos(name, value)
- self.sim.forward()
-
- self.initial_goal = self._get_achieved_goal().copy()
- self.palm_xpos = self.sim.data.body_xpos[
- self.sim.model.body_name2id("robot0:palm")
- ].copy()
-
- def _get_obs(self):
- robot_qpos, robot_qvel = robot_get_obs(self.sim)
- achieved_goal = self._get_achieved_goal().ravel()
- observation = np.concatenate([robot_qpos, robot_qvel, achieved_goal])
- return {
- "observation": observation.copy(),
- "achieved_goal": achieved_goal.copy(),
- "desired_goal": self.goal.copy(),
- }
-
- def _sample_goal(self):
- thumb_name = "robot0:S_thtip"
- finger_names = [name for name in FINGERTIP_SITE_NAMES if name != thumb_name]
- finger_name = self.np_random.choice(finger_names)
-
- thumb_idx = FINGERTIP_SITE_NAMES.index(thumb_name)
- finger_idx = FINGERTIP_SITE_NAMES.index(finger_name)
- assert thumb_idx != finger_idx
-
- # Pick a meeting point above the hand.
- meeting_pos = self.palm_xpos + np.array([0.0, -0.09, 0.05])
- meeting_pos += self.np_random.normal(scale=0.005, size=meeting_pos.shape)
-
- # Slightly move meeting goal towards the respective finger to avoid that they
- # overlap.
- goal = self.initial_goal.copy().reshape(-1, 3)
- for idx in [thumb_idx, finger_idx]:
- offset_direction = meeting_pos - goal[idx]
- offset_direction /= np.linalg.norm(offset_direction)
- goal[idx] = meeting_pos - 0.005 * offset_direction
-
- if self.np_random.uniform() < 0.1:
- # With some probability, ask all fingers to move back to the origin.
- # This avoids that the thumb constantly stays near the goal position already.
- goal = self.initial_goal.copy()
- return goal.flatten()
-
- def _is_success(self, achieved_goal, desired_goal):
- d = goal_distance(achieved_goal, desired_goal)
- return (d < self.distance_threshold).astype(np.float32)
-
- def _render_callback(self):
- # Visualize targets.
- sites_offset = (self.sim.data.site_xpos - self.sim.model.site_pos).copy()
- goal = self.goal.reshape(5, 3)
- for finger_idx in range(5):
- site_name = f"target{finger_idx}"
- site_id = self.sim.model.site_name2id(site_name)
- self.sim.model.site_pos[site_id] = goal[finger_idx] - sites_offset[site_id]
-
- # Visualize finger positions.
- achieved_goal = self._get_achieved_goal().reshape(5, 3)
- for finger_idx in range(5):
- site_name = f"finger{finger_idx}"
- site_id = self.sim.model.site_name2id(site_name)
- self.sim.model.site_pos[site_id] = (
- achieved_goal[finger_idx] - sites_offset[site_id]
- )
- self.sim.forward()
diff --git a/gym/envs/robotics/hand_env.py b/gym/envs/robotics/hand_env.py
deleted file mode 100644
index a23d766c6c8..00000000000
--- a/gym/envs/robotics/hand_env.py
+++ /dev/null
@@ -1,58 +0,0 @@
-import os
-import copy
-import numpy as np
-
-import gym
-from gym import error, spaces
-from gym.utils import seeding
-from gym.envs.robotics import robot_env
-
-
-class HandEnv(robot_env.RobotEnv):
- def __init__(self, model_path, n_substeps, initial_qpos, relative_control):
- self.relative_control = relative_control
-
- super().__init__(
- model_path=model_path,
- n_substeps=n_substeps,
- n_actions=20,
- initial_qpos=initial_qpos,
- )
-
- # RobotEnv methods
- # ----------------------------
-
- def _set_action(self, action):
- assert action.shape == (20,)
-
- ctrlrange = self.sim.model.actuator_ctrlrange
- actuation_range = (ctrlrange[:, 1] - ctrlrange[:, 0]) / 2.0
- if self.relative_control:
- actuation_center = np.zeros_like(action)
- for i in range(self.sim.data.ctrl.shape[0]):
- actuation_center[i] = self.sim.data.get_joint_qpos(
- self.sim.model.actuator_names[i].replace(":A_", ":")
- )
- for joint_name in ["FF", "MF", "RF", "LF"]:
- act_idx = self.sim.model.actuator_name2id(f"robot0:A_{joint_name}J1")
- actuation_center[act_idx] += self.sim.data.get_joint_qpos(
- f"robot0:{joint_name}J0"
- )
- else:
- actuation_center = (ctrlrange[:, 1] + ctrlrange[:, 0]) / 2.0
- self.sim.data.ctrl[:] = actuation_center + action * actuation_range
- self.sim.data.ctrl[:] = np.clip(
- self.sim.data.ctrl, ctrlrange[:, 0], ctrlrange[:, 1]
- )
-
- def _viewer_setup(self):
- body_id = self.sim.model.body_name2id("robot0:palm")
- lookat = self.sim.data.body_xpos[body_id]
- for idx, value in enumerate(lookat):
- self.viewer.cam.lookat[idx] = value
- self.viewer.cam.distance = 0.5
- self.viewer.cam.azimuth = 55.0
- self.viewer.cam.elevation = -25.0
-
- def render(self, mode="human", width=500, height=500):
- return super().render(mode, width, height)
diff --git a/gym/envs/robotics/robot_env.py b/gym/envs/robotics/robot_env.py
deleted file mode 100644
index d00fc1489ee..00000000000
--- a/gym/envs/robotics/robot_env.py
+++ /dev/null
@@ -1,179 +0,0 @@
-import os
-import copy
-from typing import Optional
-
-import numpy as np
-
-import gym
-from gym import error, spaces
-from gym.utils import seeding
-
-try:
- import mujoco_py
-except ImportError as e:
- raise error.DependencyNotInstalled(
- "{}. (HINT: you need to install mujoco_py, and also perform the setup instructions here: https://github.com/openai/mujoco-py/.)".format(
- e
- )
- )
-
-DEFAULT_SIZE = 500
-
-
-class RobotEnv(gym.GoalEnv):
- def __init__(self, model_path, initial_qpos, n_actions, n_substeps):
- if model_path.startswith("/"):
- fullpath = model_path
- else:
- fullpath = os.path.join(os.path.dirname(__file__), "assets", model_path)
- if not os.path.exists(fullpath):
- raise OSError(f"File {fullpath} does not exist")
-
- model = mujoco_py.load_model_from_path(fullpath)
- self.sim = mujoco_py.MjSim(model, nsubsteps=n_substeps)
- self.viewer = None
- self._viewers = {}
-
- self.metadata = {
- "render.modes": ["human", "rgb_array"],
- "video.frames_per_second": int(np.round(1.0 / self.dt)),
- }
-
- self._env_setup(initial_qpos=initial_qpos)
- self.initial_state = copy.deepcopy(self.sim.get_state())
-
- self.goal = self._sample_goal()
- obs = self._get_obs()
- self.action_space = spaces.Box(-1.0, 1.0, shape=(n_actions,), dtype="float32")
- self.observation_space = spaces.Dict(
- dict(
- desired_goal=spaces.Box(
- -np.inf, np.inf, shape=obs["achieved_goal"].shape, dtype="float32"
- ),
- achieved_goal=spaces.Box(
- -np.inf, np.inf, shape=obs["achieved_goal"].shape, dtype="float32"
- ),
- observation=spaces.Box(
- -np.inf, np.inf, shape=obs["observation"].shape, dtype="float32"
- ),
- )
- )
-
- @property
- def dt(self):
- return self.sim.model.opt.timestep * self.sim.nsubsteps
-
- # Env methods
- # ----------------------------
-
- def step(self, action):
- if np.array(action).shape != self.action_space.shape:
- raise ValueError("Action dimension mismatch")
-
- action = np.clip(action, self.action_space.low, self.action_space.high)
- self._set_action(action)
- self.sim.step()
- self._step_callback()
- obs = self._get_obs()
-
- done = False
- info = {
- "is_success": self._is_success(obs["achieved_goal"], self.goal),
- }
- reward = self.compute_reward(obs["achieved_goal"], self.goal, info)
- return obs, reward, done, info
-
- def reset(self, seed: Optional[int] = None):
- # Attempt to reset the simulator. Since we randomize initial conditions, it
- # is possible to get into a state with numerical issues (e.g. due to penetration or
- # Gimbel lock) or we may not achieve an initial condition (e.g. an object is within the hand).
- # In this case, we just keep randomizing until we eventually achieve a valid initial
- # configuration.
- super().reset(seed=seed)
- did_reset_sim = False
- while not did_reset_sim:
- did_reset_sim = self._reset_sim()
- self.goal = self._sample_goal().copy()
- obs = self._get_obs()
- return obs
-
- def close(self):
- if self.viewer is not None:
- # self.viewer.finish()
- self.viewer = None
- self._viewers = {}
-
- def render(self, mode="human", width=DEFAULT_SIZE, height=DEFAULT_SIZE):
- self._render_callback()
- if mode == "rgb_array":
- self._get_viewer(mode).render(width, height)
- # window size used for old mujoco-py:
- data = self._get_viewer(mode).read_pixels(width, height, depth=False)
- # original image is upside-down, so flip it
- return data[::-1, :, :]
- elif mode == "human":
- self._get_viewer(mode).render()
-
- def _get_viewer(self, mode):
- self.viewer = self._viewers.get(mode)
- if self.viewer is None:
- if mode == "human":
- self.viewer = mujoco_py.MjViewer(self.sim)
- elif mode == "rgb_array":
- self.viewer = mujoco_py.MjRenderContextOffscreen(self.sim, device_id=-1)
- self._viewer_setup()
- self._viewers[mode] = self.viewer
- return self.viewer
-
- # Extension methods
- # ----------------------------
-
- def _reset_sim(self):
- """Resets a simulation and indicates whether or not it was successful.
- If a reset was unsuccessful (e.g. if a randomized state caused an error in the
- simulation), this method should indicate such a failure by returning False.
- In such a case, this method will be called again to attempt a the reset again.
- """
- self.sim.set_state(self.initial_state)
- self.sim.forward()
- return True
-
- def _get_obs(self):
- """Returns the observation."""
- raise NotImplementedError()
-
- def _set_action(self, action):
- """Applies the given action to the simulation."""
- raise NotImplementedError()
-
- def _is_success(self, achieved_goal, desired_goal):
- """Indicates whether or not the achieved goal successfully achieved the desired goal."""
- raise NotImplementedError()
-
- def _sample_goal(self):
- """Samples a new goal and returns it."""
- raise NotImplementedError()
-
- def _env_setup(self, initial_qpos):
- """Initial configuration of the environment. Can be used to configure initial state
- and extract information from the simulation.
- """
- pass
-
- def _viewer_setup(self):
- """Initial configuration of the viewer. Can be used to set the camera position,
- for example.
- """
- pass
-
- def _render_callback(self):
- """A custom callback that is called before rendering. Can be used
- to implement custom visualizations.
- """
- pass
-
- def _step_callback(self):
- """A custom callback that is called after stepping the simulation. Can be used
- to enforce additional constraints on the simulation state.
- """
- pass
diff --git a/gym/envs/robotics/rotations.py b/gym/envs/robotics/rotations.py
deleted file mode 100644
index 0d4ce82d97b..00000000000
--- a/gym/envs/robotics/rotations.py
+++ /dev/null
@@ -1,387 +0,0 @@
-# Copyright (c) 2009-2017, Matthew Brett and Christoph Gohlke
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Many methods borrow heavily or entirely from transforms3d:
-# https://github.com/matthew-brett/transforms3d
-# They have mostly been modified to support batched operations.
-
-import numpy as np
-import itertools
-
-"""
-Rotations
-=========
-
-Note: these have caused many subtle bugs in the past.
-Be careful while updating these methods and while using them in clever ways.
-
-See MuJoCo documentation here: http://mujoco.org/book/modeling.html#COrientation
-
-Conventions
------------
- - All functions accept batches as well as individual rotations
- - All rotation conventions match respective MuJoCo defaults
- - All angles are in radians
- - Matricies follow LR convention
- - Euler Angles are all relative with 'xyz' axes ordering
- - See specific representation for more information
-
-Representations
----------------
-
-Euler
- There are many euler angle frames -- here we will strive to use the default
- in MuJoCo, which is eulerseq='xyz'.
- This frame is a relative rotating frame, about x, y, and z axes in order.
- Relative rotating means that after we rotate about x, then we use the
- new (rotated) y, and the same for z.
-
-Quaternions
- These are defined in terms of rotation (angle) about a unit vector (x, y, z)
- We use the following convention:
- q0 = cos(angle / 2)
- q1 = sin(angle / 2) * x
- q2 = sin(angle / 2) * y
- q3 = sin(angle / 2) * z
- This is also sometimes called qw, qx, qy, qz.
- Note that quaternions are ambiguous, because we can represent a rotation by
- angle about vector and -angle about vector <-x, -y, -z>.
- To choose between these, we pick "first nonzero positive", where we
- make the first nonzero element of the quaternion positive.
- This can result in mismatches if you're converting an quaternion that is not
- "first nonzero positive" to a different representation and back.
-
-Axis Angle
- (Not currently implemented)
- These are very straightforward. Rotation is angle about a unit vector.
-
-XY Axes
- (Not currently implemented)
- We are given x axis and y axis, and z axis is cross product of x and y.
-
-Z Axis
- This is NOT RECOMMENDED. Defines a unit vector for the Z axis,
- but rotation about this axis is not well defined.
- Instead pick a fixed reference direction for another axis (e.g. X)
- and calculate the other (e.g. Y = Z cross-product X),
- then use XY Axes rotation instead.
-
-SO3
- (Not currently implemented)
- While not supported by MuJoCo, this representation has a lot of nice features.
- We expect to add support for these in the future.
-
-TODO / Missing
---------------
- - Rotation integration or derivatives (e.g. velocity conversions)
- - More representations (SO3, etc)
- - Random sampling (e.g. sample uniform random rotation)
- - Performance benchmarks/measurements
- - (Maybe) define everything as to/from matricies, for simplicity
-"""
-
-# For testing whether a number is close to zero
-_FLOAT_EPS = np.finfo(np.float64).eps
-_EPS4 = _FLOAT_EPS * 4.0
-
-
-def euler2mat(euler):
- """Convert Euler Angles to Rotation Matrix. See rotation.py for notes"""
- euler = np.asarray(euler, dtype=np.float64)
- assert euler.shape[-1] == 3, f"Invalid shaped euler {euler}"
-
- ai, aj, ak = -euler[..., 2], -euler[..., 1], -euler[..., 0]
- si, sj, sk = np.sin(ai), np.sin(aj), np.sin(ak)
- ci, cj, ck = np.cos(ai), np.cos(aj), np.cos(ak)
- cc, cs = ci * ck, ci * sk
- sc, ss = si * ck, si * sk
-
- mat = np.empty(euler.shape[:-1] + (3, 3), dtype=np.float64)
- mat[..., 2, 2] = cj * ck
- mat[..., 2, 1] = sj * sc - cs
- mat[..., 2, 0] = sj * cc + ss
- mat[..., 1, 2] = cj * sk
- mat[..., 1, 1] = sj * ss + cc
- mat[..., 1, 0] = sj * cs - sc
- mat[..., 0, 2] = -sj
- mat[..., 0, 1] = cj * si
- mat[..., 0, 0] = cj * ci
- return mat
-
-
-def euler2quat(euler):
- """Convert Euler Angles to Quaternions. See rotation.py for notes"""
- euler = np.asarray(euler, dtype=np.float64)
- assert euler.shape[-1] == 3, f"Invalid shape euler {euler}"
-
- ai, aj, ak = euler[..., 2] / 2, -euler[..., 1] / 2, euler[..., 0] / 2
- si, sj, sk = np.sin(ai), np.sin(aj), np.sin(ak)
- ci, cj, ck = np.cos(ai), np.cos(aj), np.cos(ak)
- cc, cs = ci * ck, ci * sk
- sc, ss = si * ck, si * sk
-
- quat = np.empty(euler.shape[:-1] + (4,), dtype=np.float64)
- quat[..., 0] = cj * cc + sj * ss
- quat[..., 3] = cj * sc - sj * cs
- quat[..., 2] = -(cj * ss + sj * cc)
- quat[..., 1] = cj * cs - sj * sc
- return quat
-
-
-def mat2euler(mat):
- """Convert Rotation Matrix to Euler Angles. See rotation.py for notes"""
- mat = np.asarray(mat, dtype=np.float64)
- assert mat.shape[-2:] == (3, 3), f"Invalid shape matrix {mat}"
-
- cy = np.sqrt(mat[..., 2, 2] * mat[..., 2, 2] + mat[..., 1, 2] * mat[..., 1, 2])
- condition = cy > _EPS4
- euler = np.empty(mat.shape[:-1], dtype=np.float64)
- euler[..., 2] = np.where(
- condition,
- -np.arctan2(mat[..., 0, 1], mat[..., 0, 0]),
- -np.arctan2(-mat[..., 1, 0], mat[..., 1, 1]),
- )
- euler[..., 1] = np.where(
- condition, -np.arctan2(-mat[..., 0, 2], cy), -np.arctan2(-mat[..., 0, 2], cy)
- )
- euler[..., 0] = np.where(
- condition, -np.arctan2(mat[..., 1, 2], mat[..., 2, 2]), 0.0
- )
- return euler
-
-
-def mat2quat(mat):
- """Convert Rotation Matrix to Quaternion. See rotation.py for notes"""
- mat = np.asarray(mat, dtype=np.float64)
- assert mat.shape[-2:] == (3, 3), f"Invalid shape matrix {mat}"
-
- Qxx, Qyx, Qzx = mat[..., 0, 0], mat[..., 0, 1], mat[..., 0, 2]
- Qxy, Qyy, Qzy = mat[..., 1, 0], mat[..., 1, 1], mat[..., 1, 2]
- Qxz, Qyz, Qzz = mat[..., 2, 0], mat[..., 2, 1], mat[..., 2, 2]
- # Fill only lower half of symmetric matrix
- K = np.zeros(mat.shape[:-2] + (4, 4), dtype=np.float64)
- K[..., 0, 0] = Qxx - Qyy - Qzz
- K[..., 1, 0] = Qyx + Qxy
- K[..., 1, 1] = Qyy - Qxx - Qzz
- K[..., 2, 0] = Qzx + Qxz
- K[..., 2, 1] = Qzy + Qyz
- K[..., 2, 2] = Qzz - Qxx - Qyy
- K[..., 3, 0] = Qyz - Qzy
- K[..., 3, 1] = Qzx - Qxz
- K[..., 3, 2] = Qxy - Qyx
- K[..., 3, 3] = Qxx + Qyy + Qzz
- K /= 3.0
- # TODO: vectorize this -- probably could be made faster
- q = np.empty(K.shape[:-2] + (4,))
- it = np.nditer(q[..., 0], flags=["multi_index"])
- while not it.finished:
- # Use Hermitian eigenvectors, values for speed
- vals, vecs = np.linalg.eigh(K[it.multi_index])
- # Select largest eigenvector, reorder to w,x,y,z quaternion
- q[it.multi_index] = vecs[[3, 0, 1, 2], np.argmax(vals)]
- # Prefer quaternion with positive w
- # (q * -1 corresponds to same rotation as q)
- if q[it.multi_index][0] < 0:
- q[it.multi_index] *= -1
- it.iternext()
- return q
-
-
-def quat2euler(quat):
- """Convert Quaternion to Euler Angles. See rotation.py for notes"""
- return mat2euler(quat2mat(quat))
-
-
-def subtract_euler(e1, e2):
- assert e1.shape == e2.shape
- assert e1.shape[-1] == 3
- q1 = euler2quat(e1)
- q2 = euler2quat(e2)
- q_diff = quat_mul(q1, quat_conjugate(q2))
- return quat2euler(q_diff)
-
-
-def quat2mat(quat):
- """Convert Quaternion to Euler Angles. See rotation.py for notes"""
- quat = np.asarray(quat, dtype=np.float64)
- assert quat.shape[-1] == 4, f"Invalid shape quat {quat}"
-
- w, x, y, z = quat[..., 0], quat[..., 1], quat[..., 2], quat[..., 3]
- Nq = np.sum(quat * quat, axis=-1)
- s = 2.0 / Nq
- X, Y, Z = x * s, y * s, z * s
- wX, wY, wZ = w * X, w * Y, w * Z
- xX, xY, xZ = x * X, x * Y, x * Z
- yY, yZ, zZ = y * Y, y * Z, z * Z
-
- mat = np.empty(quat.shape[:-1] + (3, 3), dtype=np.float64)
- mat[..., 0, 0] = 1.0 - (yY + zZ)
- mat[..., 0, 1] = xY - wZ
- mat[..., 0, 2] = xZ + wY
- mat[..., 1, 0] = xY + wZ
- mat[..., 1, 1] = 1.0 - (xX + zZ)
- mat[..., 1, 2] = yZ - wX
- mat[..., 2, 0] = xZ - wY
- mat[..., 2, 1] = yZ + wX
- mat[..., 2, 2] = 1.0 - (xX + yY)
- return np.where((Nq > _FLOAT_EPS)[..., np.newaxis, np.newaxis], mat, np.eye(3))
-
-
-def quat_conjugate(q):
- inv_q = -q
- inv_q[..., 0] *= -1
- return inv_q
-
-
-def quat_mul(q0, q1):
- assert q0.shape == q1.shape
- assert q0.shape[-1] == 4
- assert q1.shape[-1] == 4
-
- w0 = q0[..., 0]
- x0 = q0[..., 1]
- y0 = q0[..., 2]
- z0 = q0[..., 3]
-
- w1 = q1[..., 0]
- x1 = q1[..., 1]
- y1 = q1[..., 2]
- z1 = q1[..., 3]
-
- w = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1
- x = w0 * x1 + x0 * w1 + y0 * z1 - z0 * y1
- y = w0 * y1 + y0 * w1 + z0 * x1 - x0 * z1
- z = w0 * z1 + z0 * w1 + x0 * y1 - y0 * x1
- q = np.array([w, x, y, z])
- if q.ndim == 2:
- q = q.swapaxes(0, 1)
- assert q.shape == q0.shape
- return q
-
-
-def quat_rot_vec(q, v0):
- q_v0 = np.array([0, v0[0], v0[1], v0[2]])
- q_v = quat_mul(q, quat_mul(q_v0, quat_conjugate(q)))
- v = q_v[1:]
- return v
-
-
-def quat_identity():
- return np.array([1, 0, 0, 0])
-
-
-def quat2axisangle(quat):
- theta = 0
- axis = np.array([0, 0, 1])
- sin_theta = np.linalg.norm(quat[1:])
-
- if sin_theta > 0.0001:
- theta = 2 * np.arcsin(sin_theta)
- theta *= 1 if quat[0] >= 0 else -1
- axis = quat[1:] / sin_theta
-
- return axis, theta
-
-
-def euler2point_euler(euler):
- _euler = euler.copy()
- if len(_euler.shape) < 2:
- _euler = np.expand_dims(_euler, 0)
- assert _euler.shape[1] == 3
- _euler_sin = np.sin(_euler)
- _euler_cos = np.cos(_euler)
- return np.concatenate([_euler_sin, _euler_cos], axis=-1)
-
-
-def point_euler2euler(euler):
- _euler = euler.copy()
- if len(_euler.shape) < 2:
- _euler = np.expand_dims(_euler, 0)
- assert _euler.shape[1] == 6
- angle = np.arctan(_euler[..., :3] / _euler[..., 3:])
- angle[_euler[..., 3:] < 0] += np.pi
- return angle
-
-
-def quat2point_quat(quat):
- # Should be in qw, qx, qy, qz
- _quat = quat.copy()
- if len(_quat.shape) < 2:
- _quat = np.expand_dims(_quat, 0)
- assert _quat.shape[1] == 4
- angle = np.arccos(_quat[:, [0]]) * 2
- xyz = _quat[:, 1:]
- xyz[np.squeeze(np.abs(np.sin(angle / 2))) >= 1e-5] = (xyz / np.sin(angle / 2))[
- np.squeeze(np.abs(np.sin(angle / 2))) >= 1e-5
- ]
- return np.concatenate([np.sin(angle), np.cos(angle), xyz], axis=-1)
-
-
-def point_quat2quat(quat):
- _quat = quat.copy()
- if len(_quat.shape) < 2:
- _quat = np.expand_dims(_quat, 0)
- assert _quat.shape[1] == 5
- angle = np.arctan(_quat[:, [0]] / _quat[:, [1]])
- qw = np.cos(angle / 2)
-
- qxyz = _quat[:, 2:]
- qxyz[np.squeeze(np.abs(np.sin(angle / 2))) >= 1e-5] = (qxyz * np.sin(angle / 2))[
- np.squeeze(np.abs(np.sin(angle / 2))) >= 1e-5
- ]
- return np.concatenate([qw, qxyz], axis=-1)
-
-
-def normalize_angles(angles):
- """Puts angles in [-pi, pi] range."""
- angles = angles.copy()
- if angles.size > 0:
- angles = (angles + np.pi) % (2 * np.pi) - np.pi
- assert -np.pi - 1e-6 <= angles.min() and angles.max() <= np.pi + 1e-6
- return angles
-
-
-def round_to_straight_angles(angles):
- """Returns closest angle modulo 90 degrees"""
- angles = np.round(angles / (np.pi / 2)) * (np.pi / 2)
- return normalize_angles(angles)
-
-
-def get_parallel_rotations():
- mult90 = [0, np.pi / 2, -np.pi / 2, np.pi]
- parallel_rotations = []
- for euler in itertools.product(mult90, repeat=3):
- canonical = mat2euler(euler2mat(euler))
- canonical = np.round(canonical / (np.pi / 2))
- if canonical[0] == -2:
- canonical[0] = 2
- if canonical[2] == -2:
- canonical[2] = 2
- canonical *= np.pi / 2
- if all([(canonical != rot).any() for rot in parallel_rotations]):
- parallel_rotations += [canonical]
- assert len(parallel_rotations) == 24
- return parallel_rotations
diff --git a/gym/envs/robotics/utils.py b/gym/envs/robotics/utils.py
deleted file mode 100644
index baa76720006..00000000000
--- a/gym/envs/robotics/utils.py
+++ /dev/null
@@ -1,101 +0,0 @@
-import numpy as np
-
-from gym import error
-
-try:
- import mujoco_py
-except ImportError as e:
- raise error.DependencyNotInstalled(
- "{}. (HINT: you need to install mujoco_py, and also perform the setup instructions here: https://github.com/openai/mujoco-py/.)".format(
- e
- )
- )
-
-
-def robot_get_obs(sim):
- """Returns all joint positions and velocities associated with
- a robot.
- """
- if sim.data.qpos is not None and sim.model.joint_names:
- names = [n for n in sim.model.joint_names if n.startswith("robot")]
- return (
- np.array([sim.data.get_joint_qpos(name) for name in names]),
- np.array([sim.data.get_joint_qvel(name) for name in names]),
- )
- return np.zeros(0), np.zeros(0)
-
-
-def ctrl_set_action(sim, action):
- """For torque actuators it copies the action into mujoco ctrl field.
- For position actuators it sets the target relative to the current qpos.
- """
- if sim.model.nmocap > 0:
- _, action = np.split(action, (sim.model.nmocap * 7,))
- if sim.data.ctrl is not None:
- for i in range(action.shape[0]):
- if sim.model.actuator_biastype[i] == 0:
- sim.data.ctrl[i] = action[i]
- else:
- idx = sim.model.jnt_qposadr[sim.model.actuator_trnid[i, 0]]
- sim.data.ctrl[i] = sim.data.qpos[idx] + action[i]
-
-
-def mocap_set_action(sim, action):
- """The action controls the robot using mocaps. Specifically, bodies
- on the robot (for example the gripper wrist) is controlled with
- mocap bodies. In this case the action is the desired difference
- in position and orientation (quaternion), in world coordinates,
- of the of the target body. The mocap is positioned relative to
- the target body according to the delta, and the MuJoCo equality
- constraint optimizer tries to center the welded body on the mocap.
- """
- if sim.model.nmocap > 0:
- action, _ = np.split(action, (sim.model.nmocap * 7,))
- action = action.reshape(sim.model.nmocap, 7)
-
- pos_delta = action[:, :3]
- quat_delta = action[:, 3:]
-
- reset_mocap2body_xpos(sim)
- sim.data.mocap_pos[:] = sim.data.mocap_pos + pos_delta
- sim.data.mocap_quat[:] = sim.data.mocap_quat + quat_delta
-
-
-def reset_mocap_welds(sim):
- """Resets the mocap welds that we use for actuation."""
- if sim.model.nmocap > 0 and sim.model.eq_data is not None:
- for i in range(sim.model.eq_data.shape[0]):
- if sim.model.eq_type[i] == mujoco_py.const.EQ_WELD:
- sim.model.eq_data[i, :] = np.array([0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0])
- sim.forward()
-
-
-def reset_mocap2body_xpos(sim):
- """Resets the position and orientation of the mocap bodies to the same
- values as the bodies they're welded to.
- """
-
- if (
- sim.model.eq_type is None
- or sim.model.eq_obj1id is None
- or sim.model.eq_obj2id is None
- ):
- return
- for eq_type, obj1_id, obj2_id in zip(
- sim.model.eq_type, sim.model.eq_obj1id, sim.model.eq_obj2id
- ):
- if eq_type != mujoco_py.const.EQ_WELD:
- continue
-
- mocap_id = sim.model.body_mocapid[obj1_id]
- if mocap_id != -1:
- # obj1 is the mocap, obj2 is the welded body
- body_idx = obj2_id
- else:
- # obj2 is the mocap, obj1 is the welded body
- mocap_id = sim.model.body_mocapid[obj2_id]
- body_idx = obj1_id
-
- assert mocap_id != -1
- sim.data.mocap_pos[mocap_id][:] = sim.data.body_xpos[body_idx]
- sim.data.mocap_quat[mocap_id][:] = sim.data.body_xquat[body_idx]
diff --git a/gym/utils/env_checker.py b/gym/utils/env_checker.py
index 0101ad5abe2..427bb443c6c 100644
--- a/gym/utils/env_checker.py
+++ b/gym/utils/env_checker.py
@@ -78,7 +78,6 @@ def _check_obs(
obs, tuple
), f"The observation returned by the `{method_name}()` method should be a single value, not a tuple"
- # The check for a GoalEnv is done by the base class
if isinstance(observation_space, spaces.Discrete):
assert isinstance(
obs, int
@@ -219,12 +218,6 @@ def _check_returned_values(
info, dict
), "The `info` returned by `step()` must be a python dictionary"
- if isinstance(env, gym.GoalEnv):
- # For a GoalEnv, the keys are checked at reset
- assert reward == env.compute_reward(
- obs["achieved_goal"], obs["desired_goal"], info
- )
-
def _check_spaces(env: gym.Env) -> None:
"""
diff --git a/setup.py b/setup.py
index 707e26929c4..28128454c85 100644
--- a/setup.py
+++ b/setup.py
@@ -15,13 +15,12 @@
"box2d": ["box2d-py==2.3.5", "pyglet>=1.4.0"],
"classic_control": ["pyglet>=1.4.0"],
"mujoco": ["mujoco_py>=1.50, <2.0"],
- "robotics": ["mujoco_py>=1.50, <2.0"],
"toy_text": ["scipy>=1.4.1"],
"other": ["lz4>=3.1.0", "opencv-python>=3."],
}
# Meta dependency groups.
-nomujoco_blacklist = set(["mujoco", "robotics", "accept-rom-license", "atari"])
+nomujoco_blacklist = set(["mujoco", "accept-rom-license", "atari"])
nomujoco_groups = set(extras.keys()) - nomujoco_blacklist
extras["nomujoco"] = list(
@@ -56,12 +55,6 @@
"gym": [
"envs/mujoco/assets/*.xml",
"envs/classic_control/assets/*.png",
- "envs/robotics/assets/LICENSE.md",
- "envs/robotics/assets/fetch/*.xml",
- "envs/robotics/assets/hand/*.xml",
- "envs/robotics/assets/stls/fetch/*.stl",
- "envs/robotics/assets/stls/hand/*.stl",
- "envs/robotics/assets/textures/*.png",
]
},
tests_require=["pytest", "mock"],
diff --git a/tests/envs/robotics/__init__.py b/tests/envs/robotics/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/tests/envs/robotics/hand/__init__.py b/tests/envs/robotics/hand/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/tests/envs/robotics/hand/test_manipulate.py b/tests/envs/robotics/hand/test_manipulate.py
deleted file mode 100644
index 55b393f09b0..00000000000
--- a/tests/envs/robotics/hand/test_manipulate.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import pickle
-
-import pytest
-
-from gym import envs
-from tests.envs.spec_list import skip_mujoco, SKIP_MUJOCO_WARNING_MESSAGE
-
-
-ENVIRONMENT_IDS = (
- "HandManipulateEgg-v0",
- "HandManipulatePen-v0",
- "HandManipulateBlock-v0",
-)
-
-
-@pytest.mark.skipif(skip_mujoco, reason=SKIP_MUJOCO_WARNING_MESSAGE)
-@pytest.mark.parametrize("environment_id", ENVIRONMENT_IDS)
-def test_serialize_deserialize(environment_id):
- env1 = envs.make(environment_id, target_position="fixed")
- env1.reset()
- env2 = pickle.loads(pickle.dumps(env1))
-
- assert env1.target_position == env2.target_position, (
- env1.target_position,
- env2.target_position,
- )
diff --git a/tests/envs/robotics/hand/test_manipulate_touch_sensors.py b/tests/envs/robotics/hand/test_manipulate_touch_sensors.py
deleted file mode 100644
index bff261a2585..00000000000
--- a/tests/envs/robotics/hand/test_manipulate_touch_sensors.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import pickle
-
-import pytest
-
-from gym import envs
-from tests.envs.spec_list import skip_mujoco, SKIP_MUJOCO_WARNING_MESSAGE
-
-
-ENVIRONMENT_IDS = (
- "HandManipulateEggTouchSensors-v1",
- "HandManipulatePenTouchSensors-v0",
- "HandManipulateBlockTouchSensors-v0",
-)
-
-
-@pytest.mark.skipif(skip_mujoco, reason=SKIP_MUJOCO_WARNING_MESSAGE)
-@pytest.mark.parametrize("environment_id", ENVIRONMENT_IDS)
-def test_serialize_deserialize(environment_id):
- env1 = envs.make(environment_id, target_position="fixed")
- env1.reset()
- env2 = pickle.loads(pickle.dumps(env1))
-
- assert env1.target_position == env2.target_position, (
- env1.target_position,
- env2.target_position,
- )
diff --git a/tests/envs/robotics/hand/test_reach.py b/tests/envs/robotics/hand/test_reach.py
deleted file mode 100644
index 8d360e70680..00000000000
--- a/tests/envs/robotics/hand/test_reach.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import pickle
-
-import pytest
-
-from gym import envs
-from tests.envs.spec_list import skip_mujoco, SKIP_MUJOCO_WARNING_MESSAGE
-
-
-@pytest.mark.skipif(skip_mujoco, reason=SKIP_MUJOCO_WARNING_MESSAGE)
-def test_serialize_deserialize():
- env1 = envs.make("HandReach-v0", distance_threshold=1e-6)
- env1.reset()
- env2 = pickle.loads(pickle.dumps(env1))
-
- assert env1.distance_threshold == env2.distance_threshold, (
- env1.distance_threshold,
- env2.distance_threshold,
- )
diff --git a/tests/envs/spec_list.py b/tests/envs/spec_list.py
index 50dabf4733b..f5c32323670 100644
--- a/tests/envs/spec_list.py
+++ b/tests/envs/spec_list.py
@@ -21,9 +21,7 @@ def should_skip_env_spec_for_tests(spec):
# troublesome to run frequently
ep = spec.entry_point
# Skip mujoco tests for pull request CI
- if skip_mujoco and (
- ep.startswith("gym.envs.mujoco") or ep.startswith("gym.envs.robotics:")
- ):
+ if skip_mujoco and ep.startswith("gym.envs.mujoco"):
return True
try:
import gym.envs.atari
diff --git a/tests/envs/test_action_dim_check.py b/tests/envs/test_action_dim_check.py
index 31f3ba59d7d..0b43ff84fca 100644
--- a/tests/envs/test_action_dim_check.py
+++ b/tests/envs/test_action_dim_check.py
@@ -6,10 +6,7 @@
from tests.envs.spec_list import skip_mujoco, SKIP_MUJOCO_WARNING_MESSAGE
-ENVIRONMENT_IDS = (
- "FetchReach-v1",
- "HalfCheetah-v2",
-)
+ENVIRONMENT_IDS = ("HalfCheetah-v2",)
@pytest.mark.skipif(skip_mujoco, reason=SKIP_MUJOCO_WARNING_MESSAGE)