16 bool drivebrain_has_not_received_time = (db_input.DB_prev_MCU_recv_millis < 0);
19 bool message_too_latent = (::abs((
int)(sys_tick.millis - db_input.DB_prev_MCU_recv_millis)) > (int)
_params.allowed_latency);
32 bool timing_failure = (message_too_latent || no_messages_received || drivebrain_has_not_received_time);
38 if ((!is_active_controller) && (!timing_failure))
struct DrivebrainController::@0 _params
unsigned long _last_worst_latency_timestamp
TorqueControllerOutput_s evaluate(const SharedCarState_s &state)
evaluate function for running the business logic
unsigned long _last_setpoint_millis
int64_t _worst_latency_so_far
TorqueControllerSimple _emergency_control
TorqueControllerOutput_s evaluate(const SharedCarState_s &state) override
int64_t last_receive_time_millis
the latest time that the MCU received a message w.r.t the current tick's millis
float inverter_torque_limit[NUM_MOTORS]
float speeds_rpm[NUM_MOTORS]
car state struct that contains state of everything about the car including
TorqueControllerMuxStatus tc_mux_status
ControllerMode_e active_controller_mode
Packages drivetrain command with ready boolean to give feedback on controller successfully evaluating...
DrivetrainCommand_s command