diff --git a/wpilibc/athena/src/Timer.cpp b/wpilibc/athena/src/Timer.cpp index c3dfd98cdc..964f96190b 100644 --- a/wpilibc/athena/src/Timer.cpp +++ b/wpilibc/athena/src/Timer.cpp @@ -11,6 +11,7 @@ #include #include +#include "DriverStation.h" #include "HAL/HAL.h" #include "Utility.h" @@ -165,3 +166,20 @@ double Timer::GetFPGATimestamp() { // Call the helper GetFPGATime() in Utility.cpp return GetFPGATime() * 1.0e-6; } + +/** + * Return the approximate match time The FMS does not currently send the + * official match time to + * the robots This returns the time since the enable signal sent from the Driver + * Station At the + * beginning of autonomous, the time is reset to 0.0 seconds At the beginning of + * teleop, the time + * is reset to +15.0 seconds If the robot is disabled, this returns 0.0 seconds + * Warning: This is + * not an official time (so it cannot be used to argue with referees). + * + * @return Match time in seconds since the beginning of autonomous + */ +double Timer::GetMatchTime() { + return DriverStation::GetInstance().GetMatchTime(); +}