-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Redesign dynamic parameters patterns #4907
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
Comments
I will work on this. |
Awesome, thanks @Nils-ChristianIseke ! |
Can I also help with this? |
@Sahas-Ananth Thanks for offering your help. I think at the moment i can handle it on my own. But i will reach out to you if i need support. |
An example of which callbacks should be introduced and what their respective function is can be found here. Parameter validations and auditing of the dynamic parameters should happen during adapting the architecture of the nodes, e.g:
Preliminary list of all nodes that need to be adjusted ( I searched the repo for add_on_set_parameters_callback) |
It might be nice to open PRs in 3-4 node segments so that the reviews can go faster and not block progress on all nodes for 1 node's small tweaks! |
Continuing parts of the discussion from PR#4971 here.
I had completely forgotten that this existed. As far as I know, this is not currently supported, but there is a possibility that I overlooked it. |
@SteveMacenski , what are your thoughts on generate_parameter_library? I’d like to use this, but I’m not sure if your concern (what if we want more custom parts of our parameter handler, like wanting to mutex lock parameter access for multi-threaded situations where the dynamic parameter executor is different from the running executor) |
I think for now, we should update the stack with our gameplan and not use the generate parameter library. After doing a look over a few of our uses of dynamic parameters, there are times that updates to specific parameters (or classes of parameters) also need to trigger actions like reinitalizations of objects. These also need to occur under the same mutex lock as changing the parameter so that other operations don't happen between when the parameter is updated and a potential post-change event callback is triggered that we could use to do so. Plus, I'm not sure if that library allows us to override dynamic parameter callbacks to check on values to do that process. I think that framework works for some nodes but not all, so I'd rather keep all of Nav2 consistent in design than cherry pick some percentage to do in another way. |
Great! Then I will continue to do that :) Thanks for writing down your reasoning! |
Sorry for the delay, my github notifications tray has too many thought-inducing topics that I'm not quite able to get them all done every day :-) I appreciate the patience |
@Sahas-Ananth After the first PR was merged (and can be used as template for future modifications) I would appreciate your help now :). You can have a look here to see how it should look at the end. |
Something brought up in #5100 would be to change all the plugins to skip looking at updates for parameters outside of their namespace. That way we only validity check parameters having directly to do with this algorithm rather than checking against all parameters in that node (of potentially many algorithms + the core server). There may be some exceptions where a plugin looks at server-specific values like control frequency, but those are the exceptions we can put in each algorithm as-needed rather than the rule |
It is brought to my attention dynamic parameter handling matured in Humble that allows us to use the
add_post_set_parameters_callback
instead ofadd_on_set_parameters_callback
for processing parameter updates into member functions. This was brought up from a conversation started by @pepisg and myself on MPPI dynamic parameter handling issues and explained in ros2/rclcpp#2735 by Chris. We should not be using the on_set one anymore and should be using the post- condition once the parameter updates have been accepted.The tl;dr minimum of this ticket is to: Update globally all of the
add_on_set_parameters_callback
to useadd_post_set_parameters_callback
instead and update the dynamic parameter callback if the signature changes. Update the on_set callback to contain any validity checking and post-set for actually making the state updates.This is a really nice first contribution that touches alot of code!
Secondarily, many nodes are not as well organized with larger sets of parameters like MPPI and RPP with parameter handler objects. Along with the migration, we should consider making that also a global pattern of having all objects have parameter handlers to manage the parameter's state and dynamic callbacks to simplify the application code and have consistency architecturally.
Also a really nice first-contribution that gets folks into the architecture a little!
The text was updated successfully, but these errors were encountered: