|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||||
|
|||||
|
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? |
|
#3
|
|||
|
|||
|
Re: Commands immediately canceling
Team3205_2014_1.01_Test_2.0.2.zip
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. |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
Re: Commands immediately canceling
Fixed it thanks for your help!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|