Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Commands immediately canceling (http://www.chiefdelphi.com/forums/showthread.php?t=126520)

Team3205 15-02-2014 17:20

Commands immediately canceling
 
Hello, we have a command which runs a motor until a switch has been pressed. We want this functionality for another subsystem. We copy pasted the code from the first subsystem into the second subsystem changing ports names etc. We have buttons on smartdashboard which activate certain commands. When the first command is started it works fine. When the copyed command is started it automatically cancels. We have even tried making it so that the isFinished method always returns false but it still cancels instantly. Does anyone know what the problem might be?

AllenGregoryIV 15-02-2014 17:54

Re: Commands immediately canceling
 
Please post part of your code, it's much harder to debug if we can't see it.

Do either command require a subsystem?

Team3205 16-02-2014 09:25

Re: Commands immediately canceling
 
1 Attachment(s)
Attachment 16249
Here is a zip file of all our code, specifically the areas where we are having this problem is the SuckBalls command, even though it looks identical to the Reload command. Thanks for any help.

Andrew Lobos 16-02-2014 09:48

Re: Commands immediately canceling
 
Are you sure ballsucker.isSwitchSet() in isFinished() is returning what you think it is? If some electrical issue is making that always return true, your function will end after the first loop.

Besides going in with a multimeter, you can just throw a System.out.println(ballsucker.isSwitchSet()); in and see what the cRIO is getting. Logging to SmartDashboard could also get the job done

Team3205 16-02-2014 09:55

Re: Commands immediately canceling
 
Fixed it thanks for your help!


All times are GMT -5. The time now is 05:37.

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