Compare commits
3
Commits
dd289bbb16
...
9ee108ee57
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ee108ee57 | ||
|
|
78edcbd44b | ||
|
|
da0d5556a8 |
+8
-2
@@ -249,12 +249,18 @@ def rt():
|
||||
def lt():
|
||||
adjustSpeed(1, -5)
|
||||
|
||||
def up():
|
||||
def fw():
|
||||
adjustSpeed(2, 5)
|
||||
|
||||
def dn():
|
||||
def bc():
|
||||
adjustSpeed(2, -5)
|
||||
|
||||
def up():
|
||||
adjustSpeed(3, 5)
|
||||
|
||||
def dn():
|
||||
adjustSpeed(3, -5)
|
||||
|
||||
def lr():
|
||||
adjustSpeed(4, 10)
|
||||
|
||||
|
||||
+16
-46
@@ -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()
|
||||
|
||||
@@ -255,69 +257,37 @@ def rt():
|
||||
def lt():
|
||||
adjustSpeed(1, -5)
|
||||
|
||||
def up():
|
||||
def fw():
|
||||
adjustSpeed(2, 5)
|
||||
|
||||
def dn():
|
||||
def bc():
|
||||
adjustSpeed(2, -5)
|
||||
|
||||
def up():
|
||||
adjustSpeed(3, 5)
|
||||
|
||||
def dn():
|
||||
adjustSpeed(3, -5)
|
||||
|
||||
def lr():
|
||||
adjustSpeed(4, 10)
|
||||
|
||||
def ll():
|
||||
adjustSpeed(4, -10)
|
||||
|
||||
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
|
||||
#
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user