pinocchio  3.7.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
 
Loading...
Searching...
No Matches
contact-solver-base.hpp
1//
2// Copyright (c) 2022-2024 INRIA
3//
4
5#include "pinocchio/bindings/python/fwd.hpp"
6#include "pinocchio/algorithm/contact-solver-base.hpp"
7
8#include <eigenpy/eigen-from-python.hpp>
9
10namespace pinocchio
11{
12 namespace python
13 {
14
15 namespace bp = boost::python;
16
17 template<typename Solver>
18 struct ContactSolverBasePythonVisitor
19 : public boost::python::def_visitor<ContactSolverBasePythonVisitor<Solver>>
20 {
21 typedef typename Solver::Scalar Scalar;
22
23 public:
24 template<class PyClass>
25 void visit(PyClass & cl) const
26 {
27#ifdef PINOCCHIO_PYTHON_PLAIN_SCALAR_TYPE
28 cl.def(
29 "getIterationCount", &Solver::getIterationCount, bp::arg("self"),
30 "Get the number of iterations achieved by the PGS algorithm.")
31 .def(
32 "setMaxIterations", &Solver::setMaxIterations, bp::args("self", "max_it"),
33 "Set the maximum number of iterations.")
34 .def(
35 "getMaxIterations", &Solver::getMaxIterations, bp::arg("self"),
36 "Get the maximum number of iterations allowed.")
37
38 .def(
39 "setAbsolutePrecision", &Solver::setAbsolutePrecision,
40 bp::args("self", "absolute_precision"), "Set the absolute precision for the problem.")
41 .def(
42 "getAbsolutePrecision", &Solver::getAbsolutePrecision, bp::arg("self"),
43 "Get the absolute precision requested.")
44
45 .def(
46 "setRelativePrecision", &Solver::setRelativePrecision,
47 bp::args("self", "relative_precision"), "Set the relative precision for the problem.")
48 .def(
49 "getRelativePrecision", &Solver::getRelativePrecision, bp::arg("self"),
50 "Get the relative precision requested.")
51
52 .def(
53 "getAbsoluteConvergenceResidual", &Solver::getAbsoluteConvergenceResidual,
54 bp::arg("self"),
55 "Returns the value of the absolute residual value corresponding to the contact "
56 "complementary conditions.")
57 .def(
58 "getRelativeConvergenceResidual", &Solver::getRelativeConvergenceResidual,
59 bp::arg("self"),
60 "Returns the value of the relative residual value corresponding to the difference "
61 "between two successive iterates (infinity norms).")
62
63 #ifdef PINOCCHIO_WITH_HPP_FCL
64 .def("getCPUTimes", &Solver::getCPUTimes, bp::arg("self"))
65 #endif // PINOCCHIO_WITH_HPP_FCL
66 ;
67#endif
68 }
69 }; // struct ContactSolverBasePythonVisitor
70
71 } // namespace python
72} // namespace pinocchio
Main pinocchio namespace.
Definition treeview.dox:11