Add Conditional Execution Support with IfNode#19
Merged
miguelgarcia merged 20 commits intomainfrom Dec 4, 2025
Merged
Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
inorbit_edge_executor/inorbit.py
Outdated
| current_task_id = self._find_current_task_id() | ||
| if current_task_id: | ||
| req["currentTaskId"] = current_task_id | ||
| print(f"Reporting tasks: {req}") |
There was a problem hiding this comment.
Bug: Debugging print statement left in production code
A print(f"Reporting tasks: {req}") statement was accidentally left in the report_tasks method. This will output task information to stdout during production execution, which is unintended debug output. The proper logging mechanism (logger) is already used elsewhere in this class and file.
Member
Author
|
Hey @b-Tomas can you review? I extended the executor to support the new |
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.
Add Conditional Execution Support with IfNode
Summary
This PR introduces conditional execution to the behavior tree system by implementing an
IfNodethat evaluates expressions and conditionally executes either a "then" or "else" branch based on the result. This enables mission definitions to include conditional logic based on robot state, sensor values, or other runtime conditions.Implementing the new step required various changes related to the introduction of support for nested steps (Previously, no mission step had child steps). This presented some challenges since, for example, when translating a mission definition into a behavior tree, all steps in the then and else branches needed to be wrapped with timeout handling, task completion reporting, etc.
Demo
screenrecording-2025-12-03_13-36-26.mp4
Changes
Core Implementation
IfNodeclass (behavior_tree.py): New behavior tree node that:then_branchwhen expression evaluates toTrueelse_branchwhen expression evaluates toFalse(optional)MissionStepIfdatatype (datatypes.py): New mission step type that:thenand optionalelsebranches (lists of mission steps)Visitor pattern integration (
behavior_tree.py):visit_ifmethod toNodeFromStepBuilderto convertMissionStepIftoIfNodeSupporting Changes
MissionTasksExtractorclass (mission.py): New helper class that:Base class improvements (
datatypes.py):acceptmethod toMissionStepbase class to enforce visitor pattern implementationTesting
Comprehensive test suite (
tests/test_if_node.py): 393 lines of tests covering:Integration tests (
tests/test_behavior_tree.py): Updated to verify if step parsing and tree buildingExamples
example.py): Added demonstration of if step usage with then/else branches containing waypoint stepsTechnical Details
Expression Evaluation
Branch Execution
Falseand no else branch exists, the node succeeds (no-op)Serialization
Usage Example
Breaking Changes
None. This is a purely additive feature that maintains backward compatibility.
Anyway I think we need to bump the major version since this introduces a new step that connector implementors should at least be aware of.