Add behavior for i2cnode and choosing side
This commit is contained in:
61
mg_bt/behavior_trees/tactics.xml
Normal file
61
mg_bt/behavior_trees/tactics.xml
Normal file
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<root BTCPP_format="4">
|
||||
<BehaviorTree ID="tactic_base">
|
||||
<Sequence>
|
||||
<I2CSignal Address="66"
|
||||
Data="1"
|
||||
Result="{tactic_id}"
|
||||
action_name="/i2c_action"/>
|
||||
<SideObstaclePub tactic="{tactic_id}"
|
||||
topic_name="/side"/>
|
||||
<TacticChooser IsBlue="{isBlue}"
|
||||
tactic="{tactic}"
|
||||
number="{tactic_id}"/>
|
||||
<SubTree ID="tactic_default_yellow"
|
||||
_skipIf="isBlue"
|
||||
_autoremap="false"/>
|
||||
<SubTree ID="tatic_default_blue"
|
||||
_skipIf="!isBlue"/>
|
||||
</Sequence>
|
||||
</BehaviorTree>
|
||||
|
||||
<BehaviorTree ID="tactic_default_yellow">
|
||||
<AlwaysSuccess/>
|
||||
</BehaviorTree>
|
||||
|
||||
<BehaviorTree ID="tatic_default_blue">
|
||||
<AlwaysFailure/>
|
||||
</BehaviorTree>
|
||||
|
||||
<!-- Description of Node Models (used by Groot) -->
|
||||
<TreeNodesModel>
|
||||
<Action ID="I2CSignal">
|
||||
<input_port name="Address"
|
||||
default="42"
|
||||
type="int"/>
|
||||
<input_port name="Data"
|
||||
default="0"
|
||||
type="int"/>
|
||||
<output_port name="Result"
|
||||
type="int"/>
|
||||
<input_port name="action_name"
|
||||
type="std::string">Action server name</input_port>
|
||||
</Action>
|
||||
<Condition ID="SideObstaclePub">
|
||||
<input_port name="tactic"
|
||||
type="int"/>
|
||||
<input_port name="topic_name"
|
||||
default="__default__placeholder__"
|
||||
type="std::string">Topic name</input_port>
|
||||
</Condition>
|
||||
<Action ID="TacticChooser">
|
||||
<output_port name="IsBlue"
|
||||
type="int"/>
|
||||
<output_port name="tactic"
|
||||
type="int"/>
|
||||
<input_port name="number"
|
||||
type="int"/>
|
||||
</Action>
|
||||
</TreeNodesModel>
|
||||
|
||||
</root>
|
||||
Reference in New Issue
Block a user