Hi ,
I was studying ur phoenix code in C converted by daniel. I have a doubt with the calculation of coxa length.
here is a snippet of that code :
const int CoxaLength = 58; // Length of the Coxa [mm]
const int FemurLength = 120; // Length of the Femur [mm]
const int TibiaLength = 130; // Lenght of the Tibia [mm]
I assume that TibiaLength is the length between the Tibia joint to the tip of the feet ,
FemurLength is the length between the Femur & Tibia Joint.
So is “CoxaLength” the length between Coxa joint and femur along X-axis or Y-axis depending on ur convention ?
Also can u explain a bit about ur conventions for IK analysis… i mean the co-ordinate frames and their relations ?
LegIK(…) function takes 3 i/ps: X Y Z of the feet
How does it know : which leg we want to get the 3 angles of ?
Can some1 explain the BodyIK() and LegIK() function in detail and what is the orientation of X,Y,Z axis w.r.t the written code ?
Sorry I don’t know about the port to C by Daniel. I have done some ports to C (Arduino and to C libraries and Phoenix code that run on the Basic Atom Pros…).
The different lengths (Coxa, Femur, Tibia, Tar), are the lengths from the center of the servo to the center of the next servo or in the case of the last one, the tip of the foot.
There are a lot of ports of the original Phoenix code around these days. I lost track of them a while ago.
Because of that I can only give support on my original releases. All given information is based on the original software.
Good question, To get a better understanding I borrowed a image for the phoenix tutorial. This image shows the home position of the leg.
NOTE: The lengths of a body part must be described in lengths of X, Y (and Z). Lengths which don’t offer any extras are removed from the formula to simplify the formulas.
The length of the Tibia is measured between the joint and the tip. This describes the vertical (Y) offset in this setup. Since the Tibia is vertical we don’t need a horizontal (X) offset.
The length of the Femur is measured between the 2 joints. This describes the horizontal (X) offset for the Femur. No Y offset needed.
The length of the coxa must be described in lengths of X, Y (and Z). We only need the horizontal (X) length since this affects the position of the Femur joint. The correct length of the coxa is the horizontal length of the coxa. NOT diagonal. The Y length of the Coxa should only affect the center of rotation for the body which is not needed.
The coordinate frame probably is a bit different of what you expect. The code started out as a 2D IK solution of the leg. The coxa and body are added during the process. The coordinate frame never changed.
Meaning: if you look at the picture I used before, horizontal is X. Vertical is Z. If you apply this to the full hexapod and look at the body. X is moving sideways, Y is up and down, Z is forward and backward.
If you look at my code you see that the function has 4 arguments. The forth is a leg number referring to:
cRR con 0
cRM con 1
cRF con 2
cLR con 3
cLM con 4
cLF con 5
Thx Xan and Kurte! As of now I m working on forward kinematics using the denavit-hartenberg convention for a single Leg which has its fixed co-ordinate frame at the center of the body. Hopefully will get the IK solution using FK. I have studied some robotic manipulator’s FK and IK but never worked where we have 6 i.e for the hexapod. I m still a bit confused about how to rotate/translate w.r.t the fixed co-ordinate … i guess for this rotation matrix(FK) will be usefull … ?..