diff --git a/rtabmap_slam/src/CoreWrapper.cpp b/rtabmap_slam/src/CoreWrapper.cpp index 4a22e6590..9e55ce977 100644 --- a/rtabmap_slam/src/CoreWrapper.cpp +++ b/rtabmap_slam/src/CoreWrapper.cpp @@ -328,10 +328,12 @@ CoreWrapper::CoreWrapper(const rclcpp::NodeOptions & options) : { RCLCPP_WARN(get_logger(), "Node paused... don't forget to call service \"resume\" to start rtabmap."); } + + const std::map & overrides = this->get_node_parameters_interface()->get_parameter_overrides(); for(ParametersMap::iterator iter=allParameters.begin(); iter!=allParameters.end(); ++iter) { std::string vStr = this->declare_parameter(iter->first, iter->second); - if(vStr.compare(iter->second)!=0) + if(overrides.find(iter->first) != overrides.end()) { RCLCPP_INFO(this->get_logger(), "Setting RTAB-Map parameter \"%s\"=\"%s\"", iter->first.c_str(), vStr.c_str());