Home

Awesome

RelaxedIK Unity

You can find an introduction and the citation information of RelaxedIK in the README of RelaxedIK Core which is a submodule of this repo. It is recommended to look at RelaxedIK Core before working with this wrapper.

This wrapper allows users to use RelaxedIK in Unity on Windows. A few commonly used simulated robot arms have already been set up for you to play with. In the simulation, you will be able to disable or enable RelaxedIK as you like. When RelaxedIK is disabled, a joint angle writer panel will show up for you to adjust and visualize the joint angle configuration. When RelaxedIK is enabled, you will be able to have real-time interactions with RelaxedIK by dragging the transform gizmo associated with the gripper of the robot.

RelaxedIK Family

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

RelaxedIK (Deprecated)RelaxedIK ROS1RelaxedIK UnityRelaxedIK CoppeliasimRelaxedIK Mujoco
RelaxedIK:o::o::o::o::o:
Collision IK:x::o::x::x::x:

Dependencies

Getting Started

  1. Make sure that you have installed all the dependencies.
  2. Clone this repo to your windows machine and open the subdirectory RelaxedIK as a Unity Project.
  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 adding a new robot arm instead of working with an existing one, aside from generating robot config files in the last step, you also need to
    1. Follow the steps at ros-sharp wiki to set up the simulation of the new robot arm in Unity. Please make sure that the urdf file has inertia information in it, otherwise the joints may not be set up correctly.
    2. Once the robot arm is loaded, add the RelaxedIKUnity script in Assets/Scripts to it. Set up the list of robot Limbs and end-effectors by adding the corresponding game object to the list. The size of this list should be the same as the size of joint angle solution array published by RelaxedIK for that robot. You can refer to the corresponding <xxx_info.yaml> for how many and the order of links to add to the list. Be careful that you only want to add those links with the Hinge Joint component which imply that they are associated with revolute joints.
    3. You also need to drag and drop the transform(s) of the end effector(s) and the pose goal prefab (which can be found at Assets/Prefabs/PoseGoal) to the RelaxedIK Unity component.
    4. On the component of the UrdfRobot script, enable Is Kinematic and All Convex Colliders and disable Use Gravity and Use Inertia from URDF.
    5. Optional: Add a child named ViewCenter to the robot arm to configure the position of the camera at runtime.
  6. Copy and paste the new dll file which you can find in relaxed_ik_core/target/debug/relaxed_ik_lib.dll to RelaxedIK/Assets/Plugins/relaxed_ik_lib.dll.
  7. Set the gameobject of a robot arm as active to play with it. Make sure only one robot arm is active at the same time.
  8. Click play in Unity. Hold left Alt key and use your mouse to navigate the camera. Use the GUI on the left side to play with the robot arm. Have fun!

Existing issues