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

feat: ✨ Expose PID, exits, and slew to be modified #177

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

meisZWFLZ
Copy link
Member

@meisZWFLZ meisZWFLZ commented Apr 23, 2024

Summary

Allows chassis settings to be modified post-construction of the chassis, all in a thread safe / atomic manner. It also adds the ability to have any number of exit conditions and configure them in a much cleaner manner.

PID gains and slew can be changed mid motion, but changing exit conditions mid motion will not take effect until the next motion runs.

Motivation

Before, an advanced user would have to edit headers to modify chassis settings after chassis construction, risking headaches due to thread-unsafety, but now it's a built-in thread-safe feature.

Also having two different exit conditions annoyed me.

Test Plan

I will not be able to test it, but ideally the following tests should be run:

  • check that the same controller settings behaves the same before this PR and with this PR
  • change all 5 PID gains mid-motion and observe an distinct change in behavior
  • change 1-4 PID gains mid-motion and observe a distinct change in behavior
  • change slew mid-motion and a distinct change in behavior
  • add an exit condition mid-motion and observe a a distinct change in behavior only in the next motion
  • clear all exit conditions and observe the motion running until the its timeout
  • check that PID, slew, and exit conditions persist to the next motion

Additional Notes

Needs docs / comments

If exit conditions seem to goof, then just use commit 1409044, as I doubt the exit conditions can be fixed in a timely manner.

Download the template for this pull request:

Note

This is auto generated from Add Template to Pull Request

curl -o [email protected] a196c1.zip https://nightly.link/LemLib/LemLib/actions/artifacts/1440375098.zip;
pros c fetch [email protected] a196c1.zip;
pros c apply [email protected] a196c1;
rm [email protected] a196c1.zip;

@meisZWFLZ meisZWFLZ added enhancement New feature or improvement Needs Testing labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement Needs Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant