Esempio n. 1
0
	//
	// Main Autonomous Mode function.  This function is called once, therefore a while loop that checks IsAutonomous and IsEnabled is used 
	// to maintain control until the end of autonomous mode
	//
	void Autonomous()
	{
		// Initialize Smart Dashboard
		SmartDashboard::init();
		
		autonomous = new AutonomousMode(AUTO_TIMEONLY, drive->myRobot, sensors, catapult, STOP_DISTANCE_RANGE, STOP_DISTANCE_ENCOD, STOP_DRIVING_TIME, CAMERA_LED);
		
		//myRobot->SetSafetyEnabled(false);
		
		//AxisCamera &camera = AxisCamera::GetInstance();
		
		//Relay* redddlight = new Relay(4);
		//Timer* lighttimer = new Timer();
		//lighttimer->Start();
		while(IsAutonomous() && IsEnabled())
		{
			/*
			if (lighttimer->Get()<=0.25) {
				redddlight->Set(redddlight->kForward);
			}
			else if(lighttimer->Get()<0.5){
				redddlight->Set(redddlight->kOff);
			}
			else {
				lighttimer->Reset();
			}
			*/
			feeder->GetInputs();
			sensors->GetInputs();
			
			//ColorImage *image;
			//image = camera.GetImage();
		

			//SmartDashboard::PutNumber("Range Finder Distance", sensors->GetInch(sensors->range->GetVoltage()));
			//SmartDashboard::PutNumber("Range Finder Average Distance", sensors->GetDistance());
			autonomous->GetInputs();
			
			autonomous->ExecStep();
			
			autonomous->SetOutputs();
			
			//delete &image;
			//delete image;
			
			Wait(0.01);
			/*
			DigitalInput *limitswitch = new DigitalInput(1);
			limitswitch->Get();
			*/
		}
	}