# Robot Arm Simulation

I don't know if this is the right place to ask this question but I'll give it a try. A friend of mine is using unity 3D to simulate a robot arm, however he's having some troubles when he needs to rotate the robot arm. The arm can already grab stuff with its hands, however seems like sometimes randomly crashes when is rotating the wrist.

Here's an image of the robot arm:

That's the arm he's working on for the simulation, and you can see that every part of the arm is connected through the unity's inheritance system so it can rotate every piece of the robot arm along with the nested parts that follows the inheritance path. However something seems like is failing when it rotates the wrist of the arm.

Three main questions:

• How should be achieved the arm's rotation properly?
• How should be achieved picking up things with the hand of the arm properly?
• How could you make it move by itself on a given point that can reach?

I'm not asking for code or anything like that, just how these 3 things should be done properly in order to have fully functional robot arm simulation like the main concepts behind it.

How should be achieved the arm's rotation properly?

In unity each game object has a transformation property. The rotation component of the transformation property has to be changes in order to rotate a linkage properly. If this is not working, check if you rotate in the correct units and correct reference frame. If yes, it has to work, try rotating in the unity editor using the panel for setting position and orientation. If it works there it has to work in code too.

How should be achieved picking up things with the hand of the arm properly?

Not an easy question. If you want to use the physics engine, you can model the scenario using friction. If the jaws of the gripper hold the object which is manipulated using a high enough force then it will be lifted. This is computationally intensive. Another approach would be just to make the object which is manipulated the child of the gripper if a certain condition is met (i.e. jaws are closed). It is not a precise solution but it requires very little computation time

How could you make it move by itself on a given point that can reach?

You will need to solve inverse kinematics model of the robot for this. You have a line equation, you can discretize it and for each point you can solve the inverse kinematics problem to get the joint angles of the robot. You apply those angles to the robot sequentially and it will move along a line. Alternatively you can experiment with unity IK. I am not sure if it can be used in your case.

• Thank you so much for your answer! this will surely help as a starting point Commented Nov 13, 2016 at 16:29