Skip to content

Commit

Permalink
Better feedback on no grasps found
Browse files Browse the repository at this point in the history
  • Loading branch information
dekent committed May 26, 2017
1 parent 048bcef commit 9f41b11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion agile_grasp_base/src/agile_grasp/grasp_localizer.cpp
Expand Up @@ -144,7 +144,10 @@ void GraspLocalizer::executeFind(const rail_agile_grasp_msgs::FindGraspsGoalCons
finalGrasps.grasps = createRailGraspsMsg(hands_);
finalGrasps.workspace = goal->workspace;
grasps_with_workspace_pub_.publish(finalGrasps);
result.success = true;
if (finalGrasps.grasps.grasps.empty())
result.success = false;
else
result.success = true;
server.setSucceeded(result);
return;
}
Expand Down
4 changes: 4 additions & 0 deletions rail_agile_nodes/src/GraspSampler.cpp
Expand Up @@ -254,6 +254,8 @@ void GraspSampler::graspsCallback(const rail_agile_grasp_msgs::GraspsWithWorkspa
if (croppedCloud->size() == 0)
{
ROS_INFO("No points in plane-removed point cloud, cannot calculate grasps...");
finalPoses.poses.clear();
graspsPublisher.publish(finalPoses);
return;
}
kdTree->setInputCloud(croppedCloud);
Expand Down Expand Up @@ -284,6 +286,8 @@ void GraspSampler::graspsCallback(const rail_agile_grasp_msgs::GraspsWithWorkspa
if (clusters.empty())
{
ROS_INFO("No clusters could be extracted after plane removal, cannot calculate grasps...");
finalPoses.poses.clear();
graspsPublisher.publish(finalPoses);
return;
}

Expand Down

0 comments on commit 9f41b11

Please sign in to comment.