toplevel added

master
adligeerik 6 years ago
parent eafbee72ce
commit c4fd668de7

@ -184,13 +184,13 @@ currentMotor = 0
motorcfg = [0] * 10
motorcfg[1] = {"name" : 'base' , "positive":1, "negative":2, 'speedslot':2}
motorcfg[2] = {"name" : 'reararm' ,"positive":3, "negative":4, 'speedslot':4}
motorcfg[3] = {"name" : 'base' ,"positive":5, "negative":6, 'speedslot':6}
motorcfg[3] = {"name" : 'forearm' ,"positive":5, "negative":6, 'speedslot':6}
friction = 0.99
movement_time = 5
max_movement_time = 10
friction = 0.95
movement_time = 3
max_movement_time = 5
min_speed = 1
max_speed = 50
max_speed = 100
speed = 0
stopTime = 0
@ -224,7 +224,7 @@ def stopMotorFunctions():
def updateLoop():
global nowTime, stopTime, currentMotor, speed, friction, min_speed, motorcfg
nowTime = (time.time() - startTime)
threading.Timer(0.2, updateLoop).start()
threading.Timer(1, updateLoop).start()
if currentMotor != 0:
if nowTime > stopTime:
@ -235,7 +235,7 @@ def updateLoop():
if abs(speed) < min_speed:
stopMotorFunctions()
return
candy.setparams(motorcfg[currentMotor]['name'], abs(speed)))
candy.setparams(motorcfg[currentMotor]['name'], abs(speed))
#print("JOG parameter {} to {}".format( motorcfg[currentMotor]['speedslot'], abs(speed)) )
@ -281,16 +281,20 @@ updateLoop()
#def down():
# c.rearArm(-1)
#
#def grab():
# c.gripp()
def stopCmp():
candy.stopcmp()
def grab():
candy.gripp()
# c.stopcmp()
#
#def drop():
# c.letgo()
def drop():
candy.letgo()
# c.stopcmp()
#
#def stop():
# c.panic()
def stop():
candy.panic()
#
#def getCurrentCmd():
# return c.getCurrentCmd()

Loading…
Cancel
Save