32 bp::class_<QuadResCost, bp::bases<CostAbstract>>(
33 "QuadraticResidualCost",
"Weighted 2-norm of a given residual function.",
34 bp::init<PolyManifold, PolyFunction, const ConstMatrixRef &>(
35 bp::args(
"self",
"space",
"function",
"weights")))
41 bp::class_<LogResCost, bp::bases<CostAbstract>>(
42 "LogResidualCost",
"Weighted log-cost composite cost.",
43 bp::init<PolyManifold, PolyFunction, const ConstVectorRef &>(
44 bp::args(
"self",
"space",
"function",
"barrier_weights")))
45 .def(bp::init<PolyManifold, PolyFunction, Scalar>(
46 bp::args(
"self",
"function",
"scale")))
47 .def_readwrite(
"residual", &LogResCost::residual_)
48 .def_readwrite(
"weights", &LogResCost::barrier_weights_)
52 bp::class_<RelaxedLogCost, bp::bases<CostAbstract>>(
53 "RelaxedLogBarrierCost",
"Relaxed log-barrier composite cost.",
56 bp::args(
"self",
"space",
"function",
"weights",
"threshold")))
57 .def(bp::init<PolyManifold, PolyFunction, const Scalar, const Scalar>(
58 bp::args(
"self",
"space",
"function",
"weights",
"threshold")))
59 .def_readwrite(
"residual", &RelaxedLogCost::residual_)
60 .def_readwrite(
"weights", &RelaxedLogCost::barrier_weights_)
64 bp::class_<CompositeData, bp::bases<CostData>>(
66 bp::init<int, int, shared_ptr<context::StageFunctionData>>(
67 bp::args(
"self",
"ndx",
"nu",
"rdata")))
68 .def_readwrite(
"residual_data", &CompositeData::residual_data);
70 bp::class_<QuadStateCost, bp::bases<QuadResCost>>(
72 "Quadratic distance over the state manifold. This is a shortcut to "
73 "create a `QuadraticResidualCost` over a state error residual.",
75 .def(bp::init<QuadStateCost::StateError &, const MatrixXs &>(
76 bp::args(
"self",
"resdl",
"weights")))
77 .def(bp::init<
PolyManifold,
const int,
const ConstVectorRef &,
79 bp::args(
"self",
"space",
"nu",
"target",
"weights")))
80 .add_property(
"target", &QuadStateCost::getTarget,
81 &QuadStateCost::setTarget,
82 "Target of the quadratic distance.")
85 bp::class_<QuadControlCost, bp::bases<QuadResCost>>(
86 "QuadraticControlCost",
"Quadratic control cost.", bp::no_init)
87 .def(bp::init<PolyManifold, ConstVectorRef, const MatrixXs &>(
88 bp::args(
"space",
"target",
"weights")))
89 .def(bp::init<PolyManifold, QuadControlCost::Error, const MatrixXs &>(
90 bp::args(
"self",
"space",
"resdl",
"weights")))
91 .def(bp::init<PolyManifold, int, const MatrixXs &>(
92 bp::args(
"space",
"nu",
"weights")))
93 .add_property(
"target", &QuadControlCost::getTarget,
94 &QuadControlCost::setTarget,
95 "Reference of the control cost.")
CostAbstractTpl< Scalar > CostAbstract
ManifoldAbstractTpl< Scalar > Manifold
StageFunctionTpl< Scalar > StageFunction
CostDataAbstractTpl< Scalar > CostData