Giter VIP home page Giter VIP logo

gym-xarm's Introduction

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:

conda create -y -n xarm python=3.10 && conda activate xarm

Install gym-xarm:

pip install gym-xarm

Quickstart

# example.py
import gymnasium as gym
import gym_xarm

env = gym.make("gym_xarm/XarmLift-v0", render_mode="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

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:

poetry install --with dev

Add dependencies

The equivalent of pip install some-package would just be:

poetry add some-package

Follow our style

# 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:

gym-xarm's People

Contributors

aliberts avatar cadene avatar qgallouedec avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.