├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── robodesk ├── __init__.py ├── assets │ ├── desk.xml │ ├── franka_panda.xml │ ├── franka_panda_headers.xml │ ├── meshes │ │ ├── bin.stl │ │ ├── button_holder.stl │ │ ├── desk_drawer_handle.stl │ │ ├── desk_drawer_wood.stl │ │ ├── desk_main.stl │ │ ├── desk_slide_handle.stl │ │ ├── desk_slide_wood.stl │ │ └── franka │ │ │ ├── collision_finger.stl │ │ │ ├── collision_hand.stl │ │ │ ├── collision_link0.stl │ │ │ ├── collision_link1.stl │ │ │ ├── collision_link2.stl │ │ │ ├── collision_link3.stl │ │ │ ├── collision_link4.stl │ │ │ ├── collision_link5.stl │ │ │ ├── collision_link6.stl │ │ │ ├── collision_link7.stl │ │ │ ├── visual_finger.stl │ │ │ ├── visual_hand.stl │ │ │ ├── visual_link0.stl │ │ │ ├── visual_link1.stl │ │ │ ├── visual_link2.stl │ │ │ ├── visual_link3.stl │ │ │ ├── visual_link4.stl │ │ │ ├── visual_link5.stl │ │ │ ├── visual_link6.stl │ │ │ └── visual_link7.stl │ └── textures │ │ ├── metal.png │ │ ├── white_marble_tile.png │ │ └── wood.png ├── robodesk.py └── robodesk_example.py └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | __pycache__ 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement (CLA). You (or your employer) retain the copyright to your 10 | contribution; this simply gives us permission to use and redistribute your 11 | contributions as part of the project. Head over to 12 | to see your current agreements on file or 13 | to sign a new one. 14 | 15 | You generally only need to submit a CLA once, so if you've already submitted one 16 | (even if it was for a different project), you probably don't need to do it 17 | again. 18 | 19 | ## Code Reviews 20 | 21 | All submissions, including submissions by project members, require review. We 22 | use GitHub pull requests for this purpose. Consult 23 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 24 | information on using pull requests. 25 | 26 | ## Community Guidelines 27 | 28 | This project follows 29 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RoboDesk 2 | 3 | [![PyPI](https://img.shields.io/pypi/v/robodesk.svg)](https://pypi.python.org/pypi/robodesk/#history) 4 | 5 | A Multi-Task Reinforcement Learning Benchmark 6 | 7 | ![Robodesk Banner](https://i.imgur.com/1qp1SUh.gif) 8 | 9 | If you find this open source release useful, please reference in your paper: 10 | 11 | ``` 12 | @misc{kannan2021robodesk, 13 | author = {Harini Kannan and Danijar Hafner and Chelsea Finn and Dumitru Erhan}, 14 | title = {RoboDesk: A Multi-Task Reinforcement Learning Benchmark}, 15 | year = {2021}, 16 | howpublished = {\url{https://github.com/google-research/robodesk}}, 17 | } 18 | ``` 19 | 20 | ## Highlights 21 | 22 | - **Diversity:** RoboDesk includes 9 diverse tasks that test for a variety of different behaviors within the same environment, making it useful for evaluating transfer, multi-task learning, and global exploration. 23 | - **Complexity:** The high-dimensional image inputs contain objects of different shapes and colors, whose initial positions are randomized to avoid naive memorization and require learning algorithms to generalize. 24 | - **Robustness:** We carefully designed and tested RoboDesk to ensure fast and stable physics simulation. This avoids objects from intersecting, getting stuck, or quickly flying away, a common problem with some existing environments. 25 | - **Lightweight:** RoboDesk comes as a self-contained Python package with few dependencies. The source code is clean and pragmatic, making it a useful blueprint for creating new MuJoCo environments. 26 | 27 | ## Training Agents 28 | 29 | Installation: `pip3 install -U robodesk` 30 | 31 | The environment follows the [OpenAI Gym][gym] interface: 32 | 33 | ```py 34 | import robodesk 35 | 36 | env = robodesk.RoboDesk(seed=0) 37 | obs = env.reset() 38 | assert obs.shape == (64, 64, 3) 39 | 40 | done = False 41 | while not done: 42 | action = env.action_space.sample() 43 | obs, reward, done, info = env.step(action) 44 | ``` 45 | 46 | [gym]: https://github.com/openai/gym 47 | 48 | 49 | ## Tasks 50 | 51 | ![Robodesk Tasks](https://i.imgur.com/OwTT2pk.gif) 52 | 53 | The behaviors above were learned using the [Dreamer](https://github.com/danijar/dreamer) agent. These policies have been learned from scratch and only from pixels, not proprioceptive states. 54 | 55 | | Task | Description | 56 | | :-------- | :---------- | 57 | | `open_slide` | Push the sliding door all the way to the right, navigating around the other objects. | 58 | | `open_drawer` | Pull the dark brown drawer all the way open. | 59 | | `push_green` | Push the green button to turn the green light on. | 60 | | `stack_blocks` | Stack the upright blue block on top of the flat green block. | 61 | | `upright_block_off_table` | Push the blue upright block off the table. | 62 | | `flat_block_in_bin` | Push the green flat block into the blue bin. | 63 | | `flat_block_in_shelf` | Push the green flat block into the shelf, navigating around the other blocks. | 64 | | `lift_upright_block` | Grasp the blue upright block and lift it above the table. | 65 | | `lift_ball` | Grasp the magenta ball and lift it above the table. | 66 | 67 | 68 | ## Environment Details 69 | 70 | ### Constructor 71 | 72 | ```py 73 | robodesk.RoboDesk(task='open_slide', reward='dense', action_repeat=1, episode_length=500, image_size=64) 74 | ``` 75 | 76 | | Parameter | Description | 77 | | :-------- | :---------- | 78 | | `task` | Available tasks are `open_slide`, `open_drawer`, `push_green`, `stack`, `upright_block_off_table`, `flat_block_in_bin`, `flat_block_in_shelf`, `lift_upright_block`, `lift_ball`. | 79 | | `reward` | Available reward types are `dense`, `sparse`, `success`. Success gives only the first sparse reward during the episode, useful for computing success rates during evaluation. | 80 | | `action_repeat` | Reduces the control frequency by applying each action multiple times. This is faster than using an environment wrapper because only the needed images are rendered. | 81 | | `episode_length` | Time limit for the episode, can be `None`. | 82 | | `image_size` | Size of the image observations in pixels, used for both height and width. | 83 | 84 | ### Reward 85 | 86 | All rewards are bound between 0 and 1. There are three types of rewards available: 87 | 88 | - Dense rewards are based on Euclidean distances between the objects and their target positions and can include additional terms, for example to encourage the arm to reach the object. These are the easiest rewards for learning. 89 | - Sparse rewards are either 0 or 1 based on whether the target object is in the target area or not, according to a fixed threshold. Learning from sparse rewards is more challenging. 90 | - Success rewards are equivalent to the sparse rewards, except that only the first reward is given during each episode. As a result, an episode return of 0 means failure and 1 means sucess at the task. This should only be used during evaluation. 91 | 92 | ### Termination 93 | 94 | Episodes end after 500 time steps by default. There are no early terminations. 95 | 96 | ### Observation Space 97 | 98 | Each observation is a dictionary that contains the current image, as well as additional information. For the standard benchmark, only the image should be used for learning. The observation dictionary contains the following keys: 99 | 100 | | Key | Space | 101 | | :-- | :---- | 102 | | `image` | `Box(0, 255, (64, 64, 3), np.uint8)` | 103 | | `qpos_robot` | `Box(-np.inf, np.inf, (9,), np.float32)` | 104 | | `qvel_robot` | `Box(-np.inf, np.inf, (9,), np.float32)` | 105 | | `qpos_objects` | `Box(-np.inf, np.inf, (26,), np.float32)` | 106 | | `qvel_objects` | `Box(-np.inf, np.inf, (26,), np.float32)` | 107 | | `end_effector` | `Box(-np.inf, np.inf, (3,), np.float32)` | 108 | 109 | ### Action Space 110 | 111 | RoboDesk uses end effector control with a simple bounded action space: 112 | 113 | ``` 114 | Box(-1, 1, (5,), np.float32) 115 | ``` 116 | 117 | ## Acknowledgements 118 | We thank Ben Eysenbach and Debidatta Dwibedi for their helpful feedback. 119 | 120 | 121 | Our benchmark builds upon previously open-sourced work. We build upon the desk XMLs first introduced in [[1]](https://github.com/google-research/google-research/tree/master/playrooms), the Franka XMLs open-sourced in [[2]](https://github.com/vikashplus/franka_sim), and the Franka meshes open-sourced in [[3]](https://github.com/frankaemika/franka_ros/tree/kinetic-devel/franka_description). 122 | 123 | ## Questions 124 | 125 | Please [open an issue][issues] on Github. 126 | 127 | [issues]: https://github.com/google-research/robodesk/issues 128 | 129 | Disclaimer: This is not an official Google product. 130 | -------------------------------------------------------------------------------- /robodesk/__init__.py: -------------------------------------------------------------------------------- 1 | from .robodesk import RoboDesk 2 | -------------------------------------------------------------------------------- /robodesk/assets/desk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 225 | -------------------------------------------------------------------------------- /robodesk/assets/franka_panda.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /robodesk/assets/franka_panda_headers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /robodesk/assets/meshes/bin.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/bin.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/button_holder.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/button_holder.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/desk_drawer_handle.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/desk_drawer_handle.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/desk_drawer_wood.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/desk_drawer_wood.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/desk_main.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/desk_main.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/desk_slide_handle.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/desk_slide_handle.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/desk_slide_wood.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/desk_slide_wood.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_finger.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_finger.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_hand.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_hand.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_link0.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_link0.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_link1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_link1.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_link2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_link2.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_link3.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_link3.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_link4.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_link4.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_link5.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_link5.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_link6.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_link6.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/collision_link7.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/collision_link7.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_finger.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_finger.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_hand.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_hand.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_link0.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_link0.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_link1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_link1.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_link2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_link2.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_link3.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_link3.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_link4.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_link4.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_link5.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_link5.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_link6.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_link6.stl -------------------------------------------------------------------------------- /robodesk/assets/meshes/franka/visual_link7.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/meshes/franka/visual_link7.stl -------------------------------------------------------------------------------- /robodesk/assets/textures/metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/textures/metal.png -------------------------------------------------------------------------------- /robodesk/assets/textures/white_marble_tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/textures/white_marble_tile.png -------------------------------------------------------------------------------- /robodesk/assets/textures/wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google-research/robodesk/a8edde34f879242730c026dfe7c6e3beb4318023/robodesk/assets/textures/wood.png -------------------------------------------------------------------------------- /robodesk/robodesk.py: -------------------------------------------------------------------------------- 1 | """Desk environment with Franka Panda arm.""" 2 | 3 | from __future__ import absolute_import 4 | from __future__ import division 5 | from __future__ import print_function 6 | 7 | import os 8 | 9 | from dm_control import mujoco 10 | from dm_control.utils import inverse_kinematics 11 | import gym 12 | import numpy as np 13 | from PIL import Image 14 | 15 | 16 | class RoboDesk(gym.Env): 17 | """Multi-task manipulation environment.""" 18 | 19 | def __init__(self, task='open_slide', reward='dense', action_repeat=1, 20 | episode_length=500, image_size=64): 21 | assert reward in ('dense', 'sparse', 'success'), reward 22 | 23 | model_path = os.path.join(os.path.dirname(__file__), 'assets/desk.xml') 24 | self.physics = mujoco.Physics.from_xml_path(model_path) 25 | self.physics_copy = self.physics.copy(share_model=True) 26 | self.physics_copy.data.qpos[:] = self.physics.data.qpos[:] 27 | 28 | # Robot constants 29 | self.num_joints = 9 30 | self.joint_bounds = self.physics.model.actuator_ctrlrange.copy() 31 | 32 | # Environment params 33 | self.image_size = image_size 34 | self.action_dim = 5 35 | self.reward = reward 36 | self.success = None 37 | 38 | # Action space 39 | self.end_effector_scale = 0.01 40 | self.wrist_scale = 0.02 41 | self.joint_scale = 0.02 42 | 43 | # Episode length 44 | self.action_repeat = action_repeat 45 | self.num_steps = 0 46 | self.episode_length = episode_length 47 | 48 | self.original_pos = {} 49 | self.previous_z_angle = None 50 | self.total_rotation = 0 51 | 52 | # pylint: disable=g-long-lambda 53 | self.reward_functions = { 54 | # Core tasks 55 | 'open_slide': self._slide_reward, 56 | 'open_drawer': self._drawer_reward, 57 | 'push_green': (lambda reward_type: self._button_reward( 58 | 'green', reward_type)), 59 | 'stack': self._stack_reward, 60 | 'upright_block_off_table': (lambda reward_type: self._push_off_table( 61 | 'upright_block', reward_type)), 62 | 'flat_block_in_bin': (lambda reward_type: self._put_in_bin( 63 | 'flat_block', reward_type)), 64 | 'flat_block_in_shelf': (lambda reward_type: self._put_in_shelf( 65 | 'flat_block', reward_type)), 66 | 'lift_upright_block': (lambda reward_type: self._lift_block( 67 | 'upright_block', reward_type)), 68 | 'lift_ball': (lambda reward_type: self._lift_block( 69 | 'ball', reward_type)), 70 | 71 | # Extra tasks 72 | 'push_blue': (lambda reward_type: self._button_reward( 73 | 'blue', reward_type)), 74 | 'push_red': (lambda reward_type: self._button_reward( 75 | 'red', reward_type)), 76 | 'flat_block_off_table': (lambda reward_type: self._push_off_table( 77 | 'flat_block', reward_type)), 78 | 'ball_off_table': (lambda reward_type: self._push_off_table( 79 | 'ball', reward_type)), 80 | 'upright_block_in_bin': (lambda reward_type: self._put_in_bin( 81 | 'upright_block', reward_type)), 82 | 'ball_in_bin': (lambda reward_type: self._put_in_bin( 83 | 'ball', reward_type)), 84 | 'upright_block_in_shelf': (lambda reward_type: self._put_in_shelf( 85 | 'upright_block', reward_type)), 86 | 'ball_in_shelf': (lambda reward_type: self._put_in_shelf( 87 | 'ball', reward_type)), 88 | 'lift_flat_block': (lambda reward_type: self._lift_block( 89 | 'flat_block', reward_type)), 90 | } 91 | 92 | self.core_tasks = list(self.reward_functions)[0:12] 93 | self.all_tasks = list(self.reward_functions) 94 | self.task = task 95 | # pylint: enable=g-long-lambda 96 | 97 | @property 98 | def action_space(self): 99 | return gym.spaces.Box(-np.ones(self.action_dim), np.ones(self.action_dim)) 100 | 101 | @property 102 | def observation_space(self): 103 | spaces = { 104 | 'image': gym.spaces.Box( 105 | 0, 255, (self.image_size, self.image_size, 3), np.uint8), 106 | 'qpos_robot': gym.spaces.Box(self.joint_bounds[:, 0], 107 | self.joint_bounds[:, 1]), 108 | 'qvel_robot': gym.spaces.Box(-np.inf, np.inf, (9,), np.float32), 109 | 'end_effector': gym.spaces.Box(-np.inf, np.inf, (3,), np.float32), 110 | 'qpos_objects': gym.spaces.Box(-np.inf, np.inf, (26,), np.float32), 111 | 'qvel_objects': gym.spaces.Box(-np.inf, np.inf, (26,), np.float32)} 112 | return gym.spaces.Dict(spaces) 113 | 114 | def render(self, mode='rgb_array', resize=True): 115 | params = {'distance': 1.8, 'azimuth': 90, 'elevation': -60, 116 | 'crop_box': (16.75, 25.0, 105.0, 88.75), 'size': 120} 117 | camera = mujoco.Camera( 118 | physics=self.physics, height=params['size'], 119 | width=params['size'], camera_id=-1) 120 | camera._render_camera.distance = params['distance'] # pylint: disable=protected-access 121 | camera._render_camera.azimuth = params['azimuth'] # pylint: disable=protected-access 122 | camera._render_camera.elevation = params['elevation'] # pylint: disable=protected-access 123 | camera._render_camera.lookat[:] = [0, 0.535, 1.1] # pylint: disable=protected-access 124 | 125 | image = camera.render(depth=False, segmentation=False) 126 | camera._scene.free() # pylint: disable=protected-access 127 | 128 | if resize: 129 | image = Image.fromarray(image).crop(box=params['crop_box']) 130 | image = image.resize([self.image_size, self.image_size], 131 | resample=Image.ANTIALIAS) 132 | image = np.asarray(image) 133 | return image 134 | 135 | def _ik(self, pos): 136 | out = inverse_kinematics.qpos_from_site_pose( 137 | self.physics_copy, 'end_effector', pos, 138 | joint_names=('panda0_joint1', 'panda0_joint2', 'panda0_joint3', 139 | 'panda0_joint4', 'panda0_joint5', 'panda0_joint6'), 140 | inplace=True) 141 | return out.qpos[:] 142 | 143 | def _action_to_delta_joint(self, unscaled_value, joint_bounds): 144 | """Convert actions from [-1, 1] range to joint bounds.""" 145 | joint_range = joint_bounds[1] - joint_bounds[0] 146 | return (((unscaled_value + 1) * joint_range) / 2) + joint_bounds[0] 147 | 148 | def _convert_action(self, full_action): 149 | """Converts action from [-1, 1] space to desired joint position.""" 150 | full_action = np.array(full_action) 151 | 152 | delta_action = full_action[0:3] * self.end_effector_scale 153 | position = ( 154 | self.physics.named.data.site_xpos['end_effector'] + delta_action) 155 | 156 | joint = self._ik(position) 157 | delta_wrist = self._action_to_delta_joint(full_action[3], 158 | self.joint_bounds[6]) 159 | joint[6] = ((self.wrist_scale * delta_wrist) + 160 | self.physics.named.data.qpos[6]) 161 | joint[6] = np.clip(joint[6], self.joint_bounds[6][0], 162 | self.joint_bounds[6][1]) 163 | joint[7] = self._action_to_delta_joint(full_action[4], 164 | self.joint_bounds[7]) 165 | joint[8] = joint[7] 166 | return joint 167 | 168 | def step(self, action): 169 | total_reward = 0 170 | for _ in range(self.action_repeat): 171 | joint_position = self._convert_action(action) 172 | for _ in range(10): 173 | self.physics.data.ctrl[0:9] = joint_position[0:9] 174 | # Ensure gravity compensation stays enabled. 175 | self.physics.data.qfrc_applied[0:9] = self.physics.data.qfrc_bias[0:9] 176 | self.physics.step() 177 | self.physics_copy.data.qpos[:] = self.physics.data.qpos[:] 178 | 179 | if self.reward == 'dense': 180 | total_reward += self._get_task_reward(self.task, 'dense_reward') 181 | elif self.reward == 'sparse': 182 | total_reward += float(self._get_task_reward(self.task, 'success')) 183 | elif self.reward == 'success': 184 | if self.success: 185 | total_reward += 0 # Only give reward once in case episode continues. 186 | else: 187 | self.success = self._get_task_reward(self.task, 'success') 188 | total_reward += float(self.success) 189 | else: 190 | raise ValueError(self.reward) 191 | 192 | self.num_steps += self.action_repeat 193 | if self.episode_length and self.num_steps >= self.episode_length: 194 | done = True 195 | else: 196 | done = False 197 | return self._get_obs(), total_reward, done, {'discount': 1.0} 198 | 199 | def _get_init_robot_pos(self): 200 | init_joint_pose = np.array( 201 | [-0.30, -0.4, 0.28, -2.5, 0.13, 1.87, 0.91, 0.01, 0.01]) 202 | init_joint_pose += 0.15 * np.random.uniform( 203 | low=self.physics.model.actuator_ctrlrange[:self.num_joints, 0], 204 | high=self.physics.model.actuator_ctrlrange[:self.num_joints, 1]) 205 | return init_joint_pose 206 | 207 | def reset(self): 208 | """Resets environment.""" 209 | self.success = False 210 | self.num_steps = 0 211 | 212 | self.physics.reset() 213 | 214 | # Randomize object positions. 215 | self.physics.named.data.qpos['drawer_joint'] -= 0.10 * np.random.random() 216 | self.physics.named.data.qpos['slide_joint'] += 0.20 * np.random.random() 217 | 218 | self.physics.named.data.qpos['flat_block'][0] += 0.3 * np.random.random() 219 | self.physics.named.data.qpos['flat_block'][1] += 0.07 * np.random.random() 220 | self.physics.named.data.qpos['ball'][0] += 0.48 * np.random.random() 221 | self.physics.named.data.qpos['ball'][1] += 0.08 * np.random.random() 222 | self.physics.named.data.qpos['upright_block'][0] += ( 223 | 0.3 * np.random.random() + 0.05) 224 | self.physics.named.data.qpos['upright_block'][1] += ( 225 | 0.05 * np.random.random()) 226 | 227 | # Set robot position. 228 | self.physics.data.qpos[:self.num_joints] = self._get_init_robot_pos() 229 | self.physics.data.qvel[:self.num_joints] = np.zeros(9) 230 | 231 | # Relax object intersections. 232 | self.physics.forward() 233 | 234 | # Copy physics state into IK simulation. 235 | self.physics_copy.data.qpos[:] = self.physics.data.qpos[:] 236 | self.original_pos['ball'] = self.physics.named.data.xpos['ball'] 237 | self.original_pos['upright_block'] = self.physics.named.data.xpos[ 238 | 'upright_block'] 239 | self.original_pos['flat_block'] = self.physics.named.data.xpos['flat_block'] 240 | 241 | self.drawer_opened = False 242 | return self._get_obs() 243 | 244 | def _did_not_move(self, block_name): 245 | current_pos = self.physics.named.data.xpos[block_name] 246 | dist = np.linalg.norm(current_pos - self.original_pos[block_name]) 247 | return dist < 0.01 248 | 249 | def _total_movement(self, block_name, max_dist=5.0): 250 | current_pos = self.physics.named.data.xpos[block_name] 251 | dist = np.linalg.norm(current_pos - self.original_pos[block_name]) 252 | return dist / max_dist 253 | 254 | def _get_dist_reward(self, object_pos, max_dist=1.0): 255 | eepos = self.physics.named.data.site_xpos['end_effector'] 256 | dist = np.linalg.norm(eepos - object_pos) 257 | reward = 1 - (dist / max_dist) 258 | return max(0, min(1, reward)) 259 | 260 | def _slide_reward(self, reward_type='dense_reward'): 261 | blocks = ['flat_block', 'upright_block', 'ball'] 262 | if reward_type == 'dense_reward': 263 | door_pos = self.physics.named.data.qpos['slide_joint'][0] / 0.6 264 | target_pos = (self.physics.named.data.site_xpos['slide_handle'] - 265 | np.array([0.15, 0, 0])) 266 | dist_reward = self._get_dist_reward(target_pos) 267 | did_not_move_reward = (0.33 * self._did_not_move(blocks[0]) + 268 | 0.33 * self._did_not_move(blocks[1]) + 269 | 0.34 * self._did_not_move(blocks[2])) 270 | task_reward = (0.75 * door_pos) + (0.25 * dist_reward) 271 | return (0.9 * task_reward) + (0.1 * did_not_move_reward) 272 | elif reward_type == 'success': 273 | return 1 * (self.physics.named.data.qpos['slide_joint'] > 0.55) 274 | 275 | def _drawer_reward(self, reward_type='dense_reward'): 276 | if reward_type == 'dense_reward': 277 | drawer_pos = abs(self.physics.named.data.qpos['drawer_joint'][0]) / 0.3 278 | dist_reward = self._get_dist_reward( 279 | self.physics.named.data.geom_xpos['drawer_handle']) 280 | return (0.75 * drawer_pos) + (0.25 * dist_reward) 281 | elif reward_type == 'success': 282 | return 1 * (self.physics.named.data.qpos['drawer_joint'] < -0.2) 283 | 284 | def _button_reward(self, color, reward_type='dense_reward'): 285 | press_button = ( 286 | self.physics.named.data.qpos[color + '_light'][0] < -0.00453) 287 | if reward_type == 'dense_reward': 288 | dist_reward = self._get_dist_reward( 289 | self.physics.named.data.xpos[color + '_button']) 290 | return (0.25 * press_button) + (0.75 * dist_reward) 291 | elif reward_type == 'success': 292 | return 1.0 * press_button 293 | 294 | def _stack_reward(self, reward_type='dense_reward'): 295 | target_offset = [0, 0, 0.0377804] 296 | current_offset = (self.physics.named.data.xpos['upright_block'] - 297 | self.physics.named.data.xpos['flat_block']) 298 | 299 | offset_difference = np.linalg.norm(target_offset - current_offset) 300 | 301 | dist_reward = self._get_dist_reward( 302 | self.physics.named.data.xpos['upright_block']) 303 | 304 | if reward_type == 'dense_reward': 305 | return -offset_difference + dist_reward 306 | elif reward_type == 'success': 307 | return offset_difference < 0.04 308 | 309 | def _push_off_table(self, block_name, reward_type='dense_reward'): 310 | blocks = ['flat_block', 'upright_block', 'ball'] 311 | blocks.remove(block_name) 312 | if reward_type == 'dense_reward': 313 | block_pushed = (1 - (self.physics.named.data.xpos[block_name][2] / 314 | self.original_pos[block_name][2])) 315 | block_0_stay_put = (1 - self._total_movement(blocks[0])) 316 | block_1_stay_put = (1 - self._total_movement(blocks[1])) 317 | reward = ((0.8 * block_pushed) + (0.1 * block_0_stay_put) + 318 | (0.1 * block_1_stay_put)) 319 | reward = max(0, min(1, reward)) 320 | dist_reward = self._get_dist_reward( 321 | self.physics.named.data.xpos[block_name]) 322 | return (0.75 * reward) + (0.25 * dist_reward) 323 | elif reward_type == 'success': 324 | return 1 * ((self.physics.named.data.qpos[block_name][2] < 0.6) and 325 | self._did_not_move(blocks[0]) and 326 | self._did_not_move(blocks[1])) 327 | 328 | def _put_in_bin(self, block_name, reward_type='dense_reward'): 329 | pos = self.physics.named.data.xpos[block_name] 330 | success = (pos[0] > 0.28) and (pos[0] < 0.52) and (pos[1] > 0.38) and ( 331 | pos[1] < 0.62) and (pos[2] > 0) and (pos[2] < 0.4) 332 | if reward_type == 'dense_reward': 333 | dist_reward = self._get_dist_reward( 334 | self.physics.named.data.xpos[block_name]) 335 | return (0.5 * dist_reward) + (0.5 * float(success)) 336 | elif reward_type == 'success': 337 | return 1 * success 338 | 339 | def _put_in_shelf(self, block_name, reward_type='dense_reward'): 340 | x_success = (self.physics.named.data.xpos[block_name][0] > 0.2) 341 | y_success = (self.physics.named.data.xpos[block_name][1] > 1.0) 342 | success = x_success and y_success 343 | blocks = ['flat_block', 'upright_block', 'ball'] 344 | blocks.remove(block_name) 345 | if reward_type == 'dense_reward': 346 | target_x_y = np.array([0.4, 1.1]) 347 | block_dist_reward = 1 - (np.linalg.norm( 348 | target_x_y - self.physics.named.data.xpos[block_name][0:2])) 349 | dist_reward = self._get_dist_reward( 350 | self.physics.named.data.xpos[block_name]) 351 | block_0_stay_put = (1 - self._total_movement(blocks[0])) 352 | block_1_stay_put = (1 - self._total_movement(blocks[1])) 353 | block_in_shelf = ((0.33 * dist_reward) + (0.33 * block_dist_reward) + 354 | (0.34 * float(success))) 355 | reward = ((0.5 * block_in_shelf) + (0.25 * block_0_stay_put) + 356 | (0.25 * block_1_stay_put)) 357 | return reward 358 | elif reward_type == 'success': 359 | return 1 * success 360 | 361 | def _lift_block(self, block_name, reward_type='dense_reward'): 362 | if reward_type == 'dense_reward': 363 | dist_reward = self._get_dist_reward( 364 | self.physics.named.data.xpos[block_name]) 365 | block_reward = (self.physics.named.data.xpos[block_name][2] - 366 | self.original_pos[block_name][2]) * 10 367 | block_reward = max(0, min(1, block_reward)) 368 | return (0.85 * block_reward) + (0.15 * dist_reward) 369 | elif reward_type == 'success': 370 | success_criteria = {'upright_block': 0.86, 'ball': 0.81, 371 | 'flat_block': 0.78} 372 | threshold = success_criteria[block_name] 373 | return 1 * (self.physics.named.data.xpos[block_name][2] > threshold) 374 | 375 | def _get_task_reward(self, task, reward_type): 376 | reward = self.reward_functions[task](reward_type) 377 | reward = max(0, min(1, reward)) 378 | return reward 379 | 380 | def _get_obs(self): 381 | return {'image': self.render(resize=True), 382 | 'qpos_robot': self.physics.data.qpos[:self.num_joints].copy(), 383 | 'qvel_robot': self.physics.data.qvel[:self.num_joints].copy(), 384 | 'end_effector': self.physics.named.data.site_xpos['end_effector'], 385 | 'qpos_objects': self.physics.data.qvel[self.num_joints:].copy(), 386 | 'qvel_objects': self.physics.data.qvel[self.num_joints:].copy()} 387 | -------------------------------------------------------------------------------- /robodesk/robodesk_example.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright 2021 Google LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | """ 16 | 17 | import robodesk 18 | 19 | env = robodesk.RoboDesk() 20 | env.reset() 21 | env.step([1, 0, 0, 0, 0]) 22 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | import pathlib 3 | 4 | import os 5 | 6 | def package_files(directory): 7 | paths = [] 8 | for (path, directories, filenames) in os.walk(directory): 9 | for filename in filenames: 10 | paths.append(os.path.join('..', path, filename)) 11 | return paths 12 | 13 | extra_files = package_files('robodesk/assets') 14 | 15 | print(extra_files) 16 | 17 | 18 | setuptools.setup( 19 | name='robodesk', 20 | version='1.0.0', 21 | description='Multi-task reinforcement learning benchmark.', 22 | url='https://github.com/google-research/robodesk', 23 | author='Harini Kannan', 24 | author_email='hkannan@google.com', 25 | packages=['robodesk'], 26 | package_data={'robodesk': extra_files}, 27 | long_description=pathlib.Path('README.md').read_text(), 28 | long_description_content_type='text/markdown', 29 | install_requires=['numpy', 'dm_control', 'gym'], 30 | classifiers=[ 31 | 'Intended Audience :: Science/Research', 32 | 'Intended Audience :: Developers', 33 | 'License :: OSI Approved :: MIT License', 34 | 'Programming Language :: Python :: 3', 35 | 'Topic :: Games/Entertainment', 36 | 'Topic :: Scientific/Engineering :: Artificial Intelligence', 37 | ], 38 | ) 39 | --------------------------------------------------------------------------------