aligator  0.6.1
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
expose-cost-stack.cpp
Go to the documentation of this file.
3
5
6namespace aligator {
7namespace python {
11using context::Scalar;
12
14 using CostStack = CostStackTpl<Scalar>;
15 using CostStackData = CostStackDataTpl<Scalar>;
16
17 bp::class_<CostStack, bp::bases<CostAbstract>>(
18 "CostStack", "A weighted sum of other cost functions.",
19 bp::init<shared_ptr<Manifold>, int,
20 const std::vector<shared_ptr<CostAbstract>> &,
21 const std::vector<Scalar> &>(("self"_a, "space", "nu",
22 "components"_a = bp::list(),
23 "weights"_a = bp::list())))
24 .def_readwrite("components", &CostStack::components_,
25 "Components of this cost stack.")
26 .def_readonly("weights", &CostStack::weights_,
27 "Weights of this cost stack.")
28 .def("addCost", &CostStack::addCost, ("self"_a, "cost", "weight"_a = 1.),
29 "Add a cost to the stack of costs.")
30 .def("size", &CostStack::size, "Get the number of cost components.")
31 .def(CopyableVisitor<CostStack>());
32
33 bp::register_ptr_to_python<shared_ptr<CostStackData>>();
34 bp::class_<CostStackData, bp::bases<CostData>>(
35 "CostStackData", "Data struct for CostStack.", bp::no_init)
36 .def_readonly("sub_cost_data", &CostStackData::sub_cost_data);
37}
38
39} // namespace python
40} // namespace aligator
CostAbstractTpl< Scalar > CostAbstract
Definition context.hpp:26
ManifoldAbstractTpl< Scalar > Manifold
Definition context.hpp:14
CostDataAbstractTpl< Scalar > CostData
Definition context.hpp:27
void exposeCostStack()
fwd-declare exposeCostStack()
Main package namespace.