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

✨[FEATURE REQUEST] Reapply motor configuration on motor reconnect #702

Closed
SizzinSeal opened this issue Oct 5, 2024 · 3 comments
Closed
Labels
enhancement This builds on top of an existing feature

Comments

@SizzinSeal
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Some motor configurations are stored on volatile memory onboard the motor. This memory is reset when the motor disconnects.

What is the behavior that isn't addressed by the existing API?
Motor configuration should be reapplied when the motor reconnects.

OPTIONAL Describe any solutions you've considered
The configuration of every motor should be stored by PROS, as well as whether the motor was connected last cycle or not. If the motor was not connect last cycle, but is during the current cycle, then the last saved configuration needs to be applied. This will require checks on every port every 10ms.
Ideally, this would be implemented in the "C side" of the PROS kernel, so this feature still works if motors are configured using the C API. This would require a static array of 21 structs for each of the 21 ports on the brain, or alternatively a dynamic array, but using a dynamic array introduces opportunities for bugs, although it would be smaller.
Every struct in the array contains the configuration of a motor on a specific port. This struct is updated every time a configuration function is called. Alternatively, the configuration of a motor could be checked every cycle.

Additional context
This is done to an extent by VexOS, but this is limited to motor cartridge and reversal. Ideally this would be handled by VexOS, but its unlikely that this would ever get implemented into VexOS.

I ran into this problem while working on the LemLib/hardware project. Implementing this functionality user-side has many limitations and is harder than opening a PR to add this functionality to the PROS kernel.

@SizzinSeal SizzinSeal added the enhancement This builds on top of an existing feature label Oct 5, 2024
@SizzinSeal
Copy link
Contributor Author

Sources conflict about whether VEXOS handles all configurations or not, so this will need hardware testing to verify

@thiccaxe
Copy link

thiccaxe commented Oct 5, 2024

related to #641

@SizzinSeal
Copy link
Contributor Author

So I've done some testing, and all configurations are stored. I did not test the PID constants, but those are deprecated anyway. This issue is invalid

@SizzinSeal SizzinSeal closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This builds on top of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants