Skip to content

Conversation

@RyanPCo
Copy link

@RyanPCo RyanPCo commented Nov 20, 2025

No description provided.

uint32_t min_steering_2; // (optional) for redundant steering sensor
uint32_t max_steering_2;

uint32_t min_sensor_steering_1; // Min value that the sensor can output (if ADC reads less than this, sensor is likely unplugged)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you double-check this behavior of the steering sensor when you unplugged it?

steering_params = params;
}

const SteeringSystemData_s &get_steering_system_data() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! we should probably do this in more places throughout VCF

// min_observed_steering_2 = std::min(min_observed_steering_2, raw_value_2);
// max_observed_steering_2 = std::max(max_observed_steering_2, raw_value_2);
}
uint32_t min_observed_steering_1 = 4096;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did you get these values from? Might wanna #define them

_last_update_micros = curr_micros;

SteeringSystemData_s out = {};
out.steering_is_implausible = _evaluate_steering_implausibilities(static_cast<int>(steering_data.analog_steering_degrees), static_cast<int>(steering_params.min_sensor_steering_1), static_cast<int>(steering_params.max_sensor_steering_1), static_cast<int>(steering_params.min_steering_1), static_cast<int>(steering_params.max_steering_1), steering_params.implausibility_margin, dt);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't the _evaluate_steering_implausibilities method have access to the steering_params struct instance? They shouldn't need to be passed in as method arguments.

}

bool SteeringSystem::_evaluate_steering_dtheta(int steering_analog, float dt)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment explaining this.

return steering_less_than_min || steering_greater_than_max;
}

bool SteeringSystem::_evaluate_steering_oor(int steering_analog, int min_sensor_value, int max_sensor_value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

udpate this method signature to use params?

return steering_oor || steering_min_max_implaus || steering_dtheta;
}

bool SteeringSystem::_evaluate_min_max_steering_implausibilities(int steering_analog, int min_steering_value, int max_steering_value, float implausibility_margin)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update signature to use params


HT_TASK::TaskResponse update_steering_calibration_task(const unsigned long& sysMicros, const HT_TASK::TaskInfo& taskInfo) {
// Update observed steering limits (ONLY USED FOR RECALIBRATION)
SteeringSystemInstance::instance().update_observed_steering_limits(VCFData_sInstance::instance().interface_data.steering_data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this something we need to call if we're not in the recal state?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants