[FTC]: Detect loss of comm with FCS...

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

We got a lot of compiler errors using RobotC 3.55 BETA. Do you have a version that compiles?

We are using the current JoystickDriver.c and believe that it has incorporated most of the functionality of the TechnoGuards version from previous years.

  1. There is a global variable, nNoMessageCounterLimit, it’s default value is 750 and it determines how long it will take for the no new messages functionality to kick in.

  2. There is another global variable, a boolean, bDisconnected, which if true means that you have lost connectivity for nNoMessageCounterLimit cycles. You can use this variable to decide when to stop all of your motors because you are disconnected.

Great. Thank you very much.

Congratulations on all your team’s accomplishments during the last three championships. We learned a lot from you in Kentucky.

Our teams wrote something almost identical to your post here. Good job on posting it. I recommend all FTC teams use this.