我有以下脚本:
#!/usr/bin/env python
import nxt.locator
from nxt.motor import *
def spin_around(b):
m_left = Motor(b, PORT_B)
m_left.turn(100, 360)
m_right = Motor(b, PORT_C)
m_right.turn(-100, 360)
print("Script Starting")
b = nxt.locator.find_one_brick()
spin_around(b)我已经安装了pyUSB和libUSB。我使用python spin.py运行该脚本
然而,当我运行脚本时,我得到了以下异常:
Script Starting
Traceback (most recent call last):
File "spin.py", line 14, in <module>
spin_around(b)
File "spin.py", line 8, in spin_around
m_left.turn(100, 360)
File "/Library/Python/2.7/site-packages/nxt/motor.py", line 211, in turn
raise BlockedException("Blocked!")
nxt.motor.BlockedException: Blocked!为什么会发生这种异常?
https://stackoverflow.com/questions/41314520
复制相似问题