6#include <frc/TimedRobot.h>
9#include "valkyrie/Loggable.h"
10#include "valkyrie/Robot.h"
11#include "valkyrie/util/Profiler.h"
24 static constexpr units::millisecond_t LOOP_PERIOD = frc::TimedRobot::kDefaultPeriod / 2;
35 virtual void Refresh() = 0;
37 virtual void Calculate() {}
91 inline T
Get()
const {
return currState; }
Base helper for publishing and subscribing values to NetworkTables.
Definition Loggable.h:218
static Robot & GetRobot()
Abstract class that all Valor sensors should implement.
Definition BaseSensor.h:52
void SetGetter(std::function< T()> _lambda)
Set the lambda function to fetch sensor data.
Definition BaseSensor.h:71
std::optional< PoseEstimate > prevState
Definition BaseSensor.h:129
std::function< std::optional< PoseEstimate >()> sensorLambda
Definition BaseSensor.h:114
std::function< std::optional< PoseEstimate >(std::optional< PoseEstimate >)> postProcessor
Definition BaseSensor.h:121
void Refresh() override
Refresh the sensor state.
Definition BaseSensor.h:99
void ApplyPostProcessing(std::function< T(T)> func)
Set a post-processing function for sensor data.
Definition BaseSensor.h:81
virtual void Reset()
Reset the sensor state.
Definition BaseSensor.h:61
T Get() const
Get the current sensor state.
Definition BaseSensor.h:91