From 3bb36b4f994bbacbcf1bdf77165e775a07a92715 Mon Sep 17 00:00:00 2001 From: Ben Hall Date: Fri, 13 Sep 2024 19:44:13 -0400 Subject: [PATCH] updating pedals systems test, version of shared firmware interfaces and to the latest pedals parameters --- include/MCU_rev15_defs.h | 16 +++++++------- platformio.ini | 2 +- test/test_systems/pedals_system_test.h | 29 ++++++++++++++++---------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/include/MCU_rev15_defs.h b/include/MCU_rev15_defs.h index e2399cb33..a11ee99dc 100644 --- a/include/MCU_rev15_defs.h +++ b/include/MCU_rev15_defs.h @@ -52,17 +52,17 @@ const unsigned long TELEM_CAN_BAUDRATE = 500000; // All of these values are the PEDAL min/max // the sensor min/max that trip implaus are calculated // in the PedalsSystem constructor -const int ACCEL1_PEDAL_MAX = 3409; // 3330 -const int ACCEL2_PEDAL_MAX = 259; // 388 +const int ACCEL1_PEDAL_MAX = 3491; +const int ACCEL2_PEDAL_MAX = 189; -const int ACCEL1_PEDAL_MIN = 2129; -const int ACCEL2_PEDAL_MIN = 1517; +const int ACCEL1_PEDAL_MIN = 2244; +const int ACCEL2_PEDAL_MIN = 1405; -const int BRAKE1_PEDAL_MAX = 1945; // 2200; -const int BRAKE2_PEDAL_MAX = 1742; // 2200; +const int BRAKE1_PEDAL_MAX = 1945; +const int BRAKE2_PEDAL_MAX = 1742; -const int BRAKE1_PEDAL_MIN = 1230; // 785; // 1230 to 1750 -const int BRAKE2_PEDAL_MIN = 2437; // 785; // 2450 to 1930 +const int BRAKE1_PEDAL_MIN = 1192; +const int BRAKE2_PEDAL_MIN = 2476; const int ACCEL1_PEDAL_OOR_MIN = 90; const int ACCEL2_PEDAL_OOR_MIN = 90; diff --git a/platformio.ini b/platformio.ini index e1b05a785..9de9847a3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -55,7 +55,7 @@ extra_scripts = pre:extra_script.py lib_deps = ${common.lib_deps_shared} SPI - https://github.com/hytech-racing/shared_firmware_interfaces.git#feature/thermistor-template + https://github.com/hytech-racing/shared_firmware_interfaces.git#shared_types https://github.com/tonton81/FlexCAN_T4 https://github.com/ssilverman/QNEthernet#v0.26.0 https://github.com/RCMast3r/hytech_can#testing_new_inv_ids diff --git a/test/test_systems/pedals_system_test.h b/test/test_systems/pedals_system_test.h index 36fa6a812..dc0f19a1c 100644 --- a/test/test_systems/pedals_system_test.h +++ b/test/test_systems/pedals_system_test.h @@ -273,12 +273,15 @@ TEST(PedalsSystemTesting, test_accel_and_brake_pressed_at_same_time_and_activati TEST(PedalsSystemTesting, test_implausibility_duration) { AnalogConversion_s test_accel1_val = {2583, 0.37, AnalogSensorStatus_e::ANALOG_SENSOR_GOOD}; - AnalogConversion_s test_accel2_val = {1068, 0.37, AnalogSensorStatus_e::ANALOG_SENSOR_GOOD}; - AnalogConversion_s test_brake_val = {1510, get_pedal_conversion_val(BRAKE1_PEDAL_MIN, BRAKE1_PEDAL_MAX, 1510), AnalogSensorStatus_e::ANALOG_SENSOR_GOOD}; + AnalogConversion_s test_accel2_val = {1068, 1.00, AnalogSensorStatus_e::ANALOG_SENSOR_GOOD}; + AnalogConversion_s test_brake_val = {1510, get_pedal_conversion_val(BRAKE1_PEDAL_MIN, BRAKE1_PEDAL_MAX, BRAKE1_PEDAL_MAX), AnalogSensorStatus_e::ANALOG_SENSOR_GOOD}; PedalsSystem pedals(get_real_accel_pedal_params(), get_real_brake_pedal_params()); auto data = pedals.evaluate_pedals(test_accel1_val, test_accel1_val, test_brake_val, test_brake_val, 1000); + + std::cout << data.accelPressed <