MCU
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
LoadCellInterface Class Reference

#include <LoadCellInterface.h>

Collaboration diagram for LoadCellInterface:
Collaboration graph

Public Member Functions

 LoadCellInterface ()
 
void tick (const LoadCellInterfaceTick_s &intake)
 
void update_raw_data (const LoadCellInterfaceTick_s &intake)
 
LoadCellInterfaceRawOutput_s get_latest_raw_data ()
 
LoadCellInterfaceOutput_s getLoadCellForces ()
 

Private Attributes

float FIRTaps_ [numFIRTaps_]
 
int FIRCircBufferHead = 0
 
veh_vec< AnalogConversion_s > loadCellConversions_
 
veh_vec< float[numFIRTaps_]> loadCellForcesUnfiltered_
 
veh_vec< float > loadCellForcesFiltered_
 
LoadCellInterfaceRawOutput_s _raw_data
 
bool FIRSaturated_ = false
 

Static Private Attributes

static const int numFIRTaps_ = 5
 

Detailed Description

Definition at line 20 of file LoadCellInterface.h.

Constructor & Destructor Documentation

◆ LoadCellInterface()

LoadCellInterface::LoadCellInterface ( )
inline

Definition at line 23 of file LoadCellInterface.h.

23 {
27 }
veh_vec< float > loadCellForcesFiltered_
veh_vec< float[numFIRTaps_]> loadCellForcesUnfiltered_
veh_vec< AnalogConversion_s > loadCellConversions_
generic data vector type that can be used with tire and / or anything to do with 4 corners of the car...
Definition: Utility.h:17

Member Function Documentation

◆ get_latest_raw_data()

LoadCellInterfaceRawOutput_s LoadCellInterface::get_latest_raw_data ( )
inline

Definition at line 30 of file LoadCellInterface.h.

30{ return _raw_data; }
LoadCellInterfaceRawOutput_s _raw_data

◆ getLoadCellForces()

LoadCellInterfaceOutput_s LoadCellInterface::getLoadCellForces ( )

Definition at line 35 of file LoadCellInterface.cpp.

36{
38 .loadCellForcesFiltered = loadCellForcesFiltered_,
39 .loadCellConversions = loadCellConversions_,
40 .FIRSaturated = FIRSaturated_};
41}

◆ tick()

void LoadCellInterface::tick ( const LoadCellInterfaceTick_s intake)

Definition at line 3 of file LoadCellInterface.cpp.

4{
5 // filter runs at 100hz
10
15
20
21 for (int FIROffset = 0; FIROffset < numFIRTaps_; FIROffset++)
22 {
23 int index = (FIRCircBufferHead + FIROffset) % numFIRTaps_;
28 }
29
32 FIRSaturated_ = true;
33}
float FIRTaps_[numFIRTaps_]
static const int numFIRTaps_
const AnalogConversion_s & RRConversion
const AnalogConversion_s & FRConversion
const AnalogConversion_s & FLConversion
const AnalogConversion_s & RLConversion
T FL
Definition: Utility.h:19
T RL
Definition: Utility.h:21
T RR
Definition: Utility.h:22
T FR
Definition: Utility.h:20

◆ update_raw_data()

void LoadCellInterface::update_raw_data ( const LoadCellInterfaceTick_s intake)

Definition at line 44 of file LoadCellInterface.cpp.

45{
46 _raw_data.raw_load_cell_data = {intake.FLConversion.raw, intake.FRConversion.raw, intake.RLConversion.raw, intake.RRConversion.raw};
47}

Member Data Documentation

◆ _raw_data

LoadCellInterfaceRawOutput_s LoadCellInterface::_raw_data
private

Definition at line 62 of file LoadCellInterface.h.

◆ FIRCircBufferHead

int LoadCellInterface::FIRCircBufferHead = 0
private

Definition at line 58 of file LoadCellInterface.h.

◆ FIRSaturated_

bool LoadCellInterface::FIRSaturated_ = false
private

Definition at line 63 of file LoadCellInterface.h.

◆ FIRTaps_

float LoadCellInterface::FIRTaps_[numFIRTaps_]
private
Initial value:
=
{
0.07022690881526232,
0.27638313122745306,
0.408090001549378,
0.27638313122745306,
0.07022690881526232
}

Definition at line 50 of file LoadCellInterface.h.

◆ loadCellConversions_

veh_vec<AnalogConversion_s> LoadCellInterface::loadCellConversions_
private

Definition at line 59 of file LoadCellInterface.h.

◆ loadCellForcesFiltered_

veh_vec<float> LoadCellInterface::loadCellForcesFiltered_
private

Definition at line 61 of file LoadCellInterface.h.

◆ loadCellForcesUnfiltered_

veh_vec<float[numFIRTaps_]> LoadCellInterface::loadCellForcesUnfiltered_
private

Definition at line 60 of file LoadCellInterface.h.

◆ numFIRTaps_

const int LoadCellInterface::numFIRTaps_ = 5
staticprivate

Definition at line 49 of file LoadCellInterface.h.


The documentation for this class was generated from the following files: