Inverse kinematics is similar to forward kinematics in that we want to describe the position and orientation of the end effector in 3D space.
-However with inverse kinematics, we have the end effector's position and orientation, but not the specific joint angles of the robot require to achieve them.
+However with inverse kinematics, we have the end effector's position and orientation, but not the specific joint angles of the robot required to achieve them.
Identifying the correct joint angles is a difficult problem, and often times there is either no solution or an infinite amount of solutions.
In my approach to inverse kinematics we will address finding the most simple first solution returned by my algorithm.
We will assume that there are 6 unknowns (the six joint variables), and 6 knowns (position x,y, and z, and orientation in Euler ZYZ rotation form)
@@ -260,7 +260,7 @@
Inverse Kinematics
Then it breaks the frame into a position vector and 3 ZYZ euler angles. We start the inverse operation with joint 1.
Joint 1 is found by using the law of cosines between the position of the base and the point of joint 5. The point of
joint 5 is found first by assuming the orignal orientation of the given Homogenous frame has the same orientation of the
- frame and frame 6. With this assumption the position at frame 6 is just d6 back in the orientation of the given frame.
+ frame at frame 6. With this assumption the position at frame 6 is just the norm of d6 vector subtracted in the orientation of the given end effector frame.
With joint 1 obtained we can find joints 2 and 3 using the law of cosines in a similar manner to the position of frame 6 at joint 5.
There are many conditions to observe in order to ensure our calculations with acos or atan2 return the angle in the correct
quadrant. See the code for these conditions.
@@ -283,11 +283,11 @@
Inverse Kinematics
methodology.
With the IK algorithm efficiently applied, I performed unit testing on my IK and FK functions to make sure they worked for all cases.
- I developed some constraints based on real world physics. Unit tests would be performed on randomly generated sets joint angles. These joint
- angles would be within the range of acceptable range of joint angles for each joint. Then those joint angles would be fed to the FK_Revyn function
+ I developed some constraints based on real world physics. Unit tests would be performed on randomly generated sets of joint angles. These joint
+ angles would be within the acceptable range of joint angles for each joint. Then those joint angles would be fed to the FK_Revyn function
and the position of the resulting frame would be tested to ensure it's within range of the robot. Then with the output frame of FK_Revyn, we feed the frame back
- to the IK_Revyn function. If the output joints return the same set of joints or (if elbow up compenstated) another regenerated frame using FK_Revyn has the orientation and position
- as the other genearated frame, then the case was a success. In testing, 100,000 different random joint values were tested within the possible range.
+ to the IK_Revyn function. If the output joint angles return the same set of joint angles we started with or (if elbow up compenstated) another regenerated frame using FK_Revyn has the orientation and position
+ as the other genearated frame, then the case was a success. In testing, 100,000 different random sets of joint values were tested within the possible range.
All 100,000 were successful at returning possible joint angles to achieve the frame. The positions of the tested frames generated the spherical shape seen in figure 3.