|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Command stops my teleop process
Hey there again!
I've been writing my program in a command-based format. This works fine until I try to run a program through a joystick button. My command runs, but halts my teleop program. I am not sure what code is useful in this situation. My TeleopDefault.h and .cpp are my teleop control scheme, and I have other commands like "DropGear" and "DropFuel". When I use a joystick buttons' ->WhenPressed() to run the DropGear command, the TeleopDefault stops and does not return. Any reason for this? Thank you. I will post code if someone knows which files are needed to diagnose the problem. -Eric |
|
#2
|
||||
|
||||
|
Re: Command stops my teleop process
Sounds like you have a loop in the commands initialize or execute method
|
|
#3
|
|||
|
|||
|
Re: Command stops my teleop process
If I place a return statement at the end of the execute statement, should I be okay? Because at the moment I have something like this
Code:
TeleopDefault::Initialize(){
//some code
button->WhenPressed(new DropGear());
button->WhenReleased(this);
}
|
|
#4
|
|||
|
|||
|
Re: Command stops my teleop process
Are you sure the "button->WhenPressed" stuff should be in initialized?
I'm a bit new to command based but I feel like that should belong in your Execute. It should go in OI, above text is wrong. Last edited by GavinL : 09-02-2017 at 00:53. Reason: wrong info |
|
#5
|
|||||
|
|||||
|
Re: Command stops my teleop process
Quote:
|
|
#6
|
||||||
|
||||||
|
Re: Command stops my teleop process
It should go in OI, not in a command.
|
|
#7
|
|||
|
|||
|
Re: Command stops my teleop process
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|