diff --git a/nav2_costmap_2d/src/costmap_2d_publisher.cpp b/nav2_costmap_2d/src/costmap_2d_publisher.cpp index 58c7d43d56..a713ace130 100644 --- a/nav2_costmap_2d/src/costmap_2d_publisher.cpp +++ b/nav2_costmap_2d/src/costmap_2d_publisher.cpp @@ -81,7 +81,7 @@ Costmap2DPublisher::Costmap2DPublisher( // Create a service that will use the callback function to handle requests. costmap_service_ = node->create_service( - "get_costmap", std::bind( + "get_" + topic_name, std::bind( &Costmap2DPublisher::costmap_service_callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));