Skip to content

Steigner/Unity_UR3_Levenberg-Marquardt_IK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity UR3 Levenberg-Marquardt Inverse Kinematics

In this project, an Inverse Kinematics based on the Levenberg-Marquardt method was implemented. The Unity game engine was used as the simulation environment and the programming language Python was used to implement the algorithm. In order to implement the result, the ZeroMQ library for both Python and C# in Unity was chosen. Thus, the communication is implemented using TCP/IP where Python is the Server and Unity is the Client.

The actual demonstration is then implemented in Python where five targets are selected both their rotational and translational part. The scripts can be very easily modularized and used to solve a simulation of a problem. For deployment in reality, it is then necessary to complete the communication with the robot.

Software
------------------------------------
| Unity version 2022.1.16f1
|   - NuGetForUnity version 3.0.5
| Python version 3.10
|   - Poetry version 1.2.1
| ZeroMQ

How to start the simulation demo?

In the Unity project section, you can download the Robot.unitypackage, when you download it and then run it in an open window, you will see a menu to import it into your project. It is also an integral part of the NetMQ library assignment.

  1. Option - As part of the project I downloaded NuGetForUnity. Its installation can be easily handled by following the steps:

    Link: https://github.com/GlitchEnzo/NuGetForUnity#how-do-i-install-nugetforunity

    Then, following the instructions in the repository, download the NetMQ nuget package and the Unity part is ready.

    I have also added the necessary files and libraries to the repository, which you can simply add to your project by exploring the Assets folder. Personally, I strongly recommend using Robot.unitypackage due to the fact that you need to load a script Joint.cs for each joint in your project and add rigibody and boxcollider for collision detection. Everything is stored in the OutdoorScene.

  2. Option - The alternative is to import the .dll libraries directly from Assets/Libraries.

The next part is Python, additional libraries were used in the project, so if you use Poetry, you can easily get everything, if you use PIP, Conda or other package manager, just get the libraries from pyproject.toml.

❗ Run Python first

❗ Run Unity second

Collision Detection

Collision detection was also provided within this project, if a collision occurs the movement is stopped and it is written to the Unity Console what joint was detected in the collision. You can see an example in the GIF. The same are included self collision.

Demo Example

The demo shows movement with and without collision detection. Within Unity, you can simply pin or unpin a cube in the GameObject Cube checkbox.

Demo

Finally, it should be mentioned that this is a project that has implemented simple Request / Response communication.