xuanhien070594 / trifinger_mujoco

An gym-compatible environment consists of trifinger robot and a cube

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

trifinger-mujoco

An gym-like environment consists of trifinger robot and a cube

Screenshots of different (Tri)Finger robots in simulation

Installation

Mujuco installation

  • Step 1: Download Mujoco 2.10 from this link
  • Step 2: Unzip and copy folder mujoco210 to under folder ~/.mujoco/ (create this folder if it doesn't exist)
  • Step 3: Add this line export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/{your_user_name}/.mujoco/mujoco210/bin to your ~/.bashrc or ~/.zshrc file
  • Step 4: Source your ~/.bashrc or ~/.zshrc file

Mujoco test

To ensure Mujoco is installed properly, run the following command ./mujoco/mujoco210/bin/simulate {path_to_this_repo}/trifinger_mujoco/models/trifinger_with_cube_torque_ctrl.xml

Trifinger-mujoco installation

To install, under the package's folder, run pip install -e .. It will install all necessary packages.

API

Here's an example using the "Trifinger-v0" environment:

import trifinger_mujoco
import gym
import numpy as np

env = gym.make("Trifinger-v0")
observation = env.reset()
env.render()

for _ in range(1000):
    action = np.random.uniform(low=-0.3, high=0.3, size=9)
    observation, reward, done, info = env.step(action)
    env.render()

    if done:
        break

env.close()

Attribution notes

  • STL files of trifinger are obtained from trifinger_simulation
  • Math utility functions are based on package baldor by Francisco Suárez Ruiz

About

An gym-compatible environment consists of trifinger robot and a cube

License:MIT License


Languages

Language:Python 100.0%