Skip to content

Commit

Permalink
[py] Remove binding of deprecated BoxedLcpConstraintSolver constructor
Browse files Browse the repository at this point in the history
(cherry picked from commit ad9a8a1)
  • Loading branch information
jslee02 committed Jun 27, 2024
1 parent d2f56b4 commit 81ace74
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dart/constraint/BoxedLcpConstraintSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
25 changes: 15 additions & 10 deletions python/dartpy/constraint/BoxedLcpConstraintSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,31 @@ namespace python {
void BoxedLcpConstraintSolver(py::module& m)
{
::py::class_<
dart::constraint::BoxedLcpConstraintSolver,
dart::constraint::ConstraintSolver,
std::shared_ptr<dart::constraint::BoxedLcpConstraintSolver>>(
constraint::BoxedLcpConstraintSolver,
constraint::ConstraintSolver,
std::shared_ptr<constraint::BoxedLcpConstraintSolver>>(
m, "BoxedLcpConstraintSolver")
.def(::py::init<double>(), ::py::arg("timeStep"))
.def(::py::init<>())
.def(
::py::init<double, dart::constraint::BoxedLcpSolverPtr>(),
::py::arg("timeStep"),
::py::init<constraint::BoxedLcpSolverPtr>(),
::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();
});
}
Expand Down

0 comments on commit 81ace74

Please sign in to comment.