{"id":31959381,"url":"https://github.com/huggingface/gym-xarm","last_synced_at":"2025-10-14T15:29:15.315Z","repository":{"id":236984365,"uuid":"779641498","full_name":"huggingface/gym-xarm","owner":"huggingface","description":"A gym environment for xArm","archived":false,"fork":false,"pushed_at":"2025-04-28T12:31:58.000Z","size":2261,"stargazers_count":72,"open_issues_count":5,"forks_count":18,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-10-12T15:05:46.442Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huggingface.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-30T11:44:29.000Z","updated_at":"2025-10-06T23:26:45.000Z","dependencies_parsed_at":"2024-05-07T10:30:56.085Z","dependency_job_id":"9f41a8ef-c0e1-4464-a4e0-845086abc3cf","html_url":"https://github.com/huggingface/gym-xarm","commit_stats":null,"previous_names":["huggingface/gym-xarm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/huggingface/gym-xarm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fgym-xarm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fgym-xarm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fgym-xarm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fgym-xarm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huggingface","download_url":"https://codeload.github.com/huggingface/gym-xarm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fgym-xarm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019314,"owners_count":26086711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-14T15:29:11.876Z","updated_at":"2025-10-14T15:29:15.307Z","avatar_url":"https://github.com/huggingface.png","language":"Python","funding_links":[],"categories":["Reinforcement Learning (RL) and Deep Reinforcement Learning (DRL)"],"sub_categories":["RL/DRL Environments"],"readme":"# gym-xarm\n\nA gym environment for xArm\n\n\u003ctd\u003e\u003cimg src=\"http://remicadene.com/assets/gif/simxarm_tdmpc.gif\" width=\"50%\" alt=\"TDMPC policy on xArm env\"/\u003e\u003c/td\u003e\n\n\n## Installation\n\nCreate a virtual environment with Python 3.10 and activate it, e.g. with [`miniconda`](https://docs.anaconda.com/free/miniconda/index.html):\n```bash\nconda create -y -n xarm python=3.10 \u0026\u0026 conda activate xarm\n```\n\nInstall gym-xarm:\n```bash\npip install gym-xarm\n```\n\n\n## Quickstart\n\n```python\n# example.py\nimport gymnasium as gym\nimport gym_xarm\n\nenv = gym.make(\"gym_xarm/XarmLift-v0\", render_mode=\"human\")\nobservation, info = env.reset()\n\nfor _ in range(1000):\n    action = env.action_space.sample()\n    observation, reward, terminated, truncated, info = env.step(action)\n    image = env.render()\n\n    if terminated or truncated:\n        observation, info = env.reset()\n\nenv.close()\n```\n\nTo use this [example](./example.py) with `render_mode=\"human\"`, you should set the environment variable `export MUJOCO_GL=glfw` or simply run\n```bash\nMUJOCO_GL=glfw python example.py\n```\n\n## Description for `Lift` task\n\nThe goal of the agent is to lift the block above a height threshold. The agent is an xArm robot arm and the block is a cube.\n\n### Action Space\n\nThe action space is continuous and consists of four values [x, y, z, w]:\n- [x, y, z] represent the position of the end effector\n- [w] represents the gripper control\n\n### Observation Space\n\nObservation space is dependent on the value set to `obs_type`:\n- `\"state\"`: observations contain agent and object state vectors only (no rendering)\n- `\"pixels\"`: observations contains rendered image only (no state vectors)\n- `\"pixels_agent_pos\"`: contains rendered image and agent state vector\n\n\n## Contribute\n\nInstead of using `pip` directly, we use `poetry` for development purposes to easily track our dependencies.\nIf you don't have it already, follow the [instructions](https://python-poetry.org/docs/#installation) to install it.\n\nInstall the project with dev dependencies:\n```bash\npoetry install --all-extras\n```\n\n### Follow our style\n\n```bash\n# install pre-commit hooks\npre-commit install\n\n# apply style and linter checks on staged files\npre-commit\n```\n\n\n## Acknowledgment\n\ngym-xarm is adapted from [FOWM](https://www.yunhaifeng.com/FOWM/) and is based on work by [Nicklas Hansen](https://nicklashansen.github.io/), [Yanjie Ze](https://yanjieze.com/), [Rishabh Jangir](https://jangirrishabh.github.io/), [Mohit Jain](https://natsu6767.github.io/), and [Sambaran Ghosal](https://github.com/SambaranRepo) as part of the following publications:\n* [Self-Supervised Policy Adaptation During Deployment](https://arxiv.org/abs/2007.04309)\n* [Generalization in Reinforcement Learning by Soft Data Augmentation](https://arxiv.org/abs/2011.13389)\n* [Stabilizing Deep Q-Learning with ConvNets and Vision Transformers under Data Augmentation](https://arxiv.org/abs/2107.00644)\n* [Look Closer: Bridging Egocentric and Third-Person Views with Transformers for Robotic Manipulation](https://arxiv.org/abs/2201.07779)\n* [Visual Reinforcement Learning with Self-Supervised 3D Representations](https://arxiv.org/abs/2210.07241)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuggingface%2Fgym-xarm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuggingface%2Fgym-xarm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuggingface%2Fgym-xarm/lists"}