19#include "front_controller.h"
32typedef enum PtsRelationType { PTS_TYPE_LINEAR, PTS_TYPE_EXPONENTIAL, PTS_TYPE_QUADRATIC } PtsRelationType;
34typedef enum CurveType { CURVE_TYPE_LINEAR, CURVE_TYPE_EXPONENTIAL, CURVE_TYPE_QUADRATIC } CurveType;
StatusCode opd_run()
Reads the pedal percentage from AccelPedalStorage and saves an adjusted acceleration percentage to fr...
Definition: opd.c:136
StatusCode opd_linear_calculate(float pedal_percentage, PtsRelationType relation_type, float *calculated_reading)
Perform linear OPD calculation.
Definition: opd.c:89
StatusCode opd_init(FrontControllerStorage *storage)
Initializes the opd, loads front controller storage.
Definition: opd.c:166
StatusCode opd_calculate_handler(float pedal_percentage, PtsRelationType relation_type, float *calculated_reading, CurveType curve_type)
handler for opd_calculate command, runs either linear or quadratic calculation based on CurveType enu...
Definition: opd.c:120
StatusCode opd_quadratic_calculate(float pedal_percentage, PtsRelationType relation_type, float *calculated_reading)
Perform quadratic OPD calculation.
Definition: opd.c:105
StatusCode
StatusCodes for various errors.
Definition: status.h:27
Front Controller storage.
Definition: front_controller.h:72
uint32_t max_vehicle_speed_kph
Definition: opd.h:29
float max_braking_percentage
Definition: opd.h:28