| | |

Arm Tutorial 2

Arm Tutorial 2 project build order

    A) If you have built all the other projects from the previous solutions step by step, you just need to build the projects in Column A.

    B) If you haven’t built any of the previous tutorial solutions, you need to build all included projects in the order shown in Column B.

    Column A

    1. Transformation
    2. KUKATutorial2MotionPlanning
    3. KUKATutorial2Dashboard
    Column B

    1. ArticulatedArm (in abstract services)
    2. Util
    3. SimulatedLBR3Arm
    4. KUKAArmTutorialSimulation
    5. Transformation
    6. KUKATutorial2MotionPlanning
    7. KUKATutorial2Dashboard


Moving the end of arm to specific cartesian coordinates with a specific orientation


In arm tutorial 1, the robot was moved by setting target joint angles. Neither did we know the position and orientation of the end-of-arm nor could we move the robot to a desired cartesian coordinate.

In practice it's probably more useful to know about the Cartesian position and Euler angle orientation of the tool center point (TCP) than the knowledge about the joint angles of the robot. Furthermore it makes sense to command the robot via Cartesian coordinate with euler angle parameters instead joint angles. E.g. in practice you want to command 'move the TCP to Cartesian position with orientation '.


As you may noticed all robot arms in the arm tutorials have no manipulators or tools, that's why we use the notion 'end of arm' (EOA). As the last element of the robot kinematic chain, a mounted manipulator is called end-effector. An end-effector has usually a specific defined point at his end, called tool center point (TCP).


So for an application point of view it makes sense to transform from the joint angles robot arm state to cartesian coordinates with angular orientation and vice versa. Arm tutorial 2 implements a service that provides such transformations.


Fig.1: Direct vs. inverse kinematic transformation


The transformation from the robot joint angles to a cartesian coordinate with angular orientation is called 'forward kinematic transformation' (Fig. 1). Mathematically this transformation is easy. One reason for it being easy is that we have no multiple solutions. We just take the axis values of each axis and calculate from one frame to the next.

The backward transformation from a Cartesian coordinate with angular orientation to the robot joint angle configuration is called 'inverse kinematic transformation' and is more complex. Like indicated in the following picture, multiple arm configurations are possible for a single TCP position and orientation. This impacts the complexity on the application design.



E.g.: A programmer wants to move the TCP to a target position with a specific orientation and the inverse kinematic transformation service returns up to 8 possible solutions. Which solution is the best in terms of collision, minimized joint state changes which implies e.g. minimized travel time?

Coding for Arm Tutorial 2:

In arm tutorial 2, we allow to define a destination for the end-of-arm in terms of a cartesian position. In this case, the motion planning service needs to find out the target axis values. This is done with a call to the newly introduced transformation service.

Arm Tutorial 2 Services Overview:


New services for arm tutorial 2:

   · Armtutorial2Dashboard: User Interface with added fields to enter cartesian positions
   · Armtutorial2MotionPlanning: Calculates the arm motion and sends axis values to the simulated LBR3
   · Transformation: Calculates direct and inverse kinematics


Handling a PTP move with a cartesian destination:

As soon as a ‘PTPMove’ object with a cartesian destination is processed in the PTPMove Handler of the motion planning service, it will cause a request for an inverse kinematic calculation.


This request is sent to the ‘_transformationPort’, which represents the transformation service. This request arrives at the ‘GetInverseKinematikHandler’ of the service.



The calculation of the inverse kinematic inside this handler as well as the calculation for the direct kinematic is shown in the following sections.

It starts with the calculation of the general transformation matrix for the kinematic chain.

Calculation of the transformation matrix for the kinematic chain (class Matrix, method GetTransformationMatrix)


This method computes the translation matrix frame to frame . To each frame a Denavit-Hartenberg parameter set is assigned to holding values for and . The Denavit-Hartenberg parameter sets for all joints in Fig. 1 are listed in Table 1, for their definition refer to (1).



Link length

Joint angle

Link offset

Fig. 2: Robot arm configuration Table1: Denavit-Hartenberg parameters


Using [14] and [15] we get the complete transformation from frame to frame :


Direct kinematics calculation (file class dirKinematik, method dirKinematik)


This method computes the position in cartesian coordinates and the orientation in RPY - angles of the TCP.


We start with the calculation of the transformation matrix for the whole kinematic chain that ends with the tool frame . Through a call of the method GetTransformationMatrix we evaluate [14]:


The TCP position can be read out directly from matrix :



The orientation in roll , pitch and yaw angles are calculated from the rotational sub matrix of using [9]:


Inverse kinematics calculation though a geometric approach (class InvKinematik, method InvKinematik)

From a given cartesian position and RPY - orientation of the TCP this method calculates the joint angles for a seven axis robot. For a single TCP position the method computes all eight possible arm configurations, see Fig. 2. For more information about the inverse kinematic calculation refer to (2).


Fig.3: Possible solutions of the inverse kinematics calculation


Joint 1 angle


Fig.4: Joint angle 1


