Source

puma / PumaIK.py

Diff from to

File PumaIK.py

 		# approach angle.
 		j6 = self.joints[5]
 		d6 = j6.d
-		new_xyz = xyz
+		new_xyz = list(xyz)
 		new_xyz[0] -= d6 * a[0]
 		new_xyz[1] -= d6 * a[1]
 		new_xyz[2] -= d6 * a[2]
-		print "new xyz: " + str(new_xyz)
+		print "new xyz: " + ",".join([str(int(x)) for x in new_xyz])
 
 		self.major(new_xyz)
 		self.wrist(a, s, n)
 		sys.exit(0)
 
 	pos = [int(x) for x in sys.argv[1:]]
-	a = [0, 1, 0]
-	s = [1, 0, 0]
-	n = [0, 0, 1]
+	#a = [0, 1, 0]
+	#s = [-1, 0, 0]
+	#n = [0, 0, -1]
+	a = [0.03, 0.99, -0.13]
+	s = [-0.93, -0.02, -0.38]
+	n = [0.38, -0.13, -0.91]
 	r.ik(pos, a, s, n)
 	print " ".join([str(int(x*180/pi)) for x in r.theta])
 	print " ".join([str(x) for x in r.get_counts()])