1#include "../../../Inc/Utils/Constants.h"
2#include "../../../Inc/Systems/Controller/RTD.h"
3#include "../../../Inc/Systems/ControllerSystem.h"
4#include "../../../Inc/Utils/Common.h"
25 printf(
"Safety system not set for RTD\r\n");
29 printf(
"RTD Actuator is not in a safe state\r\n");
40 printf(
"RTD: Apps or Brake System Control Actuator is not validated\r\n");
45 printf(
"RTD: APPS position is too high\r\n");
51 printf(
"RTD: Brake pressure is too low\r\n");
71 printf(
"RTD updated. Ready to Drive: %d\r\n", rtd->
readyToDrive);
80 printf(
"RTD is ready to drive\r\n");
float getAppsPosition(Apps *apps)
Averages app sensors to get pedal position.
#define MIN_BRAKE_PRESSURE
#define MAX_A_PEDAL_POSITION
void initControllerSystem(ControllerSystem *controller, const char *name, int hz, ControllerType type, int(*updateController)(ControllerSystem *controller), void *child)
Initializes the Controller System with initial settings.
int writeDigitalOutputData(DigitalOutput *output, int data)
Writes data to the buffer of the digital output.
void initDigitalOutput(DigitalOutput *digitaloutput, const char *name, int hz, int port)
Initializes a digital output with the given parameters.
int checkRTD(void *rtd)
Checks if RTD is in ready to drive state.
int startRTD(RTD *rtd)
Starts the RTD Actuator.
int updateRTD(ControllerSystem *controller)
Updates the RTD Actuator.
void initRTD(RTD *rtd, Apps *apps, BrakeSystemControl *bsc, int hz, int buttonPort, int piezoPort)
Initializes the RTD Actuator with initial settings.
BrakePressure * rearPressure
BrakePressure * frontPressure
int(* safety)(struct ControllerSystem *controller)