MCPcopy Create free account
hub / github.com/Simple-Robotics/aligator / exposeFunctions

Function exposeFunctions

bindings/python/src/expose-functions.cpp:119–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117void exposeFunctionExpressions();
118
119void exposeFunctions() {
120 exposeFunctionBase();
121 exposeUnaryFunctions();
122 exposeFunctionExpressions();
123
124 bp::class_<StateErrorResidual, bp::bases<UnaryFunction>>(
125 "StateErrorResidual",
126 bp::init<const xyz::polymorphic<context::Manifold> &, const int,
127 const context::VectorXs &>(("self"_a, "space", "nu", "target")))
128 .def_readonly("space", &StateErrorResidual::space_)
129 .def_readwrite("target", &StateErrorResidual::target_)
130 .def(PolymorphicMultiBaseVisitor<UnaryFunction, StageFunction>());
131
132 bp::class_<ControlErrorResidual, bp::bases<StageFunction>>(
133 "ControlErrorResidual",
134 bp::init<const int, const xyz::polymorphic<context::Manifold> &,
135 const context::VectorXs &>(
136 ("self"_a, "ndx", "uspace", "target")))
137 .def(bp::init<const int, const context::VectorXs &>(
138 ("self"_a, "ndx", "target")))
139 .def(bp::init<int, int>(("self"_a, "ndx", "nu")))
140 .def_readonly("space", &ControlErrorResidual::space_)
141 .def_readwrite("target", &ControlErrorResidual::target_)
142 .def(func_visitor);
143
144 using LinearFunction = LinearFunctionTpl<Scalar>;
145 bp::class_<LinearFunction, bp::bases<StageFunction>>(
146 "LinearFunction",
147 bp::init<const int, const int, const int>(("self"_a, "ndx", "nu", "nr")))
148 .def(bp::init<const ConstMatrixRef &, const ConstMatrixRef &,
149 const ConstVectorRef &>("Constructor with C=0.",
150 ("self"_a, "A", "B", "d")))
151 .def_readonly("A", &LinearFunction::A_)
152 .def_readonly("B", &LinearFunction::B_)
153 .def_readonly("d", &LinearFunction::d_)
154 .def(func_visitor);
155
156 bp::class_<ControlBoxFunctionTpl<Scalar>, bp::bases<StageFunction>>(
157 "ControlBoxFunction",
158 bp::init<const int, const VectorXs &, const VectorXs &>(
159 bp::args("self", "ndx", "umin", "umax")))
160 .def(bp::init<const int, const int, const Scalar, const Scalar>(
161 bp::args("self", "ndx", "nu", "umin", "umax")))
162 .def(func_visitor);
163}
164
165} // namespace python
166} // namespace aligator

Callers 1

BOOST_PYTHON_MODULEFunction · 0.85

Calls 3

exposeFunctionBaseFunction · 0.85
exposeUnaryFunctionsFunction · 0.85

Tested by

no test coverage detected