In case anyone is interested, we found a modified version of JoystickDriver.c created by now retired FTC team 2848 (available here). It basically adds another property to the joystick object called “connected”, which you then test inside your main loop.
This is useful because as some of us have experienced, the NXT will carry out the last instruction it received if it loses connection to the FCS. So, say you are “moving forward” and that action sets all your drive motors to 75% power, then your samo drops connection to the FCS (which we can always repro by shocking the bot via static electricity), your bot will continue to move forward at 75% power indefinately because the “set all motors to 0%” message will never get to the NXT. The modified joystick driver and additional main loop check of the “joystick.connected” property will allow your teleop program to automatically stop all motors if the FCS connection is lost.
Hope this is useful to teams.
FTC Team #6389