1 |
|
|
// |
2 |
|
|
// Copyright (c) 2015-2020 CNRS INRIA |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#include "pinocchio/bindings/python/algorithm/algorithms.hpp" |
6 |
|
|
#include "pinocchio/algorithm/energy.hpp" |
7 |
|
|
|
8 |
|
|
namespace pinocchio |
9 |
|
|
{ |
10 |
|
|
namespace python |
11 |
|
|
{ |
12 |
|
|
|
13 |
|
19 |
void exposeEnergy() |
14 |
|
|
{ |
15 |
|
|
using namespace Eigen; |
16 |
|
|
|
17 |
✓✗ |
19 |
bp::def("computeKineticEnergy", |
18 |
|
|
&computeKineticEnergy<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>, |
19 |
|
38 |
bp::args("model","data","q","v"), |
20 |
|
|
"Computes the forward kinematics and the kinematic energy of the model for the " |
21 |
|
|
"given joint configuration and velocity given as input. The result is accessible through data.kinetic_energy."); |
22 |
|
|
|
23 |
✓✗ |
19 |
bp::def("computeKineticEnergy", |
24 |
|
|
&computeKineticEnergy<double,0,JointCollectionDefaultTpl>, |
25 |
|
38 |
bp::args("model","data"), |
26 |
|
|
"Computes the kinematic energy of the model for the " |
27 |
|
|
"given joint placement and velocity stored in data. The result is accessible through data.kinetic_energy."); |
28 |
|
|
|
29 |
✓✗ |
19 |
bp::def("computePotentialEnergy", |
30 |
|
|
&computePotentialEnergy<double,0,JointCollectionDefaultTpl,VectorXd>, |
31 |
|
38 |
bp::args("model","data","q"), |
32 |
|
|
"Computes the potential energy of the model for the " |
33 |
|
|
"given the joint configuration given as input. The result is accessible through data.potential_energy."); |
34 |
|
|
|
35 |
✓✗ |
19 |
bp::def("computePotentialEnergy", |
36 |
|
|
&computePotentialEnergy<double,0,JointCollectionDefaultTpl>, |
37 |
|
38 |
bp::args("model","data"), |
38 |
|
|
"Computes the potential energy of the model for the " |
39 |
|
|
"given joint placement stored in data. The result is accessible through data.potential_energy."); |
40 |
|
19 |
} |
41 |
|
|
|
42 |
|
|
} // namespace python |
43 |
|
|
} // namespace pinocchio |