6#include <frc/TimedRobot.h>
8#include <valkyrie/Loggable.h>
9#include <valkyrie/Robot.h>
22 static constexpr units::millisecond_t LOOP_PERIOD = frc::TimedRobot::kDefaultPeriod / 2;
33 virtual void Refresh() = 0;
35 virtual void Calculate() {}
89 inline T
Get()
const {
return currState; }
Base helper for publishing and subscribing values to NetworkTables.
Definition Loggable.h:53
static Robot & GetRobot()
Abstract class that all Valor sensors should implement.
Definition BaseSensor.h:50
void SetGetter(std::function< T()> _lambda)
Set the lambda function to fetch sensor data.
Definition BaseSensor.h:69
std::optional< PoseEstimate > prevState
Definition BaseSensor.h:127
std::function< std::optional< PoseEstimate >()> sensorLambda
Definition BaseSensor.h:112
std::function< std::optional< PoseEstimate >(std::optional< PoseEstimate >)> postProcessor
Definition BaseSensor.h:119
void Refresh() override
Refresh the sensor state.
Definition BaseSensor.h:97
void ApplyPostProcessing(std::function< T(T)> func)
Set a post-processing function for sensor data.
Definition BaseSensor.h:79
virtual void Reset()
Reset the sensor state.
Definition BaseSensor.h:59
T Get() const
Get the current sensor state.
Definition BaseSensor.h:89