1#include "../../../Inc/Systems/Controller/TorqueControl.h"
2#include "../../../Inc/Systems/ControllerSystem.h"
3#include "../../../Inc/Utils/Common.h"
15 printf(
"Safety system not set for Torque Control\n");
19 printf(
"Torque Control Actuator is not in a safe state\n");
33 printf(
"Desired torque exceeds the maximum allowed torque, stepping down to max\n");
39 double s_curve = 1.0 / (1.0 + exp(-10 * (normalized - 0.5)));
float getAppsPosition(Apps *apps)
Averages app sensors to get 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 setDesiredTorque(ControllerSystem *controller)
Sets the desired torque for the Torque Control Actuator.
int startTorqueControl(TorqueControl *tc)
Starts the Torque Control Actuator.
void initTorqueControl(TorqueControl *tc, Apps *apps, int hz, float maxTorque)
Initializes the Torque Control Actuator with initial settings.
int(* safety)(struct ControllerSystem *controller)