|
MCU
|
this class with both take in sensor inputs as well as handle calculations for various derived states of the car. More...
#include <CASESystem.h>

Public Member Functions | |
| CASESystem ()=delete | |
| 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. More... | |
| 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 pstate_ and returns controller result More... | |
| DrivetrainCommand_s | get_current_drive_command () |
| 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.accelPercent - pedals_data.regenPercent -> where accelpercent is to what percent the acellerator is pushed and the regen percent is the amount of regenerative braking currently applied More... | |
| float | get_rpm_setpoint (float final_torque) |
| retrieves rpm setpoint based on final torque value More... | |
Private Attributes | |
| DrivetrainCommand_s | current_command_ |
| CASEConfiguration | config_ |
| message_queue * | msg_queue_ |
| HT08_CASE | case_ |
| unsigned long | vn_active_start_time_ |
| unsigned long | last_eval_time_ |
| unsigned long | vehicle_math_offset_ms_ |
| unsigned long | last_controller_pt1_send_time_ |
| unsigned long | last_controller_pt2_send_time_ |
| unsigned long | last_controller_pt3_send_time_ |
| unsigned long | last_vehm_send_time_ |
| unsigned long | controller_send_period_ms_ |
| unsigned long | lowest_priority_controller_send_period_ms_ |
| unsigned long | last_lowest_priority_controller_send_time_ |
this class with both take in sensor inputs as well as handle calculations for various derived states of the car.
| message_queue | the msg queue that is being used with the underlying msging interfaces |
Definition at line 96 of file CASESystem.h.
|
delete |
|
inline |
constructor for state estimator system.
| can_queue | the pointer to the message queue that will have the CAN messages put onto it |
| send_period_ms | the period in which messages will be put into the queue to be sent in milliseconds. |
| vehicle_math_offset_ms | the offset in ms from controller message sending that the vehicle math messages will be sent |
Definition at line 104 of file CASESystem.h.
| float CASESystem< message_queue >::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.accelPercent - pedals_data.regenPercent -> where accelpercent is to what percent the acellerator is pushed and the regen percent is the amount of regenerative braking currently applied
| pedals_data | has accel and regen percent |
| max_torque | not used right now |
| max_regen_torque | used for calculation of torque request |
| max_rpm | not used right now |
| DrivetrainCommand_s CASESystem< message_queue >::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 pstate_ and returns controller result
| tick | current system tick |
| body_velocity_ms | body velocity vector |
| yaw_rate_rads | yaw rate in rad / s |
| steering_norm | steering value between -1 and 1 ish |
| wheel_rpms | wheel rpms |
| pedals_data | current pedals data |
| load_cell_vals | load cell forces in N |
| power_kw | current electrical power in kilo-watts |
| reset_integral | bool of whether or not to reset integral term |
|
inline |
Definition at line 149 of file CASESystem.h.
|
inline |
retrieves rpm setpoint based on final torque value
| float | final_torque |
Definition at line 163 of file CASESystem.h.
|
private |
Definition at line 179 of file CASESystem.h.
|
private |
Definition at line 177 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.
|
private |
Definition at line 176 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.
|
private |
Definition at line 178 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.
|
private |
Definition at line 181 of file CASESystem.h.