Skip to content

Commit

Permalink
Updated mock interface for LoadCelLinterface to also comply with new …
Browse files Browse the repository at this point in the history
…documentation
  • Loading branch information
jhwang04 committed Sep 8, 2024
1 parent 11a3107 commit 3c3e45c
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions lib/mock_interfaces/LoadCellInterface.h
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -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<AnalogConversion_s> loadCellConversions_;
veh_vec<float[numFIRTaps_]> loadCellForcesUnfiltered_;
veh_vec<float> loadCellForcesFiltered_;
bool FIRSaturated_ = false;



public:
LoadCellInterface() {}
void tick(const LoadCellInterfaceTick_s &intake);
LoadCellInterfaceOutput_s getLoadCellForces();

};

#endif

0 comments on commit 3c3e45c

Please sign in to comment.