I created this simple script for my Sparkfun JetBot:
from jetbot import Robot
import time
robot = Robot()
robot.left_motor.value = 0.3
print("Left motor activated!")
robot.right_motor.value = 0.6
print("Right motor activated!")
print("Now wait")
time.sleep(5.0)
print("Now stop!")
robot.left_motor.value = 0.0
robot.right_motor.value = 0.0
It runs ok, however when the script ends, it throws the following two errors:
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot/motor.py", line 60, in _release
self._motor.disable()
AttributeError: 'NoneType' object has no attribute 'disable'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot/motor.py", line 60, in _release
self._motor.disable()
AttributeError: 'NoneType' object has no attribute 'disable'
When I navigate to /usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot and open the file ‘motor.py’, I see the following lines at the very end (lines 58-60):
def _release(self):
"""Stops motor by releasing control"""
self._motor.disable()
I do not believe there is a ‘_motor’ class with a method called ‘disable()’. Instead it should be the ‘_driver’ class and the line should read as follows:
self._driver.disable()
Is it possible for me to update this file? It seems to be read only, and using chmod doesn’t seem to help me update the permissions.
Or maybe I’m completely wrong about the error! Any help is appreciated.