MCU
Loading...
Searching...
No Matches
SimpleController.h
Go to the documentation of this file.
1#ifndef SIMPLECONTROLLER
2#define SIMPLECONTROLLER
3
4#include "BaseController.h"
5
6
7
9{
10private:
12 float frontTorqueScale_ = 1.0;
13 float rearTorqueScale_ = 1.0;
16
17public:
22 TorqueControllerSimple(float rearTorqueScale, float regenTorqueScale)
23 : frontTorqueScale_(2.0 - rearTorqueScale),
24 rearTorqueScale_(rearTorqueScale),
25 frontRegenTorqueScale_(2.0 - regenTorqueScale),
26 rearRegenTorqueScale_(regenTorqueScale)
27 {
29 writeout_.ready = true;
30 }
33 void tick(const PedalsSystemData_s &pedalsData);
36};
37
38#endif
Base class for all controllers, which define drivetrain command containing different variations of
TorqueControllerOutput_s writeout_
void tick(const PedalsSystemData_s &pedalsData)
calculates torque output based off max torque and simple torque scaling metric defined in constructor...
TorqueControllerOutput_s evaluate(const SharedCarState_s &state) override
TorqueControllerSimple(float rearTorqueScale, float regenTorqueScale)
simple TC with tunable F/R torque balance. Accel torque balance can be tuned independently of regen t...
const DrivetrainCommand_s TC_COMMAND_NO_TORQUE
Definition: BaseController.h:9
car state struct that contains state of everything about the car including
Packages drivetrain command with ready boolean to give feedback on controller successfully evaluating...
DrivetrainCommand_s command