33
44#include " aligator/modelling/costs/sum-of-costs.hpp"
55
6- #include < eigenpy/std-map.hpp>
76#include < eigenpy/std-pair.hpp>
7+ #include < eigenpy/variant.hpp>
88
99namespace aligator {
1010namespace python {
@@ -21,6 +21,7 @@ void exposeCostStack() {
2121 using CostItem = CostStack::CostItem;
2222 using CostMap = CostStack::CostMap;
2323 eigenpy::StdPairConverter<CostItem>::registration ();
24+ eigenpy::VariantConverter<CostKey>::registration ();
2425
2526 bp::class_<CostStack, bp::bases<CostAbstract>>(
2627 " CostStack" , " A weighted sum of other cost functions." , bp::no_init)
@@ -33,15 +34,18 @@ void exposeCostStack() {
3334 // "Components of this cost stack.")
3435 .def (
3536 " addCost" ,
36- +[](CostStack &self, const PolyCost &cost, const Scalar weight)
37- -> CostItem & { return self.addCost (cost, weight); },
37+ +[](CostStack &self, const PolyCost &cost, const Scalar weight) {
38+ // return
39+ self.addCost (cost, weight);
40+ },
3841 (" self" _a, " cost" , " weight" _a = 1 .),
3942 bp::return_internal_reference<>())
4043 .def (
4144 " addCost" ,
4245 +[](CostStack &self, CostKey key, const PolyCost &cost,
43- const Scalar weight) -> CostItem & {
44- return self.addCost (key, cost, weight);
46+ const Scalar weight) {
47+ // return
48+ self.addCost (key, cost, weight);
4549 },
4650 (" self" _a, " key" , " cost" , " weight" _a = 1 .),
4751 bp::return_internal_reference<>())
0 commit comments