Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implausability restructure #74

Merged
merged 25 commits into from
Apr 19, 2024
Merged

Implausability restructure #74

merged 25 commits into from
Apr 19, 2024

Conversation

EricGalluzzi
Copy link
Contributor

Focused on fixing torque request when negative sloped accel sensor is disconnected. The electrical low-pass filter stage of the accel reading filters out the sharp response when removing the accel2 jumper, causing it to request an implausible accel percentage. The fix involves using accel1 as the primary torque requesting sensor when an implausibility is triggered.

unit tests added as needed.

Also added functionality for accepting absolute electrical minimum and maximum's of any pedals sensors in case we need it. Currently being used to set accel percent to 0 when we've exceeded any of those ranges.

closes #72
closes #70

src/main.cpp Outdated Show resolved Hide resolved
@walkermburns
Copy link
Contributor

walkermburns commented Apr 12, 2024

Logic looks good to me. This system still needs a ton of comments with direct references to the rules that they apply to, and better whitespace separating accel evaluations and brake evaluations for example. You can put a new member on this, and this does not prevent the merge although this needs to happen at some point.

@EricGalluzzi
Copy link
Contributor Author

Kept the ternary operators since changing to if statements seemed to increase clutter, reducing readability. One if statement was erroring the system so It was best to keep functional, yet simple ternary operators.

I'll have a new member add comments.

@walkermburns walkermburns merged commit afa6df7 into master Apr 19, 2024
2 checks passed
@RCMast3r RCMast3r deleted the implausability_restructure branch April 26, 2024 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants