1 |
|
|
// |
2 |
|
|
// Copyright (c) 2015-2021 CNRS INRIA |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#include "pinocchio/bindings/python/algorithm/algorithms.hpp" |
6 |
|
|
#include "pinocchio/algorithm/compute-all-terms.hpp" |
7 |
|
|
|
8 |
|
|
namespace pinocchio |
9 |
|
|
{ |
10 |
|
|
namespace python |
11 |
|
|
{ |
12 |
|
|
static void computeAllTerms_proxy(const Model & model, |
13 |
|
|
Data & data, |
14 |
|
|
const Eigen::VectorXd & q, |
15 |
|
|
const Eigen::VectorXd & v) |
16 |
|
|
{ |
17 |
|
|
data.M.fill(0); |
18 |
|
|
computeAllTerms(model,data,q,v); |
19 |
|
|
data.M.triangularView<Eigen::StrictlyLower>() |
20 |
|
|
= data.M.transpose().triangularView<Eigen::StrictlyLower>(); |
21 |
|
|
} |
22 |
|
|
|
23 |
|
19 |
void exposeCAT() |
24 |
|
|
{ |
25 |
✓✗ |
19 |
bp::def("computeAllTerms",computeAllTerms_proxy, |
26 |
|
38 |
bp::args("model","data","q","v"), |
27 |
|
|
"Compute all the terms M, non linear effects, center of mass quantities, centroidal quantities and Jacobians in" |
28 |
|
|
"in the same loop and store the results in data.\n" |
29 |
|
|
"This algorithm is equivalent to calling:\n" |
30 |
|
|
"\t- forwardKinematics\n" |
31 |
|
|
"\t- crba\n" |
32 |
|
|
"\t- nonLinearEffects\n" |
33 |
|
|
"\t- computeJointJacobians\n" |
34 |
|
|
"\t- centerOfMass\n" |
35 |
|
|
"\t- jacobianCenterOfMass\n" |
36 |
|
|
"\t- ccrba\n" |
37 |
|
|
"\t- computeKineticEnergy\n" |
38 |
|
|
"\t- computePotentialEnergy\n" |
39 |
|
|
"\t- computeGeneralizedGravity\n" |
40 |
|
|
"Parameters:\n" |
41 |
|
|
"\tmodel: model of the kinematic tree\n" |
42 |
|
|
"\tdata: data related to the model\n" |
43 |
|
|
"\tq: the joint configuration vector (size model.nq)\n" |
44 |
|
|
"\tv: the joint velocity vector (size model.nv)\n" |
45 |
|
|
); |
46 |
|
19 |
} |
47 |
|
|
} // namespace python |
48 |
|
|
} // namespace pinocchio |