30 bp::class_<QuadResCost, bp::bases<CostAbstract>>(
31 "QuadraticResidualCost",
"Weighted 2-norm of a given residual function.",
32 bp::init<PolyManifold, PolyFunction, const ConstMatrixRef &>(
33 bp::args(
"self",
"space",
"function",
"weights")))
39 bp::class_<LogResCost, bp::bases<CostAbstract>>(
40 "LogResidualCost",
"Weighted log-cost composite cost.",
41 bp::init<PolyManifold, PolyFunction, const ConstVectorRef &>(
42 bp::args(
"self",
"space",
"function",
"barrier_weights")))
43 .def(bp::init<PolyManifold, PolyFunction, Scalar>(
44 bp::args(
"self",
"function",
"scale")))
45 .def_readwrite(
"residual", &LogResCost::residual_)
46 .def_readwrite(
"weights", &LogResCost::barrier_weights_)
50 bp::class_<CompositeData, bp::bases<CostData>>(
52 bp::init<int, int, shared_ptr<context::StageFunctionData>>(
53 bp::args(
"self",
"ndx",
"nu",
"rdata")))
54 .def_readwrite(
"residual_data", &CompositeData::residual_data);
56 bp::class_<QuadStateCost, bp::bases<QuadResCost>>(
58 "Quadratic distance over the state manifold. This is a shortcut to "
59 "create a `QuadraticResidualCost` over a state error residual.",
61 .def(bp::init<QuadStateCost::StateError &, const MatrixXs &>(
62 bp::args(
"self",
"resdl",
"weights")))
63 .def(bp::init<
PolyManifold,
const int,
const ConstVectorRef &,
65 bp::args(
"self",
"space",
"nu",
"target",
"weights")))
66 .add_property(
"target", &QuadStateCost::getTarget,
67 &QuadStateCost::setTarget,
68 "Target of the quadratic distance.")
71 bp::class_<QuadControlCost, bp::bases<QuadResCost>>(
72 "QuadraticControlCost",
"Quadratic control cost.", bp::no_init)
73 .def(bp::init<PolyManifold, ConstVectorRef, const MatrixXs &>(
74 bp::args(
"space",
"target",
"weights")))
75 .def(bp::init<PolyManifold, QuadControlCost::Error, const MatrixXs &>(
76 bp::args(
"self",
"space",
"resdl",
"weights")))
77 .def(bp::init<PolyManifold, int, const MatrixXs &>(
78 bp::args(
"space",
"nu",
"weights")))
79 .add_property(
"target", &QuadControlCost::getTarget,
80 &QuadControlCost::setTarget,
81 "Reference of the control cost.")
CostAbstractTpl< Scalar > CostAbstract
ManifoldAbstractTpl< Scalar > Manifold
StageFunctionTpl< Scalar > StageFunction
CostDataAbstractTpl< Scalar > CostData