Angle can be calculated from the position projection of frame on the x-z plane of frame , see Fig. 3. Hence at first we have to compute the position of . Twist joints don't change the position but the orientation of its subsequent frame. We use this property to simplify our calculations. In our robot arm we have three twist joints: Joint 1, 4 and 6. As shown in Fig. 3, the angular state of joint 6 influences just the orientation of the TCP, not its position. Through we get the position vector . The unit vector points to the - axis of is retrieved from the third column of the rotation sub matrix of :


Two solutions and yield to the same position see Fig. 3:


For the sake of clarity we use a simple geometric approach for our inverse kinematic algorithm. Hence we didn't consider all special cases that might result in ambiguous results, e.g. for the function. An improvement to the algorithm is left for the user as an exercise.


Joint angle 3


Fig.5: Joint angle 3


Via the knowledge of we get angle which in turns leads to joint angle . Again we take advantage of a twist joint property. As shown in Fig. 4, the angular state of joint 4 influences the orientation of frame , not its position. Hence vector can be calculated. We get the position from the translation part of:



We compute angle through the law of cosine:



Finally knowledge of offers two possible solutions for :



Joint angle 2:


As shown in Fig. 5, angle can be computed via and which in turn we get through the vector . For an easy calculation of we want to look at . As seen from , vector only has an x and z component. Therefore we transform from to using the inverse of the sub matrix of :


Because is orthogonal we get its inverse through its transpose:



Fig.6: Joint angle 2


We get and through (see Fig. 5):



Finally all solutions for come out through:



Joint angle 5:


Joint angle 5 can be calculated through the inner product between the unit vectors and (Fig. 6):


Fig.7: Joint angle 5


The orientation of vector can be retrieved from the rotation sub matrix of the transformation. Matrix can be calculated via the angle results we already have. Angle doesn't influence the position of therefore we assume . Using the prior results , and we evaluate [14] and [15]:


Two arm configurations yield to the same position for frame , see Fig. 2. Hence we calculate the transformation for both situations resulting in and :



Now we extract the rotation sub matrix from which column vectors are the base unit vectors of frame 4:


With the column vector of we finally compute all solutions for angle :



Joint angles 4 and 6:


The total rotation can be composed as follows:


Because matrix is orthogonal its inverse can also be calculated through its transpose:


Matrix is composed by three sequential rotations around Z-Y-Z:


Hence we state:


Again we have to calculate two matrices to retrieve all possible solutions:




Using the relation angle can be calculated through the elements and of :


Now all possible solutions for can be calculated:


The same way we get all solution for through the elements and of the matrix :



As you can see in Fig. 6, for and unlimited solutions are possible if becomes zero. In that case the mean value of and is assigned to and :



Finally all angles are wrapped to the closed interval :



At last the GetInverseKinematikHandler selects one of the eight possible arm configurations. For each possible arm configuration a quality function value is computed. The calculation takes the prior joint angle states into account:


The arm configuration with the smallest quality function value becomes the new target arm configuration:

Linear coordinate transformation

: = Basis vectors of the new coordinate system

: = Transformation matrix


Coordinate transformation matrix:


Coordinate transformation:




Coordinate system orientation:


Rotational transformation around axis x:


Rotational transformation around axis y:


Rotational transformation around axis z:




Roll, pitch and yaw (RPY) angles


RPY - rotation matrix (X, Y', Z'' rotation):


RPY angles from rotation a matrix :




: = Translation vector

: = Rotation matrix

: = Transformation matrix

: = Vector in frame :

: = Vector in frame :


Frame rotation ("Orientate via "):


Frame translation ("Translate by "):


Transformation matrix from frame to frame ("Orientate via and translate it by "):


Transformation from frame to frame :


Chained transformation from frame to frame (note that the multiplication is not commutative and must happen from left to right):



Denavit-Hartenberg transformation convention


As described in (1), four operations, two rotations and two translations are sufficient to compute a transformation matrix that transforms from frame to frame within a robot kinematic link chain based on the Denavit-Hartenberg convention:


Step 1: Rotation by link twist - Rotate frame around its axis until becomes parallel to axis of the next frame .

Step 2: Translation by link length - From its current position after step 1, move frame into the direction of axis until comes to overlap with axis of the next frame .

Step 3: Rotation by joint angle - From its current position after step 2, rotate frame around axis of the next frame until becomes parallel to axis .

Step 4: Translation by link offset - From its current position after step 3, move frame into the direction of axis until its origin matches the origin of the next frame .


The total transformation matrix for frame to frame is calculated through multiplication of the four single transformations. Note that the multiplication is not commutative and must happen from left to right:






: =

: =



: = Element row column of a matrix

: = Vector




(1) J. Craig, "Introduction to Robotics: Mechanics and Control", Addison Wesley Longman Publishing Co, 1986

(2) W. Weber, "Industrieroboter: Methoden der Steuerung und Regelung", Fachbuchverlag Leipzig, 2002








Print versionPrint version
Share |
Home    |    Sitemap    |    Imprint / Data privacy    |    Search    |    Contact
KUKA Robotics Corp.
Phone: +1 866-873-5852
Fax: +1 866-329-5852
CompanyKUKA Robot GroupJobsReference CustomersKUKA Worldwide
ProductsIndustrial RobotsControllersSoftwareAnd MoreRobot Systems
Customer ServicesKUKA CollegeRobotic ConsultingTechnical Support
  © Copyright 2013 KUKA Robotics Corp. All rights reserved