1 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
2 |
|
|
// BSD 3-Clause License |
3 |
|
|
// |
4 |
|
|
// Copyright (C) 2021-2023, University of Edinburgh, Heriot-Watt University |
5 |
|
|
// Copyright note valid unless otherwise stated in individual files. |
6 |
|
|
// All rights reserved. |
7 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
8 |
|
|
|
9 |
|
|
#include "crocoddyl/multibody/cop-support.hpp" |
10 |
|
|
|
11 |
|
|
#include "python/crocoddyl/multibody/multibody.hpp" |
12 |
|
|
#include "python/crocoddyl/utils/copyable.hpp" |
13 |
|
|
#include "python/crocoddyl/utils/printable.hpp" |
14 |
|
|
|
15 |
|
|
namespace crocoddyl { |
16 |
|
|
namespace python { |
17 |
|
|
|
18 |
|
10 |
void exposeCoPSupport() { |
19 |
|
10 |
bp::register_ptr_to_python<boost::shared_ptr<CoPSupport> >(); |
20 |
|
|
|
21 |
|
|
#pragma GCC diagnostic push // TODO: Remove once the deprecated update call has |
22 |
|
|
// been removed in a future release |
23 |
|
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
24 |
|
|
|
25 |
✓✗ |
10 |
bp::class_<CoPSupport>( |
26 |
|
|
"CoPSupport", "Model of the CoP support as lb <= Af <= ub", |
27 |
✓✗ |
10 |
bp::init<Eigen::Matrix3d, Eigen::Vector2d>( |
28 |
|
20 |
bp::args("self", "R", "box"), |
29 |
|
|
"Initialize the CoP support.\n\n" |
30 |
|
|
":param R: rotation matrix that defines the cone orientation\n" |
31 |
|
|
":param box: dimension of the foot surface dim = (length, width)\n")) |
32 |
✓✗✓✗
|
20 |
.def(bp::init<>(bp::args("self"), |
33 |
✓✗ |
10 |
"Default initialization of the CoP support.")) |
34 |
✓✗ |
20 |
.def("update", &CoPSupport::update, bp::args("self"), |
35 |
|
|
"Update the linear inequality (matrix and bounds).\n\n" |
36 |
✓✗ |
10 |
"Run this function if you have changed one of the parameters.") |
37 |
|
|
.add_property("A", |
38 |
✓✗ |
10 |
bp::make_function(&CoPSupport::get_A, |
39 |
|
10 |
bp::return_internal_reference<>()), |
40 |
✓✗ |
10 |
"inequality matrix") |
41 |
|
|
.add_property("ub", |
42 |
✓✗ |
10 |
bp::make_function(&CoPSupport::get_ub, |
43 |
|
10 |
bp::return_internal_reference<>()), |
44 |
✓✗ |
10 |
"inequality upper bound") |
45 |
|
|
.add_property("lb", |
46 |
✓✗ |
10 |
bp::make_function(&CoPSupport::get_lb, |
47 |
|
10 |
bp::return_internal_reference<>()), |
48 |
✓✗ |
10 |
"inequality lower bound") |
49 |
|
|
.add_property("R", |
50 |
✓✗ |
10 |
bp::make_function(&CoPSupport::get_R, |
51 |
|
|
bp::return_internal_reference<>()), |
52 |
✓✗✓✗
|
30 |
bp::make_function(&CoPSupport::set_R), "rotation matrix") |
53 |
|
|
.add_property("box", |
54 |
✓✗ |
10 |
bp::make_function(&CoPSupport::get_box, |
55 |
|
|
bp::return_internal_reference<>()), |
56 |
✓✗ |
20 |
bp::make_function(&CoPSupport::set_box), |
57 |
✓✗ |
10 |
"box size used to define the sole") |
58 |
✓✗ |
10 |
.def(CopyableVisitor<CoPSupport>()) |
59 |
✓✗ |
10 |
.def(PrintableVisitor<CoPSupport>()); |
60 |
|
|
|
61 |
|
|
#pragma GCC diagnostic pop |
62 |
|
10 |
} |
63 |
|
|
|
64 |
|
|
} // namespace python |
65 |
|
|
} // namespace crocoddyl |