Rotation of robotic arm (kinematics)

183 Views Asked by At

I have a defined robotic arm, consisting of one joint, base and the ending. The base of the arm is in point A (0,0,0) - this is not possible to rotate, first joint is in point B (0,1,0) and the ending is in point C (1,2,-1).

First, I should create a hierarchical structure for this robotic arm. Do you have any hint about how such a hierarchical structure looks like? Can I imagine this as some linked list of the respective points?

Second, I should rotate the joint in point B by 10 degrees around the axis going through the middle of this joint, in the direction of vector (1,0,-1). How can I do this? Do you have at least some hint or principle that I could use for calculating this rotation?

1

There are 1 best solutions below

0
On

Linked list would work in your simple example. In general the hierarchy is like a tree structure or a directed acyclic graph (DAG). You have parent-child relationship between the "nodes" of the graph.

Each node in the hierarchy holds its own local matrix transform (or the parameters like axis, angle and translation vector). To determine the global transform of each node you need only the parent transform.

In your example, lets say you have two nodes A and B. Where A is parent of B.

You can define the local rotation $R$ around an axis passing through the origin as a 3×3 matrix. However since the rotation axis of joints in general does not pass through the origin, we need a to represent rotations around a general axis as 4×4 matrix in homogeneous space. By using 4×4 matrices we can represent rotations and translations as 4×4 matrices and combine them in a single matrix with matrix multiplication.

Given a translation matrix $T$ which encodes the position of the joint B (0,1,0), and a rotation matrix $R$ encoding a rotation around an axis passing through joint B (you don't know yet what axis is this, but suppose you know for now). The transform of the node B would be $M = T R T^{-1}$. Take into account that $M$ is a local transformation. In order to know the global transform of joint B we need to know the transform of the parent node A. However you said A cannot rotate so we can assume parent rotation is the Identity matrix $I$. So the global transform of joint B is $M_g = I M$.

The end point C is not a joint, So it just transform the same as its parent B. Alternatively you can think of C as a joint which cannot rotate, So local transform of C is identity matrix $I$. So global transform of C is $M_g I$ which is equal to $M_g$. Note the parent's transform is the global one of the parent.

Now we need to determine the rotation axis. We have two vectors. The first is $V_1 = C - B$ which is the one going from joint B to end point C. The second one is $V_2 = C' - B$ which is the one going from joint B to the New end position which I call C'.

The axis of rotation is perpendicular to both $V_1$ and $V_2$ So you can find it using the cross product $V_1 × V_2$. You will probably need to normalize this axis. The angle of rotation is just the angle between $V_1$ and $V_2$ So you can find it as $\theta = \cos^{-1}(\hat V_1 \cdot \hat V_2)$ where $\hat V_1$ and $\hat V_2$ are the normalized version of vectors $V_1$ and $V_2$.

With that axis and angle you can use Rodrigues rotation formula to find the local rotation $R$ and thus find $M$.