From 5c94af11aff1e545deee45a42ccb090fef61f45b Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 18 May 2018 22:10:49 -0700 Subject: [PATCH 1/2] Add registries to the bottom of the module --- chimera/chimera.yml | 12 ++++++++---- chimera/templates/module.mstch.cpp | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/chimera/chimera.yml b/chimera/chimera.yml index 036d246..e7da642 100644 --- a/chimera/chimera.yml +++ b/chimera/chimera.yml @@ -18,6 +18,7 @@ template: header: | #include #include + #include #include #include @@ -32,15 +33,15 @@ template: '/* postinclude */' footer: '/* footer */' - # TODO: Put this at the bottom of the module: - # dart::python::JointTemplateRegistry::register_default_types(); - # dart::python::JointAndNodeTemplateRegistry::register_default_types(); main: header: | #include - #include + #include + #include + #include #include + #include #include #include @@ -117,6 +118,9 @@ template: dart::dynamics::DegreeOfFreedom*, dart::dynamics::DegreeOfFreedomPtr>(); dart::python::util::collection_from_python< std::vector >(); + postcontent: | + dart::python::JointTemplateRegistry::register_default_types(); + dart::python::JointAndNodeTemplateRegistry::register_default_types(); footer: | // main footer diff --git a/chimera/templates/module.mstch.cpp b/chimera/templates/module.mstch.cpp index cecb521..fd13ab3 100644 --- a/chimera/templates/module.mstch.cpp +++ b/chimera/templates/module.mstch.cpp @@ -32,6 +32,6 @@ ::boost::python::docstring_options options(true, true, false); } {{/module.bindings}} -} {{{postcontent}}} +} {{{footer}}} From c1fa6e75e5b2254db06bf784cf35a82057da1ea9 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Tue, 22 May 2018 16:30:40 -0700 Subject: [PATCH 2/2] Correct header inclusion order --- chimera/chimera.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chimera/chimera.yml b/chimera/chimera.yml index b3f547c..aaed129 100644 --- a/chimera/chimera.yml +++ b/chimera/chimera.yml @@ -39,8 +39,8 @@ template: header: | #include + #include // should be included before any other non-STL headers #include - #include #include #include