ROS2 add_on_set_parameters_callback not trigger with open loop
Hi,
On the galactic version, I use add_on_set_parameters_callback function to update my node parameters.
However, if I use open while loop, parameters callback function is not updating. If I don't add "while loop" in my code, callback function can trigger. Also I noticed, after while loop added than check the parameters
ros2 param list
while calling service of node '/NodeA': None
I think this issue because of the ros2 design. The same problem did not happen when I used timer instead of while loop. But should I use a timer instead of a loop? I don't think this should be the solution.
this->declare_parameter("parameter");
param_cb_ =
this->add_on_set_parameters_callback(std::bind(&NodeA::ParameterCallback, this, std::placeholders::_1));
// // try to read parameters from parameter server until it is successfully read
// If I add this loop
while (rclcpp::ok())
{
// continue loop
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}