本文整理汇总了C++中DriverStation::GetMatchTime方法的典型用法代码示例。如果您正苦于以下问题:C++ DriverStation::GetMatchTime方法的具体用法?C++ DriverStation::GetMatchTime怎么用?C++ DriverStation::GetMatchTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DriverStation
的用法示例。
在下文中一共展示了DriverStation::GetMatchTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendTheData
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:
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;
}
}