Skip to content

unisa-acg/actor-critic-model-predictive-force-controller

Repository files navigation

Experimental validation of an Actor-Critic Model Predictive Force Controller for robot-environment interaction tasks

This repository collects the work conducted by a collaboration between UniSa, PoliMi and IDSIA. The repository is thought as a support and demonstration material for the homonymous paper.

Getting Started

This section explains how to setup the environment needed to launch the demos. First, MuJoCo needs to be installed, then some preliminary packages are required for the virtual environment creation.

Install MuJoCo 2.1.0

In order to install MuJoCo you need to:

  1. Create a hidden folder:

    cd
    mkdir .mujoco
  2. Download MuJoCo library

    cd .mujoco
    wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz
  3. Extract the MuJoCo downloaded library into the hidden folder .mujoco

    tar -xf mujoco210-linux-x86_64.tar.gz -C .
    rm mujoco210-linux-x86_64.tar.gz
  4. Add these lines to the .bashrc file:

    export LD_LIBRARY_PATH=$HOME/.mujoco/mujoco210/bin #substitute username with your username
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia #if nvidia graphic
    export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so
    export PATH="$LD_LIBRARY_PATH:$PATH"
  5. Source the .bashrc file:

    cd
    source .bashrc
  6. Test the installation:

    cd ~/.mujoco/mujoco210/bin
    ./simulate ../model/humanoid.xml

Prerequisites

You will need Pip for the virtual environment packages installation, venv for the virtual environment and some other packages as prerequisites for Mujoco-Py. sudo can be needed for some installations.

  • Pip

    apt install pip
    
  • Packages needed for Mujoco-Py

    apt install libosmesa6-dev libgl1-mesa-glx libglfw3
    apt install patchelf gcc
    apt install python3-dev build-essential libssl-dev libffi-dev libxml2-dev
    apt install libxslt1-dev zlib1g-dev libglew-dev
    
  • Python-venv

    apt install python3.8-venv
    
  • ROS Noetic

Clone the repository

Clone environment_identification repository

cd
git clone https://bitbucket.org/unisa-polimi-idsia/environment_identification/

Setting up the virtual environment

Create a python venv and activate it

python3 -m venv venv --python=python3.8 # Create the venv
source venv/bin/activate # Activate the venv

Install via pip the required packages into the virtual environment

cd environment_identification
python3 -m pip install -r requirements.txt

Substitute the base robosuite controllers

Substitute the files base_controller.py and osc.py in robosuite (substitute USERNAME with your user name in the command lines):

cp dataset_generation_utilities/osc.py /home/USERNAME/venv/lib/python3.8/site-packages/robosuite/controllers # substitute USERNAME with your user name
cp dataset_generation_utilities/base_controller.py /home/USERNAME/venv/lib/python3.8/site-packages/robosuite/controllers # substitute USERNAME with your user name

Usage

Refer to the Readme.md in the ACMPFC folder.

Authors

Contributors

Master students

Back to top

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published