|
|
|
@ -30,7 +30,6 @@ class Candybot:
|
|
|
|
|
|
|
|
|
|
self.linearspeed = 100
|
|
|
|
|
self.lastleinearspeed = 100
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
CON_STR = {
|
|
|
|
|
dType.DobotConnect.DobotConnect_NoError: "DobotConnect_NoError",
|
|
|
|
@ -137,7 +136,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")
|
|
|
|
@ -169,18 +168,17 @@ class Candybot:
|
|
|
|
|
def setparams(self, name, speed):
|
|
|
|
|
lookup = {'base' : 0, 'reararm' : 1, 'forearm' : 2, 'gripperroation' :3}
|
|
|
|
|
if name == 'rail':
|
|
|
|
|
print("Change speed rail " + str(speed) +"\n" )
|
|
|
|
|
print("Change speed rail %d\n", speed)
|
|
|
|
|
#dType.SetJOGLParams(self.api, speed, 200, isQueued=0)
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
speeds = [0,0,0,0]
|
|
|
|
|
speeds[lookup[name]] = speed
|
|
|
|
|
print("change speed " + name + str(speed))
|
|
|
|
|
print("change speed" + name + "%d\n",speed)
|
|
|
|
|
#dType.SetJOGJointParams(self.api, speeds[0], 200, speeds[1], 200, speeds[2], 200, speeds[3], 200, isQueued = 1)
|
|
|
|
|
|
|
|
|
|
def setJOGcmd(self, cmd):
|
|
|
|
|
print("Joint "+ str(cmd) + "is moving \n")
|
|
|
|
|
#dType.SetJOGCmd(self.api,1,cmd)
|
|
|
|
|
dType.SetJOGCmd(self.api,1,cmd)
|
|
|
|
|
|
|
|
|
|
candy = Candybot()
|
|
|
|
|
|
|
|
|
@ -257,37 +255,69 @@ def rt():
|
|
|
|
|
def lt():
|
|
|
|
|
adjustSpeed(1, -5)
|
|
|
|
|
|
|
|
|
|
def fw():
|
|
|
|
|
adjustSpeed(2, 5)
|
|
|
|
|
|
|
|
|
|
def bc():
|
|
|
|
|
adjustSpeed(2, -5)
|
|
|
|
|
|
|
|
|
|
def up():
|
|
|
|
|
adjustSpeed(3, 5)
|
|
|
|
|
adjustSpeed(2, 5)
|
|
|
|
|
|
|
|
|
|
def dn():
|
|
|
|
|
adjustSpeed(3, -5)
|
|
|
|
|
adjustSpeed(2, -5)
|
|
|
|
|
|
|
|
|
|
def lr():
|
|
|
|
|
adjustSpeed(4, 10)
|
|
|
|
|
|
|
|
|
|
def ll():
|
|
|
|
|
adjustSpeed(4, -10)
|
|
|
|
|
updateLoop()
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|