Recover basic configuration from SparkMax and SparkFlex #40
Replies: 4 comments 3 replies
-
I notice non of the config class have a getter. This mean there is no way to copy it with recover every value one by one , by adding a getter we can copy the whole config class at once |
Beta Was this translation helpful? Give feedback.
-
I am going to convert this to a discussion because I don't think it addresses a code issue with REVLib, rather a question/suggestion for the library. |
Beta Was this translation helpful? Give feedback.
-
What would be the benefits of doing it this way? If the user wants to retrieve a parameter from the device, they can use the Config classes are set up such that they are only structures that allow the user to declaratively specify which parameters they want to be set. If a parameter is not specified in the config, they will not be modified on the device unless If you want to configure the device from its current state, you would pass |
Beta Was this translation helpful? Give feedback.
-
In terms of organization, I agree that something like this would be better. The reason we have some straggler configurations is because they didn't all fit into one single category. However, what would be the benefits of doing it like this, other than for conceptual organization? |
Beta Was this translation helpful? Give feedback.
-
There is no way to recover basic configuration from SparkMax and SparkFlex. The new library for 2025 add the capabilities to recover
AbsoluteEncoderConfig , EncoderConfig, ect , but you need to still recover every basic parameters (like the IdleMode, Inverted and all other than are not grouped in classes ) from it getter and set it in a new configuration before applying to new controller.
Will be nice to get the configuration from the controller like:
SparkMaxConfig myconfig = new SparkMaxConfig(mymotor);
then be able to change the parameters wanted to change or have a dedicated BasicConfig class than can be access the configAccessor and return
a the instance of the controller's BasicConfig
from this hierarchy:
To something like this?
Beta Was this translation helpful? Give feedback.
All reactions