[wpilib] Add timestamp getters with configurable time base (#7378)

This commit is contained in:
Jonah Bonner
2024-11-16 10:43:38 -05:00
committed by GitHub
parent 91142ba5fe
commit ca51197486
27 changed files with 180 additions and 53 deletions

View File

@@ -106,7 +106,7 @@ void Drivetrain::UpdateOdometry() {
// latency delay -- on a real robot, this must be calculated based either on
// known latency or timestamps.
m_poseEstimator.AddVisionMeasurement(visionMeasurement2d,
frc::Timer::GetFPGATimestamp());
frc::Timer::GetTimestamp());
}
void Drivetrain::SimulationPeriodic() {

View File

@@ -67,5 +67,5 @@ void Drivetrain::UpdateOdometry() {
m_poseEstimator.AddVisionMeasurement(
ExampleGlobalMeasurementSensor::GetEstimatedGlobalPose(
m_poseEstimator.GetEstimatedPosition()),
frc::Timer::GetFPGATimestamp() - 0.3_s);
frc::Timer::GetTimestamp() - 0.3_s);
}

View File

@@ -41,5 +41,5 @@ void Drivetrain::UpdateOdometry() {
m_poseEstimator.AddVisionMeasurement(
ExampleGlobalMeasurementSensor::GetEstimatedGlobalPose(
m_poseEstimator.GetEstimatedPosition()),
frc::Timer::GetFPGATimestamp() - 0.3_s);
frc::Timer::GetTimestamp() - 0.3_s);
}