예제 #1
0
void DriveStraight::End() {
	double l=Robot::drivetrain->GetLeftDistance();
	double r=Robot::drivetrain->GetRightDistance();
	double h=Robot::drivetrain->GetHeading();
	std::cout << TimeSinceInitialized()<< "  DriveStraight End("<<l<<","<<r<<","<<h<<")"<<std::endl;
	Acntrl.End();
	Dcntrl.End();
	Robot::drivetrain->EndTravel();
}
// Make this return true when this Command no longer needs to run execute()
bool ShooterLoadCommand::IsFinished() 
{
	if(TimeSinceInitialized() > 0.5)
	{
		Robot::shooter->LoaderUndeploy();
		return true;
	}
	return false;
}
예제 #3
0
// Make this return true when this Command no longer needs to run execute()
bool Move::IsFinished() {
    if(seconds -TimeSinceInitialized() <= 0)
    {
        return true;
    }
    else
    {
        return false;
    }
}
// Make this return true when this Command no longer needs to run execute()
bool DriveDirectionCommand::IsFinished() 
{
	return (TimeSinceInitialized() >= m_time);
}
예제 #5
0
void ExecHolder::SetDeltaTimeout(double t) {
	elapsed_time=TimeSinceInitialized();
	timing=true;
	SetTimeout(elapsed_time+t);
}
예제 #6
0
void Turn::End() {
	double h=Robot::drivetrain->GetHeading();
	std::cout << TimeSinceInitialized()<< "  Turn End("<<h<<")"<<std::endl;
	pid.Disable();
	Robot::drivetrain->EndTravel();
}
// Make this return true when this Command no longer needs to run execute()
bool CalibrateTurret::IsFinished() 
{
	return (TimeSinceInitialized() > 2);
}
예제 #8
0
/**
 * Returns whether or not the {@link Command#timeSinceInitialized() timeSinceInitialized()}
 * method returns a number which is greater than or equal to the timeout for the command.
 * If there is no timeout, this will always return false.
 * @return whether the time has expired
 */
bool Command::IsTimedOut()
{
	return m_timeout != -1 && TimeSinceInitialized() >= m_timeout;
}
예제 #9
0
// Make this return true when this Command no longer needs to run execute()
bool BallToIntakeCmd::IsFinished()
{

	return TimeSinceInitialized() > 1.75;
}
// Called repeatedly when this Command is scheduled to run
void FireDisc::Execute() {
	if(TimeSinceInitialized() < .7)
		Robot::fire->Forward();
	else
		Robot::fire->Backward();
}