|
|
|
@ -30,6 +30,7 @@ class Candybot:
|
|
|
|
|
|
|
|
|
|
self.linearspeed = 100
|
|
|
|
|
self.lastleinearspeed = 100
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
CON_STR = {
|
|
|
|
|
dType.DobotConnect.DobotConnect_NoError: "DobotConnect_NoError",
|
|
|
|
@ -136,7 +137,7 @@ class Candybot:
|
|
|
|
|
|
|
|
|
|
def letgo(self):
|
|
|
|
|
print("drops\n")
|
|
|
|
|
dType.SetEndEffectorGripper(self.api, 1, 0, isQueued=0)
|
|
|
|
|
#dType.SetEndEffectorGripper(self.api, 1, 0, isQueued=0)
|
|
|
|
|
|
|
|
|
|
def stop(self):
|
|
|
|
|
print("stops\n")
|
|
|
|
@ -168,17 +169,18 @@ class Candybot:
|
|
|
|
|
def setparams(self, name, speed):
|
|
|
|
|
lookup = {'base' : 0, 'reararm' : 1, 'forearm' : 2, 'gripperroation' :3}
|
|
|
|
|
if name == 'rail':
|
|
|
|
|
print("Change speed rail %d\n", speed)
|
|
|
|
|
print("Change speed rail " + str(speed) +"\n" )
|
|
|
|
|
#dType.SetJOGLParams(self.api, speed, 200, isQueued=0)
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
speeds = [0,0,0,0]
|
|
|
|
|
speeds[lookup[name]] = speed
|
|
|
|
|
print("change speed" + name + "%d\n",speed)
|
|
|
|
|
print("change speed " + name + str(speed))
|
|
|
|
|
#dType.SetJOGJointParams(self.api, speeds[0], 200, speeds[1], 200, speeds[2], 200, speeds[3], 200, isQueued = 1)
|
|
|
|
|
|
|
|
|
|
def setJOGcmd(self, cmd):
|
|
|
|
|
dType.SetJOGCmd(self.api,1,cmd)
|
|
|
|
|
print("Joint "+ str(cmd) + "is moving \n")
|
|
|
|
|
#dType.SetJOGCmd(self.api,1,cmd)
|
|
|
|
|
|
|
|
|
|
candy = Candybot()
|
|
|
|
|
|
|
|
|
@ -269,55 +271,18 @@ def ll():
|
|
|
|
|
|
|
|
|
|
updateLoop()
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
#c = Candybot()
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#def slide_left():
|
|
|
|
|
# c.linear(-1)
|
|
|
|
|
#
|
|
|
|
|
#def slide_right():
|
|
|
|
|
# c.linear(1)
|
|
|
|
|
#
|
|
|
|
|
#def rotate_left():
|
|
|
|
|
# c.base(-1)
|
|
|
|
|
#
|
|
|
|
|
#def rotate_right():
|
|
|
|
|
# c.base(1)
|
|
|
|
|
#
|
|
|
|
|
#def forward():
|
|
|
|
|
# c.forearm(1)
|
|
|
|
|
#
|
|
|
|
|
#def back():
|
|
|
|
|
# c.forearm(-1)
|
|
|
|
|
#
|
|
|
|
|
#def up():
|
|
|
|
|
# c.rearArm(1)
|
|
|
|
|
#
|
|
|
|
|
#def down():
|
|
|
|
|
# c.rearArm(-1)
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
def stopCmp():
|
|
|
|
|
candy.stopcmp()
|
|
|
|
|
|
|
|
|
|
def grab():
|
|
|
|
|
candy.gripp()
|
|
|
|
|
# c.stopcmp()
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
def drop():
|
|
|
|
|
candy.letgo()
|
|
|
|
|
# c.stopcmp()
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
def stop():
|
|
|
|
|
candy.panic()
|
|
|
|
|
#
|
|
|
|
|
#def getCurrentCmd():
|
|
|
|
|
# return c.getCurrentCmd()
|
|
|
|
|
#
|
|
|
|
|
#def updateLinearSpeed():
|
|
|
|
|
# pass
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|