-
Notifications
You must be signed in to change notification settings - Fork 76
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
Fix problem when loading ros parameters in registerVariable #9
base: kinetic-devel
Are you sure you want to change the base?
Fix problem when loading ros parameters in registerVariable #9
Conversation
…ing callbacks. Method registerVariable (using callbacks) reads the corresponding ros parameter, but it does not return the updated value [current_value] after calling the method. Add a reference instead. Signed-off-by: Francisco Garcia Rosas <[email protected]>
Hi @francisc0garcia I apologize for not looking at this sooner. The idea with the callback version of the functions is that you modify the variable in the callback. |
@v-lopez I think like @francisc0garcia that is a bug. The user, as per the documentation, expects that if the value is changed on the user domain the variable is updated. I could understand that the user might also expect that, if the variable if changed either from outside or inside, the callback will be called. This could be handled either by :
Personally I rather use option 2 as option 1 might lead to circular updates and introduce a new paradigm that the user might not feel comfortable with. If so, then the documentation should express that the callback will only be called when the parameter is updated from the outside only and not from the inside. |
Another way that i can think of would be to extend the API and add a new type |
I believe I did not understand the original issue from @francisc0garcia. The issue is that if you modify the variable inside your application, the change is not reflected on the dynamic_reconfigure API. The But I agree that there is a use case where you do have a variable that you update in your code, and can be updated externally, and also you want to be notified in a callback if it's updated. In hindsight, I should have added an optional argument to the default RegisterVariable that is a function to be called on update. I'm trying to find the best way of adding this without breaking API/ABI. |
Method registerVariable (with callbacks) reads the corresponding ros
parameter, but it can not return the updated value [current_value]
after calling the method, because it isn't a reference. Now it is a reference.
Signed-off-by: Francisco Garcia Rosas [email protected]