Source

puma / Puma.py

Diff from to

File Puma.py

 			time.sleep(dt * 0.4)
 		self.last_xyz = xyz[:]
 
+	def adjust(self,axis,delta_theta):
+		new_theta = self.joints[axis].theta + delta_theta * pi / 180.0
+		print "axis " + str(axis) + ": " + str(round(new_theta,2)) + "=" + str(round(self.joints[axis].theta,2)) + " + " + str(round(delta_theta,2))
+		self.joints[axis].theta = new_theta
 
 if __name__ == "__main__":
 	import PumaConfig
 				vel = 1
 			continue
 
+		g = re.match("^adjust ([1-6]+) (-?[0-9.]+)", line)
+		if g is not None:
+			r.adjust(int(g.group(1))-1, float(g.group(2)))
+			continue
+
 		g = re.match("^(-?[0-9]+ -?[0-9]+ -?[0-9]+)$", line)
 		if g is not None:
 			xyz = [int(x) for x in g.group(1).split(" ")]