Skip to content

Commit

Permalink
Merge branch 'main' into rdf_spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Vatan Aksoy Tezer authored Mar 22, 2022
2 parents 9bdd51b + 1b08006 commit 30f5b47
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions moveit_ros/planning/moveit_cpp/src/moveit_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,30 +217,14 @@ const std::map<std::string, planning_pipeline::PlanningPipelinePtr>& MoveItCpp::

std::set<std::string> MoveItCpp::getPlanningPipelineNames(const std::string& group_name) const
{
std::set<std::string> 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
Expand Down

0 comments on commit 30f5b47

Please sign in to comment.