forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request microsoft#25 from facontidavide/devel
Preliminary changes to add tracing/logging
- Loading branch information
Showing
33 changed files
with
3,253 additions
and
228 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#include "crossdoor_dummy_nodes.h" | ||
#include "behavior_tree_core/xml_parsing.h" | ||
#include "behavior_tree_logger/bt_cout_logger.h" | ||
|
||
// clang-format off | ||
|
||
const std::string xml_text = R"( | ||
<root main_tree_to_execute = "MainTree" > | ||
<BehaviorTree ID="MainTree"> | ||
<Fallback name="root_selector"> | ||
<Sequence name="door_open_sequence"> | ||
<Action ID="IsDoorOpen" /> | ||
<Action ID="PassThroughDoor" /> | ||
</Sequence> | ||
<Sequence name="door_closed_sequence"> | ||
<Decorator ID="Negation"> | ||
<Action ID="IsDoorOpen" /> | ||
</Decorator> | ||
<Action ID="OpenDoor" /> | ||
<Action ID="PassThroughDoor" /> | ||
<Action ID="CloseDoor" /> | ||
</Sequence> | ||
<Action ID="PassThroughWindow" /> | ||
</Fallback> | ||
</BehaviorTree> | ||
</root> | ||
)"; | ||
|
||
// clang-format on | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
using namespace BT; | ||
|
||
BT::BehaviorTreeFactory factory; | ||
|
||
// register all the actions into the factory | ||
CrossDoor cross_door(factory); | ||
|
||
XMLParser parser; | ||
parser.loadFromText(xml_text); | ||
|
||
std::vector<BT::TreeNodePtr> nodes; | ||
BT::TreeNodePtr root_node = parser.instantiateTree(factory, nodes); | ||
|
||
StdCoutLogger logger(root_node.get()); | ||
|
||
cross_door.CloseDoor(); | ||
|
||
std::cout << "---------------" << std::endl; | ||
root_node->executeTick(); | ||
std::cout << "---------------" << std::endl; | ||
root_node->executeTick(); | ||
std::cout << "---------------" << std::endl; | ||
return 0; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.