mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[wpilib] Update GetMatchTime docs and units (#5232)
This commit is contained in:
@@ -582,9 +582,9 @@ bool DriverStation::WaitForDsConnection(units::second_t timeout) {
|
||||
return result;
|
||||
}
|
||||
|
||||
double DriverStation::GetMatchTime() {
|
||||
units::second_t DriverStation::GetMatchTime() {
|
||||
int32_t status = 0;
|
||||
return HAL_GetMatchTime(&status);
|
||||
return units::second_t{HAL_GetMatchTime(&status)};
|
||||
}
|
||||
|
||||
double DriverStation::GetBatteryVoltage() {
|
||||
|
||||
@@ -90,5 +90,5 @@ units::second_t Timer::GetFPGATimestamp() {
|
||||
}
|
||||
|
||||
units::second_t Timer::GetMatchTime() {
|
||||
return units::second_t{frc::DriverStation::GetMatchTime()};
|
||||
return frc::DriverStation::GetMatchTime();
|
||||
}
|
||||
|
||||
@@ -306,21 +306,26 @@ class DriverStation final {
|
||||
static bool WaitForDsConnection(units::second_t timeout);
|
||||
|
||||
/**
|
||||
* Return the approximate match time.
|
||||
*
|
||||
* The FMS does not send an official match time to the robots, but does send
|
||||
* an approximate match time. The value will count down the time remaining in
|
||||
* the current period (auto or teleop).
|
||||
*
|
||||
* Return the approximate match time. The FMS does not send an official match
|
||||
* time to the robots, but does send an approximate match time. The value will
|
||||
* count down the time remaining in the current period (auto or teleop).
|
||||
* Warning: This is not an official time (so it cannot be used to dispute ref
|
||||
* calls or guarantee that a function will trigger before the match ends).
|
||||
*
|
||||
* The Practice Match function of the DS approximates the behavior seen on
|
||||
* the field.
|
||||
* <p>When connected to the real field, this number only changes in full
|
||||
* integer increments, and always counts down.
|
||||
*
|
||||
* @return Time remaining in current match period (auto or teleop)
|
||||
* <p>When the DS is in practice mode, this number is a floating point number,
|
||||
* and counts down.
|
||||
*
|
||||
* <p>When the DS is in teleop or autonomous mode, this number is a floating
|
||||
* point number, and counts up.
|
||||
*
|
||||
* <p>Simulation matches DS behavior without an FMS connected.
|
||||
*
|
||||
* @return Time remaining in current match period (auto or teleop) in seconds
|
||||
*/
|
||||
static double GetMatchTime();
|
||||
static units::second_t GetMatchTime();
|
||||
|
||||
/**
|
||||
* Read the battery voltage.
|
||||
|
||||
Reference in New Issue
Block a user