Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   FIRST Tech Challenge (http://www.chiefdelphi.com/forums/forumdisplay.php?f=146)
-   -   [FTC]: Detect loss of comm with FCS... (http://www.chiefdelphi.com/forums/showthread.php?t=114129)

FTC6389 21-02-2013 12:40

[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

FTC5096 06-03-2013 16:55

Re: [FTC]: Detect loss of comm with FCS...
 
We got a lot of compiler errors using RobotC 3.55 BETA. Do you have a version that compiles?

CougarRobot 06-03-2013 20:13

Re: [FTC]: Detect loss of comm with FCS...
 
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.

FTC5096 07-03-2013 11:34

Re: [FTC]: Detect loss of comm with FCS...
 
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.

JohnFogarty 08-03-2013 15:52

Re: [FTC]: Detect loss of comm with FCS...
 
Our teams wrote something almost identical to your post here. Good job on posting it. I recommend all FTC teams use this.


All times are GMT -5. The time now is 18:26.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi