]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/commitdiff
Add BrainTree behavior tree
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Tue, 3 Dec 2019 12:55:11 +0000 (13:55 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Tue, 3 Dec 2019 12:56:03 +0000 (13:56 +0100)
src/test10.cc

index 0998ec0448c7c1c2cfb5fc2f9ae4474beb4eb18e..7f1ec71cd6d84c56248b83779975a098cbef8fc8 100644 (file)
@@ -223,6 +223,43 @@ int main()
         sleeping_time.tv_nsec = 50 * 1000000;
 
         auto bt = BrainTree::Builder()
+                .composite<BrainTree::Sequence>()
+                        .leaf<ShouldRunBT>()
+                        .composite<BrainTree::Selector>()
+                                .composite<BrainTree::Sequence>()
+                                        .leaf<EppFinished>()
+                                        .leaf<EppGF>(
+                                                &feasible_path
+                                        )
+                                        .leaf<UpdateFP>(
+                                                &final_path
+                                                , &final_path_cost
+                                                , &feasible_path
+                                                , &feasible_path_cost
+                                        )
+                                        .leaf<EppRestart>(
+                                                jvi
+                                                , &feasible_path
+                                                , &feasible_path_cost
+                                                , &orig_init
+                                                , &orig_init_cost
+                                        )
+                                .end()
+                                .composite<BrainTree::Sequence>()
+                                        .leaf<EppFinished>()
+                                        .leaf<EppRestart>(
+                                                jvi
+                                                , &feasible_path
+                                                , &feasible_path_cost
+                                                , &orig_init
+                                                , &orig_init_cost
+                                        )
+                                .end()
+                                .decorator<BrainTree::Succeeder>()
+                                        .leaf<ShouldRunBT>()
+                                .end()
+                        .end()
+                .end()
         .build();
 
         TSTART();