예제 #1
0
def run():
    m = motor.MotorManager()
    m.set_command_mode(motor.ModeDesired.Position)
    t = time.localtime()
    pos = (t[0] + t[1] / 60.0 + t[2] / 3600.0) * 2 * math.pi / 12
    m.set_command_position([pos])
    m.write_saved_commands()
    time.sleep(1)
    m.set_command_mode(motor.ModeDesired.Velocity)
    m.set_command_velocity([2 * math.pi / (24 * 3600.0)])
    m.write_saved_commands()
예제 #2
0
 def setUpClass(cls):
     cls.m = motor.MotorManager()
     if (path):
         cls.m.get_motors_by_path([path])
     cls.m.set_auto_count()
     cls.f = open("output.txt", "a+")
예제 #3
0
#!/usr/bin/env python3

import motor

m = motor.MotorManager()
motors = m.get_connected_motors()
print(m)
print([m.name() for m in motors])
m

m.set_auto_count()
m.write_saved_commands()
print(m.commands())
s = m.read()[0]
print(s.host_timestamp_received)
m.write([])
예제 #4
0
 def __init__(self):
     self.m = motor.MotorManager()
     # actuator is set to time out to damped mode unless it receives periodic
     # commands with different host timestamp. Auto count helps with this
     self.m.set_auto_count()
     self.set_hold_mode()