示例#1
0
from agility.maestro import Maestro
from agility.main import Stepper

stepper = Stepper(0, 1, 200)
maestro = Maestro()
maestro.rotate(stepper, -360, 2000)
示例#2
0
from agility.pololu.usc import Usc
from agility.pololu.reader import BytecodeReader
from agility.maestro import Maestro
from agility.main import Servo
from finesse.eclipse import Finesse
import math, time

###########################
# Front right leg only!
# Currently the white one.
###########################

# usc = Usc()
maestro = Maestro()

# Define servos.
servo4 = Servo(3, -90, 180, 500, 2500, 150, bias=10, direction=-1)
servo5 = Servo(4, -225, 45, 500, 2500, 150, bias=5, direction=1)
servo6 = Servo(5, -135, 135, 500, 2500, 150, bias=10, direction=1)
servos = [servo4, servo5, servo6]

# Configure velocity.
maestro.set_speed(servo4, servo4.max_vel)
maestro.set_speed(servo5, servo5.max_vel)
maestro.set_speed(servo6, servo6.max_vel)

# Go home.
def goHome():
    for servo in servos:
        servo.set_target(0)
        maestro.set_target(servo)
示例#3
0
from agility.maestro import Maestro
from agility.main import Servo
from finesse.eclipse import Finesse
import math, time, sys
import collections
import numpy as np
from itertools import chain

#############################
# This test will save us all.
#############################

maestro = Maestro()

# Leg 1 servos.
servo1 = Servo(0, -180, 90, 500, 2500, 150, bias=-13, direction=1)
servo2 = Servo(1, -45, 225, 500, 2500, 150, bias=0, direction=1)
servo3 = Servo(2, -135, 135, 500, 2500, 150, bias=0, direction=-1)
leg1 = [servo1, servo2, servo3]

# Leg 2 servos.
servo4 = Servo(3, -90, 180, 500, 2500, 150, bias=10, direction=-1)
servo5 = Servo(4, -225, 45, 500, 2500, 150, bias=0, direction=1)
servo6 = Servo(5, -135, 135, 500, 2500, 150, bias=10, direction=1)
leg2 = [servo4, servo5, servo6]

# Leg 3 servos.
servo7 = Servo(6, -90, 180, 500, 2500, 150, bias=-10, direction=1)
servo8 = Servo(7, -45, 225, 500, 2500, 150, bias=2, direction=1)
servo9 = Servo(8, -135, 135, 500, 2500, 150, bias=0, direction=-1)
leg3 = [servo7, servo8, servo9]