aligator  0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
expose-constraint.cpp
Go to the documentation of this file.
3
6
7#include <eigenpy/deprecation-policy.hpp>
8
9namespace aligator::python {
13using PolyFunc = xyz::polymorphic<StageFunction>;
14using PolySet = xyz::polymorphic<ConstraintSet>;
15
17
19 {
20 bp::scope scope = get_namespace("constraints");
22 }
23
24 bp::class_<ConstraintStack>("ConstraintStack", "The stack of constraint.",
25 bp::no_init)
26 .add_property("size", &ConstraintStack::size,
27 "Get number of individual constraints.")
28 .def_readonly("funcs", &ConstraintStack::funcs)
29 .def_readonly("sets", &ConstraintStack::sets)
30 .add_property("dims",
31 bp::make_function(&ConstraintStack::dims,
32 bp::return_internal_reference<>()),
33 "Get the individual dimensions of all constraints.")
34 .add_property("total_dim", &ConstraintStack::totalDim,
35 "Get total dimension of all constraints.");
36}
37
38} // namespace aligator::python
Defines the constraint object and constraint stack manager for this library.
StageFunctionTpl< Scalar > StageFunction
Definition context.hpp:17
ConstraintSetTpl< Scalar > ConstraintSet
Definition context.hpp:21
ConstraintStackTpl< Scalar > ConstraintStack
Definition context.hpp:36
The Python bindings.
Definition blk-matrix.hpp:7
void exposeConstraint()
Expose constraints.
bp::object get_namespace(const std::string &name)
Create or retrieve a Python scope (that is, a class or module namespace).
Definition utils.hpp:22
xyz::polymorphic< ConstraintSet > PolySet
xyz::polymorphic< StageFunction > PolyFunc
const std::vector< long > & dims() const
Get the set of dimensions for each constraint in the stack.
std::vector< PolyFunc > funcs
std::size_t size() const
std::vector< PolySet > sets