Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BT.CPP: cleanup solution to problems #78

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion technologies/BehaviorTree.CPP/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For instance, consider this sample XML in [trees/navigation_demo.xml](pyrobosim_

NOTE: remember that the `name` attribute in the XML is optional and used for debugging only.

You can run the BeahviorTree with the command:
You can run the Behavior Tree with the command:

```bash
ros2 run pyrobosim_btcpp btcpp_executor --ros-args -p tree:=trees/navigation_demo.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ int main(int argc, char** argv)
BT::RosNodeParams params;
params.nh = nh;
params.default_port_value = "execute_action";
params.wait_for_server_timeout = std::chrono::seconds(5);

factory.registerNodeType<BT::IsBatteryLow>("IsBatteryLow", nh->get_logger());
factory.registerNodeType<BT::IsBatteryFull>("IsBatteryFull", nh->get_logger());
Expand Down
21 changes: 5 additions & 16 deletions technologies/BehaviorTree.CPP/pyrobosim_btcpp/trees/problem1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,11 @@

<BehaviorTree ID="MainTree">
<Sequence>
<Navigate name="ToPantry" target="pantry"/>
<IfThenElse>
<DetectObject name="DetectSnack" object="snacks0"/>
<Sequence name="DetectedTrue">
<PickObject name="PickSnack" object="snacks0"/>
<Navigate name="ToTableWithSnack" target="table"/>
<PlaceObject name="PlaceSnack" object="snacks0"/>
</Sequence>
<Navigate name="ToTableWithoutSnack" target="table"/>
</IfThenElse>
<Sequence name="DetectSnackBackToPantry">
<PickObject name="PickSnack" object="snacks0"/>
<Navigate name="ToPantry" target="pantry"/>
<PlaceObject name="PlaceSnack" object="snacks0"/>
<Navigate name="ToTable" target="table"/>
</Sequence>
<Navigate name="goto_pantry" target="pantry"/>
<DetectObject name="detect_snack" object="snacks0"/>
<PickObject name="pick_snack" object="snacks0"/>
<Navigate name="goto_table" target="table"/>
<PlaceObject name="place_snack" object="snacks0"/>
</Sequence>
</BehaviorTree>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<BehaviorTree ID="MainTree">
<Sequence>
<Fallback>
<Navigate name="ToTrash" target="dumpster"/>
<Navigate name="goto_trash" target="dumpster"/>
<Sequence>
<Navigate name="ToTrash" target="hall_dining_trash"/>
<Navigate name="goto_door" target="hall_dining_trash"/>
<Open target="hall_dining_trash"/>
<Navigate name="ToTrash" target="dumpster"/>
<Navigate name="goto_trash_2" target="dumpster"/>
</Sequence>
</Fallback>
<Open target="dumpster"/>
<Navigate name="ToTable" target="table"/>
<Navigate name="goto_table" target="table"/>
</Sequence>
</BehaviorTree>

Expand Down
Loading