Fixes missing function for Timer::GetMatchTime() (#299)

This commit is contained in:
Thad House
2016-10-25 19:01:18 -07:00
committed by Peter Johnson
parent 60e199b0bd
commit 70343c0b3f

View File

@@ -11,6 +11,7 @@
#include <iostream>
#include <thread>
#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();
}