Fix: Misleading error for unrecognized behavior ports#19
Merged
griswaldbrooks merged 1 commit intomainfrom Apr 10, 2026
Merged
Conversation
Use type_ID instead of element->Name() so the error prints the actual behavior name (e.g. GetEpickObjectDetectionStatus) rather than the generic XML tag (e.g. Action). Use element->GetLineNum() instead of att->GetLineNum() for a correct line number. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dsobek
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
type_IDinstead ofelement->Name()so the error prints the actual behavior name (e.g.,ClearSnapshot) rather than the generic XML tag (e.g.,Action).element->GetLineNum()instead ofatt->GetLineNum()for a more accurate line number.Fixes PickNikRobotics/moveit_pro#18029
Before:
After:
Note on line numbers
Line numbers may not match the original XML file because MoveIt Pro's objective server reformats the XML through
tinyxml2::XMLPrinterbefore passing it to BehaviorTree.CPP (seeload_objective_definitions.cpp). The line numbers reported are relative to the reformatted XML, not the original file. Fixing this offset is out of scope for this PR — the behavior name is the more important improvement for debugging.Test plan
behaviortree_cppin the MoveIt Pro containerprovidedPorts()fromClearSnapshotand adding atopic_nameport in the objective XML🤖 Generated with Claude Code