コード例 #1
0
void DataSending::SendTheData(){
	strIndex = 0;
	Dashboard &dash = DriverStation::GetInstance()->GetHighPriorityDashboardPacker();
	DriverStation *drive = DriverStation::GetInstance();
	Send(true);//yes this is the dataSending Code
	Send(drive->GetBatteryVoltage());//battery info
	Send((batteryCurrent->GetVoltage()-2.5)*AMPS_CONSTANT);
	GetDriveJoystickInfo();//joystick info
	GetOperatorJoystickInfo();//moar joystick info
	GetVicInfo();//victor info
	Send(RobotMap::launcherSolenoidLeft->Get());//solenoid info
	Send(RobotMap::launcherSolenoidRight->Get());
	Send(RobotMap::shifterDoubleSolenoid->Get());
	Send((bool)RobotMap::launcherCompressor->GetPressureSwitchValue());//sensor info
	Send(RobotMap::robotRangeFinderUltrasonicSensor->GetVoltage()/VoltsPerCM);
	Send(RobotMap::driveTrainGyro->GetAngle());
	Send(RobotMap::launcherPressureSwitch->GetVoltage()*PSI_CONSTANT);//transducer1
	Send(RobotMap::collectorLeftRoller->Get()*-1);//talon info
	Send(RobotMap::collectorRightRoller->Get());
	Send(count++);//number of packets
	Send(timesPerSecond);//every nth number data is sent from a 50 hz source
	//a.k.a 50 / above number = Hz
	Send(drive->GetMatchTime());
	Send(drive->IsEnabled());
	dash.AddString(strBuffer);
	dash.Finalize();
	UpdateUserLCD();
}
コード例 #2
0
ファイル: RobotMain.cpp プロジェクト: RAR1741/RA14_RobotCode
	void RA14Robot::logging() {
		if (fout.is_open()) {
		fout << missionTimer->Get() << ",";
#ifndef DISABLE_SHOOTER
		myCam->log(fout);
#endif //Ends DISABLE_SHOOTER
		myDrive->log(fout);
		CurrentSensorSlot * slots[4] = { camMotor1Slot, camMotor2Slot,
				driveLeftSlot, driveRightSlot };
		
		DriverStation * ds = DriverStation::GetInstance();

		for (int i = 0; i < 4; ++i) {
			fout << slots[i]->Get() << ",";
		}

		fout << auto_case << "," << gyro->GetAngle() << "," << dropSensor->GetPosition() << "," << ds->GetBatteryVoltage() << ",";
		fout << target->IsValid() << "," << target->IsHot() << "," <<  target->GetDistance() << "," << target->GetX() << ",";
		fout << target->GetY() << "," << target->IsLeft() << "," << target->IsRight() << ",";
		fout << ds->GetMatchTime() << "," << auto_state << ",";
		fout << endl;
		}
	}