Beispiel #1
0
def initCtrl():
	min_id, max_id = 0, 20
	ctrl = dyn.create_controller(verbose=True, motor_range=[min_id, max_id], timeout=0.05)
	for motor in ctrl.motors:
		motor.max_torque = 50
	sys.stdout.flush()
	return ctrl
Beispiel #2
0
def init_ctrl():
	"""motors initialisation"""
	if len(sys.argv) == 2:
		min_id, max_id = int(sys.argv[0]), int(sys.argv[1])
	else:
		min_id, max_id = 0, 26

	ctrl = dyn.create_controller(verbose = True, motor_range = [min_id, max_id])
	sys.stdout.flush()
	return ctrl
Beispiel #3
0
import env # only to debug local (not installed) pydyn version

import sys

import pydyn
import pydyn.dynamixel as dyn

mode = sys.argv[1] if len(sys.argv) == 2 else None


if mode == 'deep':
    for bps in [1000000, 500000, 400000, 250000, 200000, 115200, 57600, 19200, 9600]:
        ctrl = dyn.create_controller(verbose=True, motor_range=[0, 253],
                                     timeout=50, baudrate=bps, start=False)
        ctrl.close()
else:
    ctrl = dyn.create_controller(verbose=True, motor_range=[0, 253], timeout=50, start=False)
    ctrl.close()
Beispiel #4
0
                           motor_id[6], motor_id[7], motor_id[8]))
                    print("\t\t  |_____________|")
                    print("\t\t\t %d" % motor_id[9])
                    print("\t\t\t %d" % motor_id[10])
                    print("\t\t\t %d" % motor_id[11])

            elif line == "quit" or line == "":
                pass
            else:
                print("Unknown command")


if __name__ == "__main__":
    spider = None
    ctrl = dyn.create_controller(verbose=False,
                                 timeout=0.5,
                                 motor_range=[0, 20])
    spider = Spider(configLegs(ctrl.motors, simulator=False))

    gamepadThread = GamepadHandler(spider)
    gamepadThread.daemon = True
    gamepadThread.start()

    terminalThread = TerminalThread(spider)
    terminalThread.daemon = True
    terminalThread.start()

    while True:
        time.sleep(1.0)
        spider.move(startNow=False)
Beispiel #5
0
import debugenv  # only to debug local (not installed) pydyn version

import sys, time
import pydyn.dynamixel as dyn

ctrl = dyn.create_controller(verbose=True, motor_range=[11, 16], full_ram=True)

time.sleep(3.0)
print 'FPS (last 2s): {}'.format(ctrl.fps)
Beispiel #6
0
import debugenv  # only to debug local (not installed) pydyn version

import pydyn
import pydyn.dynamixel as dyn

pydyn.enable_vrep()
ctrl = dyn.create_controller(ip="127.0.0.1", motor_range=[0, 10], verbose=True)
Beispiel #7
0
import os, sys
sys.path.insert(0, (os.path.join(os.getcwd(), '..')))

import pydyn.dynamixel as dyn

ctrl = dyn.create_controller(verbose=True,
                             motor_range=(1, 50),
                             timeout=20,
                             enable_pyftdi=True)
print ctrl.motors[0].mmem._memory_data
Beispiel #8
0
Datei: fps.py Projekt: humm/pydyn
import debugenv # only to debug local (not installed) pydyn version

import sys, time
import pydyn.dynamixel as dyn

ctrl = dyn.create_controller(verbose = True, motor_range = [11, 16], full_ram = True)

time.sleep(3.0)
print 'FPS (last 2s): {}'.format(ctrl.fps)
Beispiel #9
0
import env # only to debug local (not installed) pydyn version

import pydyn
import pydyn.dynamixel as dyn

ctrl = dyn.create_controller(verbose = True, motor_range = [0, 253], start = False)

for m in ctrl.motors:
    print m.ram_desc()
Beispiel #10
0
import env  # only to debug local (not installed) pydyn version

import pydyn
import pydyn.dynamixel as dyn

ctrl = dyn.create_controller(verbose=True, motor_range=[0, 253], start=False)

for m in ctrl.motors:
    print m.eeprom_desc()
Beispiel #11
0
import env  # only to debug local (not installed) pydyn version

import sys, time
import pydyn.dynamixel as dyn

if len(sys.argv) == 2:
    min_id, max_id = int(sys.argv[1]), int(sys.argv[1])
else:
    min_id, max_id = 0, 253

ctrl = dyn.create_controller(verbose=True, motor_range=[min_id, max_id])

print '\nMaking motor compliant... ',
sys.stdout.flush()

for m in ctrl.motors:
    m.compliant = True
    m.torque_limit = 0.0

ctrl.wait(2)
print 'done'

for m in ctrl.motors:
    print "{} compliant : {}".format(m, m.compliant)
Beispiel #12
0
import debugenv  # only to debug local (not installed) pydyn version

import pydyn
import pydyn.dynamixel as dyn

pydyn.enable_vrep()
ctrl = dyn.create_controller(ip='127.0.0.1', motor_range=[0, 10], verbose=True)
Beispiel #13
0
import os, sys
sys.path.insert(0, (os.path.join(os.getcwd(), '..')))

import pydyn.dynamixel as dyn

ctrl = dyn.create_controller(verbose = True, motor_range=(1, 50), timeout=20, enable_pyftdi=True)
print ctrl.motors[0].mmem._memory_data
Beispiel #14
0
import env  # only to debug local (not installed) pydyn version

import sys, time
import pydyn.dynamixel as dyn

if len(sys.argv) == 2:
    min_id, max_id = int(sys.argv[1]), int(sys.argv[1])
else:
    min_id, max_id = 0, 253

ctrl = dyn.create_controller(verbose=True, motor_range=[min_id, max_id])

print "\nMaking motor compliant... ",
sys.stdout.flush()

for m in ctrl.motors:
    m.compliant = True
    m.torque_limit = 0.0

ctrl.wait(2)
print "done"

for m in ctrl.motors:
    print "{} compliant : {}".format(m, m.compliant)
Beispiel #15
0
import env  # only to debug local (not installed) pydyn version

import sys

import pydyn
import pydyn.dynamixel as dyn

mode = sys.argv[1] if len(sys.argv) == 2 else None

if mode == 'deep':
    for bps in [
            1000000, 500000, 400000, 250000, 200000, 115200, 57600, 19200, 9600
    ]:
        ctrl = dyn.create_controller(verbose=True,
                                     motor_range=[0, 253],
                                     timeout=50,
                                     baudrate=bps,
                                     start=False)
        ctrl.close()
else:
    ctrl = dyn.create_controller(verbose=True,
                                 motor_range=[0, 253],
                                 timeout=50,
                                 start=False)
    ctrl.close()