From 81ace74b0e1d703150f05dfd83ff67e1a6831073 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 27 Jun 2024 05:03:19 -0700 Subject: [PATCH] [py] Remove binding of deprecated BoxedLcpConstraintSolver constructor (cherry picked from commit ad9a8a1c61223b0d276c0242b0acf148721ff89b) --- dart/constraint/BoxedLcpConstraintSolver.hpp | 2 +- .../constraint/BoxedLcpConstraintSolver.cpp | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/dart/constraint/BoxedLcpConstraintSolver.hpp b/dart/constraint/BoxedLcpConstraintSolver.hpp index 3220c1876aaad..7d9ff613c9134 100644 --- a/dart/constraint/BoxedLcpConstraintSolver.hpp +++ b/dart/constraint/BoxedLcpConstraintSolver.hpp @@ -61,7 +61,7 @@ class BoxedLcpConstraintSolver : public ConstraintSolver BoxedLcpSolverPtr boxedLcpSolver = nullptr, BoxedLcpSolverPtr secondaryBoxedLcpSolver = nullptr); - /// Constructos with default primary and secondary LCP solvers, which are + /// Constructs with default primary and secondary LCP solvers, which are /// Dantzig and PGS, respectively. BoxedLcpConstraintSolver(); diff --git a/python/dartpy/constraint/BoxedLcpConstraintSolver.cpp b/python/dartpy/constraint/BoxedLcpConstraintSolver.cpp index b470ab9e2732b..97b088ed85997 100644 --- a/python/dartpy/constraint/BoxedLcpConstraintSolver.cpp +++ b/python/dartpy/constraint/BoxedLcpConstraintSolver.cpp @@ -42,26 +42,31 @@ namespace python { void BoxedLcpConstraintSolver(py::module& m) { ::py::class_< - dart::constraint::BoxedLcpConstraintSolver, - dart::constraint::ConstraintSolver, - std::shared_ptr>( + constraint::BoxedLcpConstraintSolver, + constraint::ConstraintSolver, + std::shared_ptr>( m, "BoxedLcpConstraintSolver") - .def(::py::init(), ::py::arg("timeStep")) + .def(::py::init<>()) .def( - ::py::init(), - ::py::arg("timeStep"), + ::py::init(), ::py::arg("boxedLcpSolver")) + .def( + ::py::init< + constraint::BoxedLcpSolverPtr, + constraint::BoxedLcpSolverPtr>(), + ::py::arg("boxedLcpSolver"), + ::py::arg("secondaryBoxedLcpSolver")) .def( "setBoxedLcpSolver", - +[](dart::constraint::BoxedLcpConstraintSolver* self, - dart::constraint::BoxedLcpSolverPtr lcpSolver) { + +[](constraint::BoxedLcpConstraintSolver* self, + constraint::BoxedLcpSolverPtr lcpSolver) { self->setBoxedLcpSolver(lcpSolver); }, ::py::arg("lcpSolver")) .def( "getBoxedLcpSolver", - +[](const dart::constraint::BoxedLcpConstraintSolver* self) - -> dart::constraint::ConstBoxedLcpSolverPtr { + +[](const constraint::BoxedLcpConstraintSolver* self) + -> constraint::ConstBoxedLcpSolverPtr { return self->getBoxedLcpSolver(); }); }