1 |
|
|
// |
2 |
|
|
// Copyright (c) 2019 CNRS INRIA |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#include "pinocchio/bindings/python/algorithm/algorithms.hpp" |
6 |
|
|
#include "pinocchio/bindings/python/utils/namespace.hpp" |
7 |
|
|
#include "pinocchio/algorithm/cholesky.hpp" |
8 |
|
|
|
9 |
|
|
namespace pinocchio |
10 |
|
|
{ |
11 |
|
|
namespace python |
12 |
|
|
{ |
13 |
|
|
|
14 |
|
19 |
void exposeCholesky() |
15 |
|
|
{ |
16 |
|
|
using namespace Eigen; |
17 |
|
|
using namespace pinocchio::cholesky; |
18 |
|
|
|
19 |
|
|
{ |
20 |
|
|
// using the cholesky scope |
21 |
✓✗✓✗ ✓✗ |
38 |
bp::scope current_scope = getOrCreatePythonNamespace("cholesky"); |
22 |
|
|
|
23 |
✓✗ |
19 |
bp::def("decompose", |
24 |
|
|
&decompose<double,0,JointCollectionDefaultTpl>, |
25 |
✓✗ |
38 |
bp::args("Model","Data"), |
26 |
|
|
"Computes the Cholesky decomposition of the joint space inertia matrix M contained in data.\n" |
27 |
|
|
"The upper triangular part of data.M should have been filled first by calling crba, or any related algorithms.", |
28 |
|
|
bp::return_value_policy<bp::return_by_value>()); |
29 |
|
|
|
30 |
✓✗ |
19 |
bp::def("solve", |
31 |
|
|
&solve<double,0,JointCollectionDefaultTpl,VectorXd>, |
32 |
✓✗ |
38 |
bp::args("Model","Data","v"), |
33 |
|
|
"Returns the solution \f$x\f$ of \f$ M x = y \f$ using the Cholesky decomposition stored in data given the entry \f$ y \f$.", |
34 |
|
|
bp::return_value_policy<bp::return_by_value>()); |
35 |
|
|
|
36 |
✓✗ |
19 |
bp::def("computeMinv", |
37 |
|
|
&pinocchio::cholesky::computeMinv<double,0,JointCollectionDefaultTpl>, |
38 |
✓✗ |
38 |
bp::args("Model","Data"), |
39 |
|
|
"Returns the inverse of the inverse of the joint space inertia matrix using the results of the Cholesky decomposition\n" |
40 |
|
|
"performed by cholesky.decompose. The result is stored in data.Minv.", |
41 |
|
19 |
bp::return_value_policy<bp::return_by_value>()); |
42 |
|
|
} |
43 |
|
|
|
44 |
|
19 |
} |
45 |
|
|
|
46 |
|
|
} // namespace python |
47 |
|
|
} // namespace pinocchio |