Exemplo n.º 1
0
void Metrobot::TeleopPeriodic(){
	
	Scheduler::GetInstance()->Run();
	Actuate();
	
	ds_->Clear();
	ds_->Printf(DriverStationLCD::kUser_Line1, 1, "Tele-op" );
	ds_->Printf(DriverStationLCD::kUser_Line2, 1, "" );
	ds_->Printf(DriverStationLCD::kUser_Line3, 1, "" );
	ds_->Printf(DriverStationLCD::kUser_Line4, 1, "" );
	ds_->Printf(DriverStationLCD::kUser_Line5, 1, "" );
	ds_->Printf(DriverStationLCD::kUser_Line6, 1, "" );
	ds_->UpdateLCD();
	
}
Exemplo n.º 2
0
void Metrobot::AutonomousPeriodic(){
	
	Scheduler::GetInstance()->Run();
	Actuate();
	
	ds_->Clear();
	ds_->Printf(DriverStationLCD::kUser_Line1, 1, "Autonomous" );
	ds_->Printf(DriverStationLCD::kUser_Line2, 1, "Script: %s", autonScript == Metrobot::AUTON_SCRIPT_NONE ? "None" : ( autonScript == AUTON_SCRIPT_1 ? "script1" : "script2" ) );
	ds_->Printf(DriverStationLCD::kUser_Line3, 1, "" );
	ds_->Printf(DriverStationLCD::kUser_Line4, 1, "" );
	ds_->Printf(DriverStationLCD::kUser_Line5, 1, "" );
	ds_->Printf(DriverStationLCD::kUser_Line6, 1, "" );
	ds_->UpdateLCD();

}
Exemplo n.º 3
0
int CPneumatic::GetErr(void)
{
	if(pmUNCERTAIN == GetPos())
	{
		if(m_tmErr.TimeOver(m_nTmLimit))  
		{
			if(pmUNCERTAIN != m_nErrorAct)									
				Actuate(m_nErrorAct);

			return (m_nErrorCode);			
		}
	}
	else 
	{
		m_tmErr.Reset();
	}
	return (0);
}//------------------------------------------------------------------
Exemplo n.º 4
0
void Metrobot::TeleopPeriodic(){
	UpdateOI();
	
	
	if( gamePad->GetButtonDown( GamePad::START ) ){
		drive->SetPIDControl( true );
	}
	if( gamePad->GetButtonDown( GamePad::BACK ) ){
		drive->SetPIDControl( false );
	}
	drive->SetArcadeDrive( gamePad->GetAxis( GamePad::LEFT_Y ), gamePad->GetAxis( GamePad::RIGHT_Y ) );
	
	
	Actuate();
	PrintToDS();
	GetWatchdog().Feed();
	
}
Exemplo n.º 5
0
void Metrobot::AutonomousPeriodic(){

	UpdateOI();
	
	switch( autonScript ){
	
	case SCRIPT_1:
		switch( autonStep ){
		
				case 0:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				case 1:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				case 2:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				case 3:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				case 4:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				default:
					break;
				
		}
		break;
		
	case SCRIPT_2:
		switch( autonStep ){

				case 0:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				case 1:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				case 2:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				case 3:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				case 4:
					if( true || autonTimer->Get() >= 1.0 ){ autonTimer->Reset(); autonStep++; }
					break;
				default:
					break;
				
		}
		break;
	default:
		break;
	
	}
	
	Actuate();
	PrintToDS();
	GetWatchdog().Feed();
	
}