17#include "global_enums.h"
19#include "ws22_motor_can.h"
30struct PowerSenseStorage;
36#define FRONT_CONTROLLER_ACCEL_INPUT_DEADZONE 0.05f
39#define FRONT_CONTROLLER_ACCEL_REMAP_MIN 0.10f
42#define FRONT_CONTROLLER_ACCEL_CURVE_EXPONENT 2.0f
45#define FRONT_CONTROLLER_ACCEL_LPF_ALPHA 0.25f
48#define FRONT_CONTROLLER_BRAKE_LPF_ALPHA 0.50f
51#define FRONT_CONTROLLER_BRAKE_INPUT_DEADZONE 0.15f
54#define WS22_CONTROLLER_MAX_VELOCITY 12000
57#define MAX_VEHICLE_SPEED_KPH 50
60#define FRONT_CONTROLLER_ACCEL_PEDAL_UPPER_VALUE_AMPLIFIED_DEFAULT 1120
61#define FRONT_CONTROLLER_ACCEL_PEDAL_LOWER_VALUE_AMPLIFIED_DEFAULT 286
63#define FRONT_CONTROLLER_ACCEL_PEDAL_OPAMP_THRESHOLD_DEFAULT 535
64#define FRONT_CONTROLLER_ACCEL_PEDAL_REVERSED_DEFAULT true
66#define FRONT_CONTROLLER_BRAKE_PEDAL_UPPER_VALUE_DEFAULT 1230
67#define FRONT_CONTROLLER_BRAKE_PEDAL_LOWER_VALUE_DEFAULT 960
86 BRAKE_STATE_DISABLED = 0,
98 float brake_percentage;
BrakeState
Front Controller brake states.
Definition: front_controller.h:85
StatusCode front_controller_init(FrontControllerStorage *storage, FrontControllerConfig *config, Ws22MotorCanConfig *motor_can_config)
Initialize the front controller interface.
Definition: front_controller.c:61
VehicleDriveState
Vehicle drive states.
Definition: global_enums.h:32
StatusCode
StatusCodes for various errors.
Definition: status.h:27
Definition: accel_pedal.h:34
Definition: brake_pedal.h:31
Definition: cruise_control.h:34
Front Controller configuration data.
Definition: front_controller.h:72
float brake_low_pass_filter_alpha
Definition: front_controller.h:79
float brake_pedal_activation_zone
Definition: front_controller.h:78
float accel_low_pass_filter_alpha
Definition: front_controller.h:76
float accel_input_deadzone
Definition: front_controller.h:73
float accel_input_curve_exponent
Definition: front_controller.h:75
float accel_input_remap_min
Definition: front_controller.h:74
float brake_pedal_deadzone
Definition: front_controller.h:77
Front Controller storage.
Definition: front_controller.h:93
struct AccelPedalStorage * accel_pedal_storage
Definition: front_controller.h:103
struct OpdStorage * opd_storage
Definition: front_controller.h:106
struct Ws22MotorCanStorage * ws22_motor_can_storage
Definition: front_controller.h:105
struct BrakePedalStorage * brake_pedal_storage
Definition: front_controller.h:104
Ws22MotorCanConfig * ws22_motor_can_config
Definition: front_controller.h:110
FrontControllerConfig * config
Definition: front_controller.h:109
struct PowerManagerStorage * power_manager_storage
Definition: front_controller.h:102
struct CruiseControlStorage * cruise_control_storage
Definition: front_controller.h:107
VehicleDriveState current_drive_state
Definition: front_controller.h:100
float accel_percentage
Definition: front_controller.h:99
BrakeState brake_state
Definition: front_controller.h:94
uint32_t vehicle_speed_kph
Definition: front_controller.h:96
Definition: power_manager.h:28
Definition: ws22_motor_can.h:94
WS22 motor CAN interface storage structure.
Definition: ws22_motor_can.h:109