File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,12 @@ PYBIND11_MODULE(BehaviorTreePython, m)
31
31
return params.find (key) != params.end ();
32
32
} )
33
33
.def (" __getitem__" ,
34
- [](NodeParameters &m, const std::string &k) -> const std::string & {
35
- auto it = m.find (k);
36
- if (it == m.end ())
34
+ [](NodeParameters ¶ms, const std::string &key) -> const std::string &
35
+ {
36
+ auto it = params.find (key);
37
+ if (it == params.end ()){
37
38
throw py::key_error ();
39
+ }
38
40
return it->second ;
39
41
},
40
42
py::return_value_policy::copy // ref + keepalive
@@ -47,6 +49,25 @@ PYBIND11_MODULE(BehaviorTreePython, m)
47
49
// ------------------------------------------
48
50
}
49
51
52
+ const std::string xml_text = R"(
53
+
54
+ # define Action HelloPythonAction
55
+
56
+ class HelloPythonAction(ActionNode):
57
+
58
+ def __init__(self, name, params):
59
+ ActionNode.__init__(self,name, params)
60
+
61
+ def tick(self):
62
+ print("tick called.")
63
+ return NodeStatus.SUCCESS;
64
+
65
+ def halt(self):
66
+ print("halt called.")
67
+
68
+ def requiredNodeParameters()
69
+ return [("paramA", "1"), ("paramB", "2")]
70
+ )" ;
50
71
51
72
// clang-format on
52
73
You can’t perform that action at this time.
0 commit comments