Directory: | ./ |
---|---|
File: | bindings/python/crocoddyl/multibody/data/multibody.cpp |
Date: | 2025-01-16 08:47:40 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 20 | 21 | 95.2% |
Branches: | 14 | 28 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | ||
2 | // BSD 3-Clause License | ||
3 | // | ||
4 | // Copyright (C) 2019-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 "python/crocoddyl/multibody/multibody.hpp" | ||
10 | |||
11 | #include "crocoddyl/multibody/data/multibody.hpp" | ||
12 | #include "python/crocoddyl/utils/copyable.hpp" | ||
13 | |||
14 | namespace crocoddyl { | ||
15 | namespace python { | ||
16 | |||
17 | 10 | void exposeDataCollectorMultibody() { | |
18 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::class_<DataCollectorMultibody, bp::bases<DataCollectorAbstract> >( |
19 | "DataCollectorMultibody", "Data collector for multibody systems.\n\n", | ||
20 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::init<pinocchio::Data*>( |
21 | 10 | bp::args("self", "pinocchio"), | |
22 | "Create multibody data collection.\n\n" | ||
23 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | ":param data: Pinocchio data")[bp::with_custodian_and_ward<1, 2>()]) |
24 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("pinocchio", |
25 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_getter(&DataCollectorMultibody::pinocchio, |
26 | 10 | bp::return_internal_reference<>()), | |
27 | "pinocchio data") | ||
28 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def(CopyableVisitor<DataCollectorMultibody>()); |
29 | |||
30 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::class_<DataCollectorActMultibody, |
31 | bp::bases<DataCollectorMultibody, DataCollectorActuation> >( | ||
32 | "DataCollectorActMultibody", | ||
33 | "Data collector for actuated multibody systems.\n\n", | ||
34 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::init<pinocchio::Data*, boost::shared_ptr<ActuationDataAbstract> >( |
35 | 10 | bp::args("self", "pinocchio", "actuation"), | |
36 | "Create multibody data collection.\n\n" | ||
37 | ":param pinocchio: Pinocchio data\n" | ||
38 | ✗ | ":param actuation: actuation data")[bp::with_custodian_and_ward<1, | |
39 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | 2>()]) |
40 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def(CopyableVisitor<DataCollectorActMultibody>()); |
41 | |||
42 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::class_<DataCollectorJointActMultibody, |
43 | bp::bases<DataCollectorActMultibody, DataCollectorJoint> >( | ||
44 | "DataCollectorJointActMultibody", | ||
45 | "Data collector for actuated-joint multibody systems.\n\n", | ||
46 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::init<pinocchio::Data*, boost::shared_ptr<ActuationDataAbstract>, |
47 | boost::shared_ptr<JointDataAbstract> >( | ||
48 | 10 | bp::args("self", "pinocchio", "actuation", "joint"), | |
49 | "Create multibody data collection.\n\n" | ||
50 | ":param pinocchio: Pinocchio data\n" | ||
51 | ":param actuation: actuation data\n" | ||
52 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | ":param joint: joint data")[bp::with_custodian_and_ward<1, 2>()]) |
53 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def(CopyableVisitor<DataCollectorJointActMultibody>()); |
54 | 10 | } | |
55 | |||
56 | } // namespace python | ||
57 | } // namespace crocoddyl | ||
58 |