本文整理汇总了Python中barobo.Dongle.getLinkbot方法的典型用法代码示例。如果您正苦于以下问题:Python Dongle.getLinkbot方法的具体用法?Python Dongle.getLinkbot怎么用?Python Dongle.getLinkbot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类barobo.Dongle
的用法示例。
在下文中一共展示了Dongle.getLinkbot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from barobo import Dongle [as 别名]
# 或者: from barobo.Dongle import getLinkbot [as 别名]
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()
示例2: func
# 需要导入模块: from barobo import Dongle [as 别名]
# 或者: from barobo.Dongle import getLinkbot [as 别名]
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)