From 3c3e45c85cf66fdfdb84db6941ec95daeac75cc1 Mon Sep 17 00:00:00 2001 From: Justin Hwang Date: Sun, 8 Sep 2024 18:01:54 -0400 Subject: [PATCH] Updated mock interface for LoadCelLinterface to also comply with new documentation --- lib/mock_interfaces/LoadCellInterface.h | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/lib/mock_interfaces/LoadCellInterface.h b/lib/mock_interfaces/LoadCellInterface.h index d3588aa11..45cd62ce2 100644 --- a/lib/mock_interfaces/LoadCellInterface.h +++ b/lib/mock_interfaces/LoadCellInterface.h @@ -1,10 +1,23 @@ #ifndef __LOADCELLINTERFACE_H__ #define __LOADCELLINTERFACE_H__ +/* System Includes */ #include "Utility.h" + +/* Library Includes */ +#include "SysClock.h" #include "AnalogSensorsInterface.h" + + /* Structs */ +struct LoadCellInterfaceTick_s +{ + const AnalogConversion_s &FLConversion; + const AnalogConversion_s &FRConversion; + const AnalogConversion_s &RLConversion; + const AnalogConversion_s &RRConversion; +}; struct LoadCellInterfaceOutput_s { @@ -13,4 +26,35 @@ struct LoadCellInterfaceOutput_s bool FIRSaturated; }; +/** + * Mock interface for testing purposes. Please see the real LoadCellInterface for proper documentation. +*/ +class LoadCellInterface +{ +private: + const static int numFIRTaps_ = 5; + float FIRTaps_[numFIRTaps_] = + { + 0.07022690881526232, + 0.27638313122745306, + 0.408090001549378, + 0.27638313122745306, + 0.07022690881526232 + }; + + int FIRCircBufferHead = 0; + veh_vec loadCellConversions_; + veh_vec loadCellForcesUnfiltered_; + veh_vec loadCellForcesFiltered_; + bool FIRSaturated_ = false; + + + +public: + LoadCellInterface() {} + void tick(const LoadCellInterfaceTick_s &intake); + LoadCellInterfaceOutput_s getLoadCellForces(); + +}; + #endif \ No newline at end of file