Mercurial > circuitpython-spiderwing
diff python/robot.py @ 3:8ed8f30b0568 draft
Update gaits
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Sun, 23 Jul 2017 20:23:29 +0200 |
| parents | cf2cd5a35d24 |
| children |
line wrap: on
line diff
--- a/python/robot.py Mon May 15 20:01:55 2017 +0200 +++ b/python/robot.py Sun Jul 23 20:23:29 2017 +0200 @@ -25,10 +25,10 @@ class Leg: # Lengths of leg segments, in mm - coxa = 36 # between the hip and the knee - femur = 39 # between the knee and the ankle - tibia = 55 # between the ankle and the foot - base = 21 # from the center of body + coxa = 12.3 # between the hip and the knee + femur = 39.0 # between the knee and the ankle + tibia = 55.0 # between the ankle and the foot + base = 21.0 # from the center of body def __init__(self, joints, direction, servos): self.servos = servos @@ -40,8 +40,8 @@ self.z = 0 def move_to(self, x, y, z): - print("Moving leg %d, %d to %d, %d, %d" % (self.x_dir, self.y_dir, - x, y, z)) + print("Moving leg %d, %d to %d, %d, %d" % + (self.x_dir, self.y_dir, x, y, z)) x += self.home y += self.home z -= self.tibia
