How can I identify the type of parameter event with set_on_parameters_set_callback()
According to the latest dashing code, it recommends us use setonparameterssetcallback() instead of registerparamchangecallback(). I am wondering what the benefit it will bring to us, as I find it is hard to identify the type of parameter event(add or change). In contrast, I can easily know the type by ParameterEvent.msg if I use registerparamchangecallback().
As mentioned in API docs:
Note that the callback is called when declare_parameter() and its variants are called, and so you cannot assume the parameter has been set before this callback, so when checking a new value against the existing one, you must account for the case where the parameter is not yet set.
However, my question is how can I handle the case where the parameter is not yet set. Is there any example available for reference?
Asked by xhuan28 on 2019-08-12 03:46:08 UTC
Comments