# How can I input joint angles to transformation matrix to get position in matlab?

I am trying to get the forward kinematics for a robot model in matlab (rigid body tree). I created a 4 x4 transformation matrix from the base to the end-effector using the gettransform() function. I have 4 different joint angles to control. But how do I multiply the joint angles with the transformation matrix so that I get the correct orientation and position output of the end-effector?

Is there otherwise a better option to get the forward kinematics?

Thanks!

• By the time you obtain forward kinematic matrix, you should have each joint variable inside it (not multiply it) Maybe you need post your forward kinematic matrix here.. – Albert H M Jun 16 at 0:51
• @AlbertHM Does that mean I have to calculate the matrix again every time I change the joint values? – Veronique Jun 17 at 10:15
• Absolutely. Because forward kinematic is a function that map joint configuration into end effector position. And each joint movement will result in different position and orientation of end effector. – Albert H M Jun 17 at 10:59
• Or you wanna make matlab function using that matrix, then there is a way. Make theta1 theta2 etc as symbolic (look matlab syms), then input it in getTransform – Albert H M Jun 17 at 11:00

After looking the documentation, in function gettransform you put your joint angle configuration there in radians.

1. Create the struct containing your join value

s = struct(nameofjoint1, valueofjoint1,..., nameofjointN, valueofjointN)

2. Get the position and orientation of your end-effector

    % Syntax

% transform = getTransform(robot,jointconfiguration,startframe,lastframe)

transform = getTransform(robot,s,'L1','L4')