diff --git a/realsense2_camera/src/base_realsense_node.cpp b/realsense2_camera/src/base_realsense_node.cpp index 368d2f10c1..9870d3ac59 100755 --- a/realsense2_camera/src/base_realsense_node.cpp +++ b/realsense2_camera/src/base_realsense_node.cpp @@ -121,9 +121,6 @@ BaseRealSenseNode::BaseRealSenseNode(rclcpp::Node& node, ROS_INFO("Intra-Process communication enabled"); } - // Get node name - _camera_name = _node.get_name(); - initializeFormatsMaps(); _monitor_options = {RS2_OPTION_ASIC_TEMPERATURE, RS2_OPTION_PROJECTOR_TEMPERATURE}; } diff --git a/realsense2_camera/src/parameters.cpp b/realsense2_camera/src/parameters.cpp index 14accf94f0..72523cb801 100644 --- a/realsense2_camera/src/parameters.cpp +++ b/realsense2_camera/src/parameters.cpp @@ -24,6 +24,10 @@ void BaseRealSenseNode::getParameters() std::string param_name; + param_name = std::string("camera_name"); + _camera_name = _parameters->setParam(param_name, "camera"); + _parameters_names.push_back(param_name); + param_name = std::string("publish_tf"); _publish_tf = _parameters->setParam(param_name, PUBLISH_TF); _parameters_names.push_back(param_name);