GCC Code Coverage Report | |||||||||||||||||||||
|
|||||||||||||||||||||
Line | Branch | Exec | Source |
1 |
#include "dynacom/dyna_com.hpp" |
||
2 |
|||
3 |
#include <pinocchio/multibody/fwd.hpp> |
||
4 |
// Must be included first! |
||
5 |
#include <boost/python.hpp> |
||
6 |
#include <boost/python/return_internal_reference.hpp> |
||
7 |
#include <boost/python/suite/indexing/vector_indexing_suite.hpp> |
||
8 |
#include <eigenpy/eigenpy.hpp> |
||
9 |
|||
10 |
#include "dynacom/contact6d.hpp" |
||
11 |
#include "dynacom/python.hpp" |
||
12 |
|||
13 |
namespace dynacom { |
||
14 |
namespace python { |
||
15 |
namespace bp = boost::python; |
||
16 |
|||
17 |
bp::dict get_settings(DynaCoM &self) { |
||
18 |
bp::dict settings; |
||
19 |
DynaCoMSettings conf = self.getSettings(); |
||
20 |
settings["urdf"] = conf.urdf; |
||
21 |
|||
22 |
return settings; |
||
23 |
} |
||
24 |
|||
25 |
1011 |
std::shared_ptr<Contact6D> getContact(DynaCoM &self, std::string name) { |
|
26 |
✓✗ | 3033 |
return boost::ref(self.getContact(name)); |
27 |
} |
||
28 |
|||
29 |
1 |
void exposeDynaCoM() { |
|
30 |
1 |
bp::class_<std::vector<std::string> >("names_vector") |
|
31 |
✓✗ | 1 |
.def(bp::vector_indexing_suite<std::vector<std::string> >()); |
32 |
|||
33 |
1 |
bp::class_<DynaCoMSettings>("DynaCoMSettings") |
|
34 |
✓✗ | 1 |
.def_readwrite("urdf", &DynaCoMSettings::urdf); |
35 |
|||
36 |
✓✗ | 1 |
bp::class_<DynaCoM, boost::noncopyable>("DynaCoM", bp::init<>()) |
37 |
✓✗✓✗ |
2 |
.def("initialize", &DynaCoM::initialize, bp::args("self", "settings")) |
38 |
.def("computeDynamics", &DynaCoM::computeDynamics, |
||
39 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
3 |
(bp::arg("self"), bp::arg("posture"), bp::arg("velocity"), |
40 |
✓✗✓✗ ✓✗ |
3 |
bp::arg("aceleration"), bp::arg("extWrench"), |
41 |
✓✗✓✗ ✓✗✓✗ |
2 |
bp::arg("flatHorizontalGround") = true)) |
42 |
.def<void (DynaCoM::*)(const double &, const Eigen::VectorXd &, |
||
43 |
const Eigen::VectorXd &, const Eigen::VectorXd &, |
||
44 |
const Eigen::Matrix<double, 6, 1> &, |
||
45 |
bool flatHorizontalGround)>( |
||
46 |
"computeNL", &DynaCoM::computeNL, |
||
47 |
✓✗ | 2 |
bp::args("self", "posture", "velocity", "aceleration", "extWrench", |
48 |
2 |
"flatHorizontalGround")) |
|
49 |
.def<void (DynaCoM::*)(const double &)>("computeNL", &DynaCoM::computeNL, |
||
50 |
✓✗✓✗ |
2 |
bp::args("self")) |
51 |
.def("addContact6d", &DynaCoM::addContact6d, |
||
52 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
2 |
(bp::arg("self"), bp::arg("contact"), bp::arg("name"), |
53 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
3 |
bp::arg("active") = true)) |
54 |
.def("removeContact6d", &DynaCoM::removeContact6d, |
||
55 |
✓✗✓✗ |
2 |
bp::args("self", "name")) |
56 |
.def("activateContact6d", &DynaCoM::activateContact6d, |
||
57 |
✓✗✓✗ |
2 |
bp::args("self", "name")) |
58 |
.def("deactivateContact6d", &DynaCoM::deactivateContact6d, |
||
59 |
✓✗✓✗ |
2 |
bp::args("self", "name")) |
60 |
.def("distributeForce", &DynaCoM::distributeForce, |
||
61 |
✓✗✓✗ |
2 |
bp::args("self", "groundCoMForce", "groundCoMTorque", "CoM")) |
62 |
✓✗✓✗ |
2 |
.def("getContact", &getContact, bp::args("self", "name")) |
63 |
.def("getActiveContacts", &DynaCoM::getActiveContacts, |
||
64 |
bp::return_value_policy<bp::copy_const_reference>(), |
||
65 |
✓✗✓✗ |
2 |
bp::args("self")) |
66 |
✓✗✓✗ |
2 |
.def("uni_A", &DynaCoM::uni_A, bp::args("self")) |
67 |
✓✗✓✗ |
2 |
.def("uni_b", &DynaCoM::uni_b, bp::args("self")) |
68 |
✓✗✓✗ |
2 |
.def("fri_A", &DynaCoM::fri_A, bp::args("self")) |
69 |
✓✗✓✗ |
2 |
.def("fri_b", &DynaCoM::fri_b, bp::args("self")) |
70 |
✓✗✓✗ |
2 |
.def("reg_A", &DynaCoM::reg_A, bp::args("self")) |
71 |
✓✗✓✗ |
2 |
.def("reg_b", &DynaCoM::reg_b, bp::args("self")) |
72 |
✓✗✓✗ |
2 |
.def("NE_A", &DynaCoM::NE_A, bp::args("self")) |
73 |
.def("NE_b", &DynaCoM::NE_b, |
||
74 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
75 |
✓✗✓✗ |
2 |
bp::args("self")) |
76 |
.def("allForces", &DynaCoM::allForces, |
||
77 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
78 |
✓✗✓✗ |
2 |
bp::args("self")) |
79 |
.def("model", &DynaCoM::getModel, |
||
80 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
81 |
✓✗✓✗ |
2 |
bp::args("self")) |
82 |
.def("data", &DynaCoM::getData, |
||
83 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
84 |
✓✗✓✗ |
2 |
bp::args("self")) |
85 |
.def("getCoM", &DynaCoM::getCoM, |
||
86 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
87 |
✓✗✓✗ |
2 |
bp::args("self")) |
88 |
.def("getVCoM", &DynaCoM::getVCoM, |
||
89 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
90 |
✓✗✓✗ |
2 |
bp::args("self")) |
91 |
.def("getACoM", &DynaCoM::getACoM, |
||
92 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
93 |
✓✗✓✗ |
2 |
bp::args("self")) |
94 |
.def("getAM", &DynaCoM::getAM, |
||
95 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
96 |
✓✗✓✗ |
2 |
bp::args("self")) |
97 |
.def("getCoP", &DynaCoM::getCoP, |
||
98 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
99 |
✓✗✓✗ |
2 |
bp::args("self")) |
100 |
.def("getNL", &DynaCoM::getNL, |
||
101 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
102 |
✓✗✓✗ |
2 |
bp::args("self")) |
103 |
.def("getGroundCoMForce", &DynaCoM::getGroundCoMForce, |
||
104 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
105 |
✓✗✓✗ |
2 |
bp::args("self")) |
106 |
.def("getGroundCoMTorque", &DynaCoM::getGroundCoMTorque, |
||
107 |
bp::return_value_policy<bp::reference_existing_object>(), |
||
108 |
✓✗✓✗ |
1 |
bp::args("self")); |
109 |
1 |
} |
|
110 |
} // namespace python |
||
111 |
} // namespace dynacom |
Generated by: GCOVR (Version 4.2) |