You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (max_observed_analog > min_observed_analog && _steeringParams.span_signal_analog > 2500) //NOLINT with 360 deg analog sensor, typical span is about 2000
34
34
{
35
35
min_observed_analog = UINT32_MAX; // after calculating params, if the range is marginally greater than half the steering wheel adc, likely the min and max are clinging to a prior run that is not applicable, meaning we will need to reset the boundaries.
36
36
max_observed_analog = 0;
37
37
}
38
-
if (max_observed_digital > min_observed_digital && _steeringParams.span_signal_digital > 9000)
38
+
if (max_observed_digital > min_observed_digital && _steeringParams.span_signal_digital > 9000)// NOLINT with digital sensor, typical span is about 9000
_steeringSystemData.analog_steering_angle = filtered_analog_angle; // update the angle to the filtered value for downstream use and velocity calculation
_steeringSystemData.analog_steering_velocity_deg_s = (dtheta_analog / static_cast<float>(dt)) * 1000.0f;// NOLINT 1000.0f is result of converting dt in millis to seconds
_steeringSystemData.digital_steering_velocity_deg_s = (dtheta_digital / static_cast<float>(dt)) * 1000.0f;// NOLINT 1000.0f is result of converting dt in millis to seconds
if (min_observed_analog < 5)// NOLINT want to prevent sticking at 0 or clipping with small value
144
145
{
145
146
min_observed_analog = UINT32_MAX; // clipping if it is at 0, it is likely sensor is clipping or clipped in past and reading is holding the 0 value.
146
147
}
147
-
if (max_observed_analog > 3685)
148
+
if (max_observed_analog > 3675) // NOLINT prevents clipping, this is slightly less than calculated value of actual max output of sensor with current resistor divider on VCF's ADC
148
149
{
149
150
max_observed_analog = 0; // clipping
150
151
}
151
-
if (min_observed_digital < 5)
152
+
if (min_observed_digital < 10) // NOLINT want to prevent sticking at 0 or clipping
152
153
{
153
154
min_observed_digital = UINT32_MAX; // clipping on prior run.
154
155
}
155
-
if (max_observed_digital > 16384)
156
+
if (max_observed_digital > 16374) // NOLINT 16374 = 2^14 - 10 to prevent clipping with 14 bit resolution on sensor
.analog_min_with_margins = EEPROMUtilities::read_eeprom_32bit(VCFSystemConstants::ANALOG_MIN_WITH_MARGINS_ADDR),// NOLINT this is prev saved value so it is ok
760
+
.analog_max_with_margins = EEPROMUtilities::read_eeprom_32bit(VCFSystemConstants::ANALOG_MAX_WITH_MARGINS_ADDR),// NOLINT this is prev saved value so it is ok
761
+
.digital_min_with_margins = EEPROMUtilities::read_eeprom_32bit(VCFSystemConstants::DIGITAL_MIN_WITH_MARGINS_ADDR),// NOLINT this is prev saved value so it is ok
762
+
.digital_max_with_margins = EEPROMUtilities::read_eeprom_32bit(VCFSystemConstants::DIGITAL_MAX_WITH_MARGINS_ADDR),// NOLINT this is prev saved value so it is ok
0 commit comments