User Tools

Site Tools


robotic_manipulators_ik

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
robotic_manipulators_ik [2016/08/06 21:18] joaomatosrobotic_manipulators_ik [2016/10/23 20:14] (current) dwallace
Line 1: Line 1:
 ===== Inverse Kinematics Solver using Damped Least Squares Method ===== ===== Inverse Kinematics Solver using Damped Least Squares Method =====
 +
 +**Author:** Joao Matos Email: <[email protected]> <!-- replace with your email address -->
 +\\
 +**Date:** Last modified on 6/8/2016
 +\\
 +**Keywords:** Inverse Kinematics , Damped Least Squares, Serial Arm
 +\\
 +
 + This tutorial presents an algorithm to implement the Damped Least Squares method to calculate Inverse Kinematics problems.
 +
 +
 +
 +----
 +
  
  Between many algorithm to solve the Inverse Kinematics problem , the damped least squares method avoids many of the problems with the peusoinverse algorithm , and can give a good nummerical solution for the problem.The goal is to find the value of delta theta that minimizes the quantity:   Between many algorithm to solve the Inverse Kinematics problem , the damped least squares method avoids many of the problems with the peusoinverse algorithm , and can give a good nummerical solution for the problem.The goal is to find the value of delta theta that minimizes the quantity: 
Line 38: Line 52:
 ===== Pseudo Algorithm ===== ===== Pseudo Algorithm =====
  
- The algorithm to be programmed will follow this idea:+  * [[robotic_manipulators_ik_cpp|Inverse Kinematics Using Damped Least Squares method in Cpp]] 
 +    * Example of the method programmed in Cpp using Visual Studio and Eigen library 
 +  * [[robotic_manipulators_ik_matlab|Inverse Kinematics Using Damped Least Squares method in Matlab]]  
 +    * Example of the method programmed in Matlab and Simulated by RVC toolbox 
 + 
 + These two codes above were programmed using the same algorithm. The pseudo algorithm used is shown bellow.
  
   - Calculate A1,A2,A3,A4 and A5 given the initial position.   - Calculate A1,A2,A3,A4 and A5 given the initial position.
Line 72: Line 91:
  
  
-Running in Visual Studio ,C++ and Eigen library (library to deal with matrices).+Running in Visual Studio ,Cpp and Eigen library (library to deal with matrices).
 <Code> <Code>
  
Line 135: Line 154:
  Be careful here , the rotation matrix R , is from frame 0 to frame i-1 , but our homogeneous transformation matrices are from frame j-1 to frame j. For example , A1 is from frame 0 to frame 1 , A2 is from frame 1 to frame 2. But to find the Jacobian linear velocity we will need frame 0 to frame 2 , frame 0 to frame 3  , and so on... We can easily find this multiplying the transformation matrices. This way ,R(00) is the k vector itself ,  R(01) come from A1 , R(02) come from A1.A2 , R(03) come from A1.A2.A3 , R(04) come from A1.A2.A3.A4 .   Be careful here , the rotation matrix R , is from frame 0 to frame i-1 , but our homogeneous transformation matrices are from frame j-1 to frame j. For example , A1 is from frame 0 to frame 1 , A2 is from frame 1 to frame 2. But to find the Jacobian linear velocity we will need frame 0 to frame 2 , frame 0 to frame 3  , and so on... We can easily find this multiplying the transformation matrices. This way ,R(00) is the k vector itself ,  R(01) come from A1 , R(02) come from A1.A2 , R(03) come from A1.A2.A3 , R(04) come from A1.A2.A3.A4 . 
  
- Note here that the R matrix will multiply the "k" vector , (0,0,1) transposed , this way, the information we need is in the third column of the transformation matrix ( third column and first third rows, the last row does not contain any information , is just a neutral row ). **THIS IS SIGNED IN RED IN THE FIRST PICTURE OF THIS SECTION**+ Note here that the R matrix will multiply the "k" vector , (0,0,1) transposed , this way, the information we need is in the third column of the transformation matrix ( third column and first third rows, the last row does not contain any information , is just a neutral row ). **THIS IS SIGNED IN RED IN THE LAST PICTURE OF LAST SECTION**
  
  So, the next step of the IK code is to find the result from the homogeneous transformation matrices multiplication. Just create new matrices , for example:  So, the next step of the IK code is to find the result from the homogeneous transformation matrices multiplication. Just create new matrices , for example:
Line 189: Line 208:
  The end effector position can be found in the multiplication A1.A2.A3.A4.A5 . O(00) is 0 because is the distance from frame 0 to frame 0. 0(01)can be found in A1, O(02) can be found in A1.A2 , O(03) can be found in A1.A2.A3 , O(04) can be found in A1.A2.A3.A4.  The end effector position can be found in the multiplication A1.A2.A3.A4.A5 . O(00) is 0 because is the distance from frame 0 to frame 0. 0(01)can be found in A1, O(02) can be found in A1.A2 , O(03) can be found in A1.A2.A3 , O(04) can be found in A1.A2.A3.A4.
  
-  For example (is convenient to define a vector with the difference - the second term of the cross product ) to organize better the code:+ For example (is convenient to define a vector with the difference - the second term of the cross product ) to organize better the code:
      
  <Code>  <Code>
Line 381: Line 400:
 </Code> </Code>
  
-**RESUMING** :+ 
 +---- 
 + 
 +===== Applying the Damped Least Squares method =====
  
  Until now we calculated the Jacobian Matrix to be used in the equation from the damped least squares method. However , we still need to get the "e" vector that describes the displacement from the end effector position to the desired position. This is easily found because we can get the end effector position in the fourth column and first three rows of thetransformation matrix A1.A2.A3.A4.A5  Until now we calculated the Jacobian Matrix to be used in the equation from the damped least squares method. However , we still need to get the "e" vector that describes the displacement from the end effector position to the desired position. This is easily found because we can get the end effector position in the fourth column and first three rows of thetransformation matrix A1.A2.A3.A4.A5
robotic_manipulators_ik.1470543507.txt.gz · Last modified: 2016/08/06 21:18 by joaomatos