5#include "HytechCANInterface.h"
10#include "ProtobufMsgInterface.h"
95template <
typename message_queue>
105 message_queue *can_queue,
106 unsigned long controller_send_period_ms,
107 unsigned long vehicle_math_offset_ms,
108 unsigned long lowest_controller_send_period_ms,
138 const SysTick_s &tick,
146 bool start_button_pressed,
165 if (final_torque > 0)
184#include "CASESystem.tpp"
this class with both take in sensor inputs as well as handle calculations for various derived states ...
unsigned long vn_active_start_time_
DrivetrainCommand_s current_command_
CASEConfiguration config_
float get_rpm_setpoint(float final_torque)
retrieves rpm setpoint based on final torque value
unsigned long last_eval_time_
CASESystem(message_queue *can_queue, unsigned long controller_send_period_ms, unsigned long vehicle_math_offset_ms, unsigned long lowest_controller_send_period_ms, CASEConfiguration config)
constructor for state estimator system.
unsigned long controller_send_period_ms_
unsigned long last_lowest_priority_controller_send_time_
unsigned long vehicle_math_offset_ms_
DrivetrainCommand_s get_current_drive_command()
DrivetrainCommand_s evaluate(const SysTick_s &tick, const VectornavData_s &vn_data, const SteeringSystemData_s &steering_data, const DrivetrainDynamicReport_s &drivetrain_data, const veh_vec< AnalogConversion_s > &load_cell_vals, const PedalsSystemData_s &pedals_data, float power_kw, CAR_STATE fsm_state, bool start_button_pressed, uint8_t vn_status)
function that evaluates the CASE (controller and state estimation) system. updates the internal pstat...
float calculate_torque_request(const PedalsSystemData_s &pedals_data, float max_torque, float max_regen_torque, float max_rpm)
uses pedal data to determine the torque to be requested from the motors pedals_data....
unsigned long lowest_priority_controller_send_period_ms_
unsigned long last_controller_pt3_send_time_
unsigned long last_controller_pt1_send_time_
message_queue * msg_queue_
unsigned long last_vehm_send_time_
unsigned long last_controller_pt2_send_time_
float tcs_pid_p_lowerBound_rear
float yawPIDMaxDifferential
float yawPIDCoastThreshold
float TCSWheelSteerLowerBound
float tcs_pid_upper_rpm_front
float discontinuousBrakesPercentThreshold
float launchSL_startBound_Rear
float tcs_saturation_rear
float TCS_SL_startBound_Front
float maxNormalLoadBrakeScalingFront
float tcs_pid_p_lowerBound_front
float tcs_saturation_front
float TCS_SL_endBound_Front
float TCS_SL_startBound_Rear
float decoupledYawPIDBrakesMaxDIfference
bool useRPM_TCS_GainSchedule
float TCSGenLeftRightDiffLowerBound
float launchSL_endBound_Rear
bool useNL_TCS_GainSchedule
float TCS_NL_startBoundPerc_FrontAxle
float tcs_pid_lower_rpm_rear
float tcs_pid_p_upperBound_front
float AbsoluteTorqueLimit
bool useDiscontinuousYawPIDBrakes
float tcs_pid_p_upperBound_rear
float TCS_SL_NLPerc_endBound_Front
float TCS_SL_NLPerc_endBound_Rear
float TCSWheelSteerUpperBound
float launchSL_endBound_Front
float tcs_pid_lower_rpm_front
float BrakeTorquePercentFront
float TCS_NL_endBoundPerc_RearAxle
float TCS_NL_startBoundPerc_RearAxle
bool useDecoupledYawBrakes
float TCS_SL_endBound_Rear
float TCS_SL_NLPerc_startBound_Front
float TCSGenLeftRightDiffUpperBound
float launchSL_startBound_Front
float DriveTorquePercentFront
float TCS_NL_endBoundPerc_FrontAxle
float tcs_pid_upper_rpm_rear
float TCS_SL_NLPerc_startBound_Rear
float launchLeftRightMaxDiff
bool useNL_TCS_SlipSchedule
float yawPIDErrorThreshold
Stores setpoints for a command to the Drivetrain, containing speed and torque setpoints for each moto...
generic data vector type that can be used with tire and / or anything to do with 4 corners of the car...