Directory: | ./ |
---|---|
File: | bindings/python/crocoddyl/core/data/actuation.cpp |
Date: | 2025-03-26 19:23:43 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 7 | 7 | 100.0% |
Branches: | 15 | 30 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | ||
2 | // BSD 3-Clause License | ||
3 | // | ||
4 | // Copyright (C) 2019-2025, 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/core/data/actuation.hpp" | ||
10 | |||
11 | #include "python/crocoddyl/core/core.hpp" | ||
12 | |||
13 | namespace crocoddyl { | ||
14 | namespace python { | ||
15 | |||
16 | template <typename Data> | ||
17 | struct DataCollectorActuationVisitor | ||
18 | : public bp::def_visitor<DataCollectorActuationVisitor<Data>> { | ||
19 | template <class PyClass> | ||
20 | 40 | void visit(PyClass& cl) const { | |
21 |
2/4✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 20 times.
✗ Branch 5 not taken.
|
40 | cl.add_property( |
22 | "actuation", | ||
23 | bp::make_getter(&Data::actuation, | ||
24 | 40 | bp::return_value_policy<bp::return_by_value>()), | |
25 | "actuation data"); | ||
26 | 40 | } | |
27 | }; | ||
28 | |||
29 | #define CROCODDYL_DATA_COLLECTOR_JOINT_PYTHON_BINDINGS(Scalar) \ | ||
30 | typedef DataCollectorActuationTpl<Scalar> Data; \ | ||
31 | typedef DataCollectorAbstractTpl<Scalar> DataBase; \ | ||
32 | typedef ActuationDataAbstractTpl<Scalar> ActuationData; \ | ||
33 | bp::register_ptr_to_python<std::shared_ptr<Data>>(); \ | ||
34 | bp::class_<Data, bp::bases<DataBase>>( \ | ||
35 | "DataCollectorActuation", "Actuation data collector.\n\n", \ | ||
36 | bp::init<std::shared_ptr<ActuationData>>( \ | ||
37 | bp::args("self", "actuation"), \ | ||
38 | "Create actuation data collection.\n\n" \ | ||
39 | ":param actuation: actuation data")) \ | ||
40 | .def(DataCollectorActuationVisitor<Data>()) \ | ||
41 | .def(CopyableVisitor<Data>()); | ||
42 | |||
43 | 10 | void exposeDataCollectorActuation() { | |
44 |
13/26✓ Branch 3 taken 10 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 10 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 10 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 10 times.
✗ Branch 13 not taken.
✓ Branch 18 taken 10 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 10 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 10 times.
✗ Branch 25 not taken.
✓ Branch 29 taken 10 times.
✗ Branch 30 not taken.
✓ Branch 32 taken 10 times.
✗ Branch 33 not taken.
✓ Branch 35 taken 10 times.
✗ Branch 36 not taken.
✓ Branch 38 taken 10 times.
✗ Branch 39 not taken.
✓ Branch 41 taken 10 times.
✗ Branch 42 not taken.
✓ Branch 44 taken 10 times.
✗ Branch 45 not taken.
|
20 | CROCODDYL_PYTHON_SCALARS(CROCODDYL_DATA_COLLECTOR_JOINT_PYTHON_BINDINGS) |
45 | 10 | } | |
46 | |||
47 | } // namespace python | ||
48 | } // namespace crocoddyl | ||
49 |