Home

Awesome

RelaxedIK MuJoCo

This is a RelaxedIK Plugin for MuJoCo which is an advanced physics simulation engine that may have some extra features unavailable in CoppeliaSim. You can find an introduction and some useful citation information of RelaxedIK in RelaxedIK Core which is a submodule of this repo. It is recommended to look at RelaxedIK Core before working with this wrapper.

Note that this wrapper is developed in Mujoco 2.0 Linux and Ubuntu 18.04.

RelaxedIK Family

More information about RelaxedIK, CollisionIK, and all the wrappers could be found in this documentation.

RelaxedIK (Deprecated)RelaxedIK ROS1RelaxedIK UnityRelaxedIK CoppeliasimRelaxedIK Mujoco
RelaxedIK:o::o::o::o::o:
CollisionIK:x::o::x::x::x:

Dependencies

To use this wrapper, you will first need to install Rust. Please go to https://www.rust-lang.org/learn/get-started for more infomation.

Getting Started

  1. Make sure that you have installed all the dependencies.
  2. Clone this repo to the installation folder of MuJoCo as a sibling folder of bin and include.
  3. Initialize relaxed_ik_core (the Rust library of RelaxedIK) as a submodule by running the following command from the project directory:
    git submodule update --init
    
  4. Navigate to the relaxed_ik_core folder and go through the steps below to get relaxed_ik_core ready.
    1. If your robot is in this list: [baxter, hubo, iiwa7, jaco7, panda, sawyer, ur5, yumi], ignore this step. Else, you will need to clone this repo and follow the step-by-step guide there to get the required robot config files into corresponding folders in the config folder in the core. To specify, there should be (replace "sawyer" with your robot name or your urdf name in some cases):
      • 1 self-collision file <collision_sawyer.yaml> in the collision_files folder
      • 4 Rust neural network files <sawyer_nn, sawyer_nn.yaml, sawyer_nn_jointpoint, sawyer_nn_jointpoint.yaml> in the collision_nn_rust folder
      • 1 info file <sawyer_info.yaml> in the info_files folder
      • 1 joint state function file <sawyer_joint_state_define> in the joint_state_define_functions folder
      • 1 urdf file <sawyer.urdf> in the urdfs folder.
    2. Compile the core:
      cargo build
      
  5. If you are working with a new robot, add the corresponding XML model into the root directory of this repo. Refer to the franka_sim and sawyer_sim folders for examples.
  6. Complie RelaxedIK in Mujoco by running make from the root directory of this repo.
  7. Select one of the robot models avaiable (sawyer and panda) and play with RelaxedIK by running the following commands from the root directory of this repo. When the program is running, the joint angle solutions will be printed to the console.
    cd ../bin
    # sawyer
    echo -n "sawyer_info.yaml" > ../relaxed_ik_mujoco/relaxed_ik_core/config/loaded_robot
    ./relaxedIK ../relaxed_ik_mujoco/sawyer_sim/sawyer.xml 
    # or panda
    echo -n "panda_info.yaml" > ../relaxed_ik_mujoco/relaxed_ik_core/config/loaded_robot
    ./relaxedIK ../relaxed_ik_mujoco/franka_sim/franka_panda.xml
    
  8. If you want to fit RelaxedIK into your own project, please follow these steps:
    1. Go to relaxed_ik_mujoco/relaxed_ik_core/config/loaded_robot and type the name of the pre-computed robot arm you would like to run (available options are baxter, hubo, iiwa7, jaco7, panda, sawyer, ur5 and yumi).
    2. All the code required to call RelaxedIK is marked by "Added for RelaxedIK" in relaxed_ik_mujoco/relaxedIK.cpp. You can take a look at it for reference of how to call RelaxedIK in your script.
    3. Refer to relaxed_ik_mujoco/Makefile for the example of how to compile a Mujoco project with RelaxedIK
    4. Run the executable and enjoy RelaxedIK!

For Testing Purposes