Bug report
Required Info:
- Operating System:
- Installation type:
- Version or commit hash:
- DDS implementation:
- Client library (if applicable):
Steps to reproduce issue
Build the following node:
#include <iostream>
#include <memory>
#include "rclcpp/rclcpp.hpp"
int main(int argc, char ** argv)
{
rclcpp::init(argc, argv);
auto node = std::make_shared<rclcpp::Node>("foo_node");
auto param_change_callback =
[](std::vector<rclcpp::Parameter> parameters)
{
std::cerr << "Parameter callback" << std::endl;
auto result = rcl_interfaces::msg::SetParametersResult();
result.successful = true;
return result;
};
auto param_callback_handle = node->add_on_set_parameters_callback(param_change_callback);
rclcpp::spin(node);
rclcpp::shutdown();
return 0;
}
Run it and then set the use_sim_time parameter on it:
ros2 param set /foo_node use_sim_time true
Expected behavior
The parameter is set successfully and the registered callback is called once.
Actual behavior
The parameter is set successfully and the registered callback is called five times.
Additional information
I've experimented with a user-defined parameter, and do not experience this issue (i.e. the parameter callback is called exactly once).
Bug report
Required Info:
Steps to reproduce issue
Build the following node:
Run it and then set the
use_sim_timeparameter on it:Expected behavior
The parameter is set successfully and the registered callback is called once.
Actual behavior
The parameter is set successfully and the registered callback is called five times.
Additional information
I've experimented with a user-defined parameter, and do not experience this issue (i.e. the parameter callback is called exactly once).