Added checks to handle partially empty toolpaths #198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses a bug in the
PlanToolPathServiceNodeClass insnp_bt_ros_nodes.cppwhere if toolpaths are present in the service request (!response->tool_paths.empty()) but the toolpaths withintool_pathsare empty (response->tool_paths.tool_paths.empty() == true) the behavior tree node will succeed, it will publish an empty toolpath, and it will not provide meaningful feedback to the user.The following has been added as part of this PR to address this:
BT::NodeStatus::SUCCESSin thetext_edit_loggerWhen a toolpath is partially empty (ex: when two regions are circled with the
Polygon Selection Tooland theROISelectionmesh modifier is applied, and one region contains a toolpath and the other region contains an empty toolpath) the behavior tree node will returnBT::NodeStatus::SUCCESS, generate the nonempty toolpath, and warn the user in thetext_edit_loggerthat there are other toolpaths that may be empty. This allows the user to more easily see which toolpaths succeeded in generating and which did not.See below for an example from the

text_edit_logger:Warning messages can also be added to accompany
BT::NodeStatus::SUCCESSmessages to give the developer the ability to generate warnings for BT Nodes that have succeeded but may contain unexpected output that is not severe enough to return aBT::NodeStatus::FAILURE.