A gym environment for ALOHA
Actively maintained. Last release 7 weeks ago. A safe choice.
pip install gym-alohaREADME as published on PyPI with version 0.1.5.
gym-aloha
A gym environment for ALOHA
Installation
Create a virtual environment with Python 3.10 and activate it, e.g. with miniconda:
conda create -y -n aloha python=3.10 && conda activate aloha
Install gym-aloha:
pip install gym-aloha
Quickstart
# example.py
import imageio
import gymnasium as gym
import numpy as np
import gym_aloha
env = gym.make("gym_aloha/AlohaInsertion-v0")
observation, info = env.reset()
frames = []
for _ in range(1000):
action = env.action_space.sample()
observation, reward, terminated, truncated, info = env.step(action)
image = env.render()
frames.append(image)
if terminated or truncated:
observation, info = env.reset()
env.close()
imageio.mimsave("example.mp4", np.stack(frames), fps=25)
Description
Aloha environment.
Two tasks are available:
- TransferCubeTask: The right arm needs to first pick up the red cube lying on the table, then place it inside the gripper of the other arm.
- InsertionTask: The left and right arms need to pick up the socket and peg respectively, and then insert in mid-air so the peg touches the “pins” inside the socket.
Action Space
The action space consists of continuous values for each arm and gripper, resulting in a 14-dimensional vector:
- Six values for each arm's joint positions (absolute values).
- One value for each gripper's position, normalized between 0 (closed) and 1 (open).
Observation Space
Observations are provided as a dictionary with the following keys:
qposandqvel: Position and velocity data for the arms and grippers.images: Camera feeds from different angles.env_state: Additional environment state information, such as positions of the peg and sockets.
Rewards
- TransferCubeTask: