Addition of persistent parameter saving, loading to file and clearing #706
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note that this pull request depends on bitcraze/crazyflie-lib-python#443
This pull request primarily focuses on the addition of parameter file loading and saving capabilities. These new features allow users to store and retrieve persistent parameter configurations to/from file, improving usability and efficiency. Furthermore, it adds a clear
Key changes include:
Parameter File Loading: The
_load_param_button_clicked
method has been added, which allows users to load persistent parameters from a YAML file. The method reads the file usingParamFileManager.read
and sets the parameter values accordingly.Parameter File Saving: The
_dump_param_button_clicked
method has been added, which allows users to save the current parameters to a YAML file. The method retrieves the current parameters and their values and writes them to the file usingParamFileManager.write
.Persistent Parameter Clearing: The
_clear_persistent_parameter
method has been added, which allows users to clear a specific persistent parameter. The method sends a clear request for the given parameter to the Crazyflie usingself.cf.param.persistent_clear
. It uses a callback functionis_stored_cleared
to handle the result of the clearing operation and anEvent
objectwait_for_callback_event
to wait for the operation to complete. If the operation is successful, a message indicating the cleared parameter is printed. If the operation fails, a failure message is printed.Parameter IO GUI: The parameter tab has been updated to include buttons for loading and saving parameter files, and for clearing the stored persistent parameters. These buttons are enabled or disabled based on the connection state.
Error Handling: If setting a parameter value or storing a parameter persistently from a loaded file fails, a warning message is displayed to the user.