If you have ever had your GoPiGo3 program exit unexpectedly while it was in motion, (usually from an unhandled exception), you know the panic of “RUN AWAY ROBOT”.
There is a really simple GoPiGo3 programming style that will keep your robot under control:
#!/usr/bin/env python3
import easygopigo3
import atexit
def main():
egpg = easygopigo3.EasyGoPiGo3() # or preferentially (use_mutex=True)
atexit.register(egpg.stop) # stop robot when program quits for any reason
...
if __name__ == '__main__':
main()