https://github.com/huggingface/gym-xarm

A gym environment for xArm

https://github.com/huggingface/gym-xarm

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary
Last synced: 4 months ago · JSON representation

Repository

A gym environment for xArm

Basic Info
  • Host: GitHub
  • Owner: huggingface
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 2.16 MB
Statistics
  • Stars: 72
  • Watchers: 7
  • Forks: 18
  • Open Issues: 5
  • Releases: 0
Created almost 2 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

gym-xarm

A gym environment for xArm

TDMPC policy on xArm env

Installation

Create a virtual environment with Python 3.10 and activate it, e.g. with miniconda: bash conda create -y -n xarm python=3.10 && conda activate xarm

Install gym-xarm: bash pip install gym-xarm

Quickstart

```python

example.py

import gymnasium as gym import gym_xarm

env = gym.make("gymxarm/XarmLift-v0", rendermode="human") observation, info = env.reset()

for _ in range(1000): action = env.action_space.sample() observation, reward, terminated, truncated, info = env.step(action) image = env.render()

if terminated or truncated:
    observation, info = env.reset()

env.close() ```

To use this example with render_mode="human", you should set the environment variable export MUJOCO_GL=glfw or simply run bash MUJOCO_GL=glfw python example.py

Description for Lift task

The 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.

Action Space

The action space is continuous and consists of four values [x, y, z, w]: - [x, y, z] represent the position of the end effector - [w] represents the gripper control

Observation Space

Observation space is dependent on the value set to obs_type: - "state": observations contain agent and object state vectors only (no rendering) - "pixels": observations contains rendered image only (no state vectors) - "pixels_agent_pos": contains rendered image and agent state vector

Contribute

Instead of using pip directly, we use poetry for development purposes to easily track our dependencies. If you don't have it already, follow the instructions to install it.

Install the project with dev dependencies: bash poetry install --all-extras

Follow our style

```bash

install pre-commit hooks

pre-commit install

apply style and linter checks on staged files

pre-commit ```

Acknowledgment

gym-xarm is adapted from FOWM and is based on work by Nicklas Hansen, Yanjie Ze, Rishabh Jangir, Mohit Jain, and Sambaran Ghosal as part of the following publications: * Self-Supervised Policy Adaptation During Deployment * Generalization in Reinforcement Learning by Soft Data Augmentation * Stabilizing Deep Q-Learning with ConvNets and Vision Transformers under Data Augmentation * Look Closer: Bridging Egocentric and Third-Person Views with Transformers for Robotic Manipulation * Visual Reinforcement Learning with Self-Supervised 3D Representations

Owner

  • Name: Hugging Face
  • Login: huggingface
  • Kind: organization
  • Location: NYC + Paris

The AI community building the future.

GitHub Events

Total
  • Issues event: 4
  • Watch event: 33
  • Issue comment event: 5
  • Push event: 1
  • Pull request event: 2
  • Fork event: 9
  • Create event: 1
Last Year
  • Issues event: 4
  • Watch event: 32
  • Issue comment event: 5
  • Push event: 1
  • Pull request event: 2
  • Fork event: 9
  • Create event: 1

Issues and Pull Requests

Last synced: 5 months ago

All Time
  • Total issues: 4
  • Total pull requests: 4
  • Average time to close issues: 4 days
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 3
  • Total pull request authors: 3
  • Average comments per issue: 0.25
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 2
  • Average time to close issues: 4 days
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 0.33
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • HaFred (2)
  • chenkang455 (1)
  • maxspahn (1)
Pull Request Authors
  • aliberts (2)
  • GoncaloMark (1)
  • traversaro (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/test.yml actions
  • actions/cache/restore v3 composite
  • actions/cache/save v3 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • snok/install-poetry v1 composite
poetry.lock pypi
  • absl-py 2.1.0
  • cfgv 3.4.0
  • cloudpickle 3.0.0
  • colorama 0.4.6
  • coverage 7.4.4
  • debugpy 1.8.1
  • distlib 0.3.8
  • exceptiongroup 1.2.0
  • farama-notifications 0.0.4
  • filelock 3.13.3
  • glfw 2.7.0
  • gymnasium 0.29.1
  • gymnasium-robotics 1.2.4
  • identify 2.5.35
  • imageio 2.34.0
  • iniconfig 2.0.0
  • jinja2 3.1.3
  • markupsafe 2.1.5
  • mujoco 2.3.7
  • nodeenv 1.8.0
  • numpy 1.26.4
  • packaging 24.0
  • pettingzoo 1.24.3
  • pillow 10.2.0
  • platformdirs 4.2.0
  • pluggy 1.4.0
  • pre-commit 3.7.0
  • pyopengl 3.1.7
  • pytest 8.1.1
  • pytest-cov 5.0.0
  • pyyaml 6.0.1
  • setuptools 69.2.0
  • tomli 2.0.1
  • typing-extensions 4.10.0
  • virtualenv 20.25.1
pyproject.toml pypi
  • debugpy ^1.8.1 develop
  • pre-commit ^3.6.2 develop
  • gymnasium ^0.29.1
  • gymnasium-robotics ^1.2.4
  • mujoco ^2.3.7
  • python ^3.10
  • pytest ^8.1.0 test
  • pytest-cov ^5.0.0 test
.github/workflows/quality.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite