Advertisement
Guest User

Untitled

a guest
May 27th, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Note it is alpha_i , NOT alpha_i-1 as well as a here in table so first two columns are offset not like in conventional dh table from the textbook. Just mind the indexes.
  2.  
  3. i alpha i a d theta i
  4. 0 [sympy.rad(180), 0.0, 0, 0],
  5. 1 [sympy.rad(90), -0.033, -0.147, self.th1],
  6. 2 [0, 0.155, 0, self.th2],
  7. 3 [0, 0.135, 0, self.th3],
  8. 4 [sympy.rad(-90), 0.1136, 0, self.th4],
  9. 5 [self.th5, 0.1045, 0, 0],
  10. [0, 0, 0, 0] # the last line used for don't remember which sympy reasons
  11.  
  12.  
  13. #The mapping of DH to arm thetas and back (in degrees!) is following:
  14.  
  15. def dh_thetas_to_arm_thetas(self, dh_vals):
  16. offsets = [169, -25, -151, 102.5, 0]
  17. scales = [1, -1, -1, -1, 1]
  18. return [dh_vals[i]*scales[i]+offsets[i] for i in range(len(dh_vals))]
  19.  
  20.  
  21. def arm_thetas_to_dh_thetas(self, arm_vals):
  22. offsets = [169, -25, -151, 102.5, 0]
  23. scales = [1, -1, -1, -1, 1]
  24. return [(arm_vals[i]-offsets[i])/scales[i] for i in range(len(arm_vals))]
  25.  
  26.  
  27. # The control values should be switched to radians then!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement