master
adligeerik 6 years ago
parent 06e405c86c
commit da0d5556a8

@ -30,6 +30,7 @@ class Candybot:
self.linearspeed = 100 self.linearspeed = 100
self.lastleinearspeed = 100 self.lastleinearspeed = 100
return
CON_STR = { CON_STR = {
dType.DobotConnect.DobotConnect_NoError: "DobotConnect_NoError", dType.DobotConnect.DobotConnect_NoError: "DobotConnect_NoError",
@ -136,7 +137,7 @@ class Candybot:
def letgo(self): def letgo(self):
print("drops\n") print("drops\n")
dType.SetEndEffectorGripper(self.api, 1, 0, isQueued=0) #dType.SetEndEffectorGripper(self.api, 1, 0, isQueued=0)
def stop(self): def stop(self):
print("stops\n") print("stops\n")
@ -168,17 +169,18 @@ class Candybot:
def setparams(self, name, speed): def setparams(self, name, speed):
lookup = {'base' : 0, 'reararm' : 1, 'forearm' : 2, 'gripperroation' :3} lookup = {'base' : 0, 'reararm' : 1, 'forearm' : 2, 'gripperroation' :3}
if name == 'rail': 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) #dType.SetJOGLParams(self.api, speed, 200, isQueued=0)
else: else:
speeds = [0,0,0,0] speeds = [0,0,0,0]
speeds[lookup[name]] = speed 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) #dType.SetJOGJointParams(self.api, speeds[0], 200, speeds[1], 200, speeds[2], 200, speeds[3], 200, isQueued = 1)
def setJOGcmd(self, cmd): 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() candy = Candybot()
@ -269,55 +271,18 @@ def ll():
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(): def stopCmp():
candy.stopcmp() candy.stopcmp()
def grab(): def grab():
candy.gripp() candy.gripp()
# c.stopcmp()
#
def drop(): def drop():
candy.letgo() candy.letgo()
# c.stopcmp()
#
def stop(): def stop():
candy.panic() candy.panic()
#
#def getCurrentCmd():
# return c.getCurrentCmd()
#
#def updateLinearSpeed():
# pass
#

Loading…
Cancel
Save