EricVoll / RobotDynamicsLibrary

This library contains methods to perform forward/inverse kinematics
Apache License 2.0
33 stars 4 forks source link

Confuse the XYZ axis of the Robot Joint('z', new Vector(0, 0, 300)) #1

Closed 12343954 closed 4 years ago

12343954 commented 4 years ago
Robot Ro = new Robot()
                .AddJoint('z', new Vector(0, 0, 300))
                .AddJoint('x', new Vector(0, 50, 330))
                .AddJoint('x', new Vector(0, 0, 440))
                .AddJoint('y', new Vector(0, 100, 35))
                .AddJoint('x', new Vector(0, 320, 0))
                .AddJoint('y', new Vector(0, 80, 0));
 Links = Ro.Links;
  1. what‘s means of first parameter "x/y/z"?
  2. xyz axis in the 2nd parameter Vector, are they the right definition?z axis is not the rotating direction
EricVoll commented 4 years ago

Hi,

are you familiar with homogeneous transformations? Its not complicated - the wikipedia article as a bit over the top.

Imagine the following situation: We have a base coordinate frame called O1 and a second ("smaller") coordinate frame. As you can see, the second frame is translated by the vector r1 and rotated around the x-axis by the angle "alpha". With this information you can build a homogeneous transformation from the second frame into the O1 frame (and of course the other way round by inverting the matrix - if possible). The AddJoint(...) method takes an axis as a first parameter and the offset vector r1 (in the image) as a second parameter.

This means, that the example in the image below would be written something like this: r1 = new Vector3(0,100,100); Robot Ro = new Robot().AddJoint('x', r1);

Does that clear it up for you?

Bild1