python bindings to be tested (arm vs intep python issues)
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
#include <pybind11/operators.h>
|
||||
|
||||
#include "ConstructionWrapper.hh"
|
||||
#include "SystemBuilder.hh"
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
template<class M>
|
||||
void makeConstructionWrapper(M & m, std::string name){
|
||||
|
||||
py::class_<ConstructionWrapper>(m, name.data()).def(py::init())
|
||||
.def("addLayer", &ConstructionWrapper::addLayer)
|
||||
.def("getNSensors", &ConstructionWrapper::getNSensors);
|
||||
|
||||
}
|
||||
template<class M>
|
||||
void makeSystemBuilder(M& m, std::string name){
|
||||
py::class_<SystemBuilder>(m, name.data()).def(py::init())
|
||||
.def("init", &SystemBuilder::init)
|
||||
.def("run_gui", &SystemBuilder::run_gui)
|
||||
.def("run_batch", &SystemBuilder::run_batch)
|
||||
.def("visualize", &SystemBuilder::visualize);
|
||||
}
|
||||
|
||||
PYBIND11_MODULE(bindings, m) {
|
||||
m.doc() = "pybind11 example plugin"; // optional module docstring
|
||||
makeConstructionWrapper(m, "ConstructionWrapper");
|
||||
makeSystemBuilder(m, "SystemBuilder");
|
||||
}
|
||||
Reference in New Issue
Block a user