View Single Post
  #3   Spotlight this post!  
Unread 13-03-2013, 21:42
CardcaptorRLH85's Avatar
Happy Birthday! CardcaptorRLH85 CardcaptorRLH85 is offline
The master of the cards ^_^
AKA: Raa'Shaun H.
FRC #0322 (F.I.R.E. "Flint Inspires Real Engineers")
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Michigan, USA
Posts: 59
CardcaptorRLH85 is an unknown quantity at this point
Send a message via ICQ to CardcaptorRLH85 Send a message via AIM to CardcaptorRLH85 Send a message via MSN to CardcaptorRLH85 Send a message via Yahoo to CardcaptorRLH85
Re: SmartDashboard with CommandBasedRobot Template

Quote:
Originally Posted by Jefferson View Post
I have not been able to get commands to run in disabled. If you are able to, I'd like to know how.
Quote:
Originally Posted by Joe Ross View Post
In Java, there is a setRunWhileDisabled method, that you can call in the constructor of the command. You also need to call the scheduler in the disabledPeriodic. I assume it's similar in C++.
Yup, in C++ it works like this:

Code:
	virtual void RobotInit() {
		CommandBase::init();
		lw = LiveWindow::GetInstance();
		
                RandomCommand->SetRunWhenDisabled(true);
	}
        .
        .
        .
	virtual void DisabledPeriodic() {
		RandomCommand->Run();
		Scheduler::GetInstance()->Run();
	}
__________________

Reply With Quote