Skip to content

Commit a1bde75

Browse files
committed
(roseus_bt) Use SubTreePlus instead of SubTree
1 parent a608bed commit a1bde75

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

roseus_bt/include/roseus_bt/xml_parser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ void XMLParser::check_xml_file(std::string filename) {
164164
name != "RemoteCondition" &&
165165
name != "Subscriber" &&
166166
name != "RemoteSubscriber" &&
167+
name != "SubTreePlus" &&
167168
name != "SubTree") {
168169
throw XMLError::UnknownNode(node);
169170
}

roseus_bt/sample/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ rosrun groot Groot
148148

149149
The fifth example https://github.com/Affonso-Gui/jsk_roseus/blob/roseus_bt/roseus_bt/sample/models/t05_subtrees.xml wraps up the previous task in a subtree and adds another example task.
150150

151-
Nested trees can be defined with multiple `<BehaviorTree/>` tags and referenced with the `<SubTree/>` tag.
151+
Nested trees can be defined with multiple `<BehaviorTree/>` tags and referenced with the `<SubTree/>` or `<SubTreePlus/>` tag. The `<SubTreePlus/>` allows for passing both port mappings and/or static values to the subtree, and should be generally preferred over the `<SubTree/>` notation.
152152

153153
Each subtree inherits a separate blackboard and accepts remaps in the `inner_name="outer_name"` syntax.
154154

roseus_bt/sample/models/t05_subtrees.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<Action ID="InitWithBroom" name="Initialize Task"/>
77
<Action ID="setCoords" name="setBottleCoords" coords="${bottle_coords}"/>
88
<Sequence>
9-
<SubTree ID="PourTask" coords="bottle_coords"/>
10-
<SubTree ID="SweepTask"/>
9+
<SubTreePlus ID="PourTask" coords="bottle_coords"/>
10+
<SubTreePlus ID="SweepTask"/>
1111
</Sequence>
1212
</SequenceStar>
1313
</BehaviorTree>
@@ -37,8 +37,8 @@
3737
</BehaviorTree>
3838
<!-- ////////// -->
3939
<TreeNodesModel>
40-
<SubTree ID="PourTask"/>
41-
<SubTree ID="SweepTask"/>
40+
<SubTreePlus ID="PourTask"/>
41+
<SubTreePlus ID="SweepTask"/>
4242

4343
<Action ID="InitWithBroom" server_name="/t05_subtrees/init"/>
4444
<Action ID="MoveTo" server_name="/t05_subtrees/moveto">

roseus_bt/sample/models/t06_reactive.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<Sequence>
1010
<ReactiveFallback>
1111
<Condition ID="CheckTrue" value="${needs_drink}" name="NeedsDrink"/>
12-
<SubTree ID="SweepTask"/>
12+
<SubTreePlus ID="SweepTask"/>
1313
</ReactiveFallback>
14-
<SubTree ID="PourTask" coords="bottle_coords"/>
14+
<SubTreePlus ID="PourTask" coords="bottle_coords"/>
1515
</Sequence>
1616
</SequenceStar>
1717
</BehaviorTree>
@@ -39,10 +39,10 @@
3939
</BehaviorTree>
4040
<!-- ////////// -->
4141
<TreeNodesModel>
42-
<SubTree ID="PourTask">
42+
<SubTreePlus ID="PourTask">
4343
<input_port default="bottle_coords" name="coords" type=""/>
44-
</SubTree>
45-
<SubTree ID="SweepTask"/>
44+
</SubTreePlus>
45+
<SubTreePlus ID="SweepTask"/>
4646

4747
<Action ID="InitWithBroom" server_name="/t06_reactive/init"/>
4848
<Action ID="MoveTo" server_name="/t06_reactive/moveto">

roseus_bt/sample/models/t07_xacro.xml.xacro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<Action ID="InitWithBroom" name="Initialize Task"/>
1515
<Action ID="setCoords" name="setBottleCoords" coords="$${bottle_coords}"/>
1616
<Sequence>
17-
<SubTree ID="PourTask" coords="bottle_coords"/>
18-
<SubTree ID="SweepTask"/>
17+
<SubTreePlus ID="PourTask" coords="bottle_coords"/>
18+
<SubTreePlus ID="SweepTask"/>
1919
</Sequence>
2020
</SequenceStar>
2121
</BehaviorTree>
@@ -25,8 +25,8 @@
2525
<xacro:sweep_task.generate_bt ID="SweepTask"/>
2626
<!-- ////////// -->
2727
<TreeNodesModel>
28-
<SubTree ID="PourTask"/>
29-
<SubTree ID="SweepTask"/>
28+
<SubTreePlus ID="PourTask"/>
29+
<SubTreePlus ID="SweepTask"/>
3030

3131
<Action ID="InitWithBroom" server_name="${namespace}/init"/>
3232
<Action ID="setCoords" server_name="${namespace}/setcoords">

0 commit comments

Comments
 (0)