#!/usr/bin/env python from barobo import Linkbot, Dongle import time import sys if __name__ == "__main__": if len(sys.argv) < 2: print ("Usage: {0} [Linkbot Serial ID]".format(sys.argv[0])) quit() serialID = sys.argv[2] dongle = Dongle() dongle.connect() linkbot = dongle.getLinkbot(serialID) print (linkbot.getSerialID())
from barobo import Linkbot, Dongle import time import sys if sys.version_info[0] == 3: raw_input = input if __name__ == "__main__": if len(sys.argv) < 2: print ("Usage: {0} <Com_Port> [Linkbot Serial ID]".format(sys.argv[0])) quit() if len(sys.argv) == 3: serialID = sys.argv[2] else: serialID = None dongle = Dongle() dongle.connectDongleTTY(sys.argv[1]) linkbot = dongle.getLinkbot(serialID) print (linkbot) print (linkbot.getVersion()) linkbot.recordAnglesBegin() s = raw_input('Press enter to continue...') linkbot.recordAnglesEnd() linkbot.recordAnglesPlot() for i in range(1,4): linkbot.setJointSpeed(i, 120) linkbot.moveToNB(360, 0, -360) linkbot.moveWait() linkbot.moveToNB(0, 0, 0) linkbot.moveWait()
#!/usr/bin/env python from barobo import Linkbot, Dongle import time import sys if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: {0} [Linkbot Serial ID]".format(sys.argv[0])) quit() serialID = sys.argv[1] dongle = Dongle() dongle.connect() linkbot = dongle.getLinkbot(serialID) linkbot.resetToZero() print("Moving all joints 90 degrees...") linkbot.move(90, 90, 90)
#!/usr/bin/env python from barobo import Linkbot, Dongle import time import sys if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: {0} <Com_Port> [Linkbot Serial ID]".format(sys.argv[0])) quit() if len(sys.argv) == 3: serialID = sys.argv[2] else: serialID = None dongle = Dongle() dongle.connectBaroboLink() linkbot = dongle.getLinkbot(serialID) linkbot.resetToZero() print("Moving joints to 90 degrees...") linkbot.driveTo(90, 90, 90) time.sleep(1) print("Moving joints to 0 degrees...") linkbot.driveTo(0, 0, 0)
#!/usr/bin/env python from barobo import Linkbot, Dongle import time import sys if __name__ == "__main__": if len(sys.argv) < 2: print ("Usage: {0} <Com_Port> [Linkbot Serial ID]".format(sys.argv[0])) quit() if len(sys.argv) == 3: serialID = sys.argv[2] else: serialID = None dongle = Dongle() dongle.connectBaroboLink() linkbot = dongle.getLinkbot(serialID) linkbot.resetToZero() print ("Moving joints to 90 degrees...") linkbot.driveTo(90, 90, 90) time.sleep(1) print ("Moving joints to 0 degrees...") linkbot.driveTo(0, 0, 0)
#!/usr/bin/env python from barobo import Linkbot, Dongle import time import sys if __name__ == "__main__": if len(sys.argv) < 2: print ("Usage: {0} <Com_Port> [Linkbot Serial ID]".format(sys.argv[0])) quit() if len(sys.argv) == 2: serialID = sys.argv[1] dongle = Dongle() dongle.connectBaroboBrowser() linkbot = dongle.getLinkbot(serialID) linkbot.resetToZero() print ("Moving joints to 90 degrees...") linkbot.driveTo(90, 90, 90) time.sleep(1) print ("Moving joints to 0 degrees...") linkbot.driveTo(0, 0, 0)
def goto(self, x, y): global_phi = math.atan2(y - self.y, x - self.x) d_phi = global_phi - self.theta self.turn(rad2deg(d_phi)) d = math.sqrt((y - self.y)**2 + (x - self.x)**2) self.moveDistance(d) def func(x): return 0.5 * x**2 if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: {0} [Linkbot Serial ID]".format(sys.argv[0])) quit() serialID = sys.argv[1] dongle = Dongle() dongle.connect() linkbot = dongle.getLinkbot(serialID, linkbotClass=ParaLinkbot) linkbot.init() i = -5 linkbot.goto(i, func(i)) linkbot.moveWait() print('Start!') while i < 5: linkbot.goto(i, func(i)) i += 0.1 time.sleep(0.1)
global_phi = math.atan2(y-self.y, x-self.x) d_phi = global_phi - self.theta self.turn(rad2deg(d_phi)) d = math.sqrt( (y-self.y)**2 + (x-self.x)**2) self.moveDistance(d) def func(x): return 0.5*x**2 if __name__ == "__main__": if len(sys.argv) < 2: print ("Usage: {0} <Com_Port> [Linkbot Serial ID]".format(sys.argv[0])) quit() if len(sys.argv) == 3: serialID = sys.argv[2] else: serialID = None dongle = Dongle() dongle.connectDongleTTY(sys.argv[1]) linkbot = dongle.getLinkbot(serialID, linkbotClass=ParaLinkbot) linkbot.init() i = -5 linkbot.goto(i, func(i)) linkbot.moveWait() print('Start!') while i < 5: linkbot.goto(i, func(i)) i += 0.1 time.sleep(0.1)
self.y += dy def goto(self, x, y): global_phi = math.atan2(y-self.y, x-self.x) d_phi = global_phi - self.theta self.turn(rad2deg(d_phi)) d = math.sqrt( (y-self.y)**2 + (x-self.x)**2) self.moveDistance(d) def func(x): return 0.5*x**2 if __name__ == "__main__": if len(sys.argv) < 2: print ("Usage: {0} [Linkbot Serial ID]".format(sys.argv[0])) quit() serialID = sys.argv[1] dongle = Dongle() dongle.connect() linkbot = dongle.getLinkbot(serialID, linkbotClass=ParaLinkbot) linkbot.init() i = -5 linkbot.goto(i, func(i)) linkbot.moveWait() print('Start!') while i < 5: linkbot.goto(i, func(i)) i += 0.1 time.sleep(0.1)