diff --git a/moveit_ros/planning/moveit_cpp/src/moveit_cpp.cpp b/moveit_ros/planning/moveit_cpp/src/moveit_cpp.cpp index e6ba420d70..609eddcaee 100644 --- a/moveit_ros/planning/moveit_cpp/src/moveit_cpp.cpp +++ b/moveit_ros/planning/moveit_cpp/src/moveit_cpp.cpp @@ -217,30 +217,14 @@ const std::map& MoveItCpp:: std::set MoveItCpp::getPlanningPipelineNames(const std::string& group_name) const { - std::set result_names; - if (!group_name.empty() && groups_pipelines_map_.count(group_name) == 0) + if (group_name.empty() || groups_pipelines_map_.count(group_name) == 0) { RCLCPP_ERROR(LOGGER, "No planning pipelines loaded for group '%s'. Check planning pipeline and controller setup.", group_name.c_str()); - return result_names; // empty + return {}; // empty } - for (const auto& pipeline_entry : planning_pipelines_) - { - const std::string& pipeline_name = pipeline_entry.first; - // If group_name is defined and valid, skip pipelines that don't belong to the planning group - if (!group_name.empty()) - { - const auto& group_pipelines = groups_pipelines_map_.at(group_name); - if (group_pipelines.find(pipeline_name) == group_pipelines.end()) - continue; - } - result_names.insert(pipeline_name); - } - // No valid planning pipelines - if (result_names.empty()) - RCLCPP_ERROR(LOGGER, "No planning pipelines loaded for group '%s'. Check planning pipeline and controller setup.", - group_name.c_str()); - return result_names; + + return groups_pipelines_map_.at(group_name); } const planning_scene_monitor::PlanningSceneMonitorPtr& MoveItCpp::getPlanningSceneMonitor() const