Directory: | ./ |
---|---|
File: | bindings/python/crocoddyl/multibody/data/contacts.cpp |
Date: | 2025-01-16 08:47:40 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 24 | 27 | 88.9% |
Branches: | 17 | 34 | 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 "crocoddyl/multibody/data/contacts.hpp" | ||
10 | |||
11 | #include "python/crocoddyl/multibody/multibody.hpp" | ||
12 | #include "python/crocoddyl/utils/copyable.hpp" | ||
13 | |||
14 | namespace crocoddyl { | ||
15 | namespace python { | ||
16 | |||
17 | 10 | void exposeDataCollectorContacts() { | |
18 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::class_<DataCollectorContact, bp::bases<DataCollectorAbstract> >( |
19 | "DataCollectorContact", "Contact data collector.\n\n", | ||
20 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::init<boost::shared_ptr<ContactDataMultiple> >( |
21 | 20 | bp::args("self", "contacts"), | |
22 | "Create contact data collection.\n\n" | ||
23 | ":param contacts: contacts data")) | ||
24 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
25 | "contacts", | ||
26 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_getter(&DataCollectorContact::contacts, |
27 | 10 | bp::return_value_policy<bp::return_by_value>()), | |
28 | "contacts data") | ||
29 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def(CopyableVisitor<DataCollectorContact>()); |
30 | |||
31 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::class_<DataCollectorMultibodyInContact, |
32 | bp::bases<DataCollectorMultibody, DataCollectorContact> >( | ||
33 | "DataCollectorMultibodyInContact", | ||
34 | "Data collector for multibody systems in contact.\n\n", | ||
35 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::init<pinocchio::Data*, boost::shared_ptr<ContactDataMultiple> >( |
36 | 10 | bp::args("self", "pinocchio", "contacts"), | |
37 | "Create multibody data collection.\n\n" | ||
38 | ":param pinocchio: Pinocchio data\n" | ||
39 | ✗ | ":param contacts: contacts data")[bp::with_custodian_and_ward<1, | |
40 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | 2>()]) |
41 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def(CopyableVisitor<DataCollectorMultibodyInContact>()); |
42 | |||
43 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::class_< |
44 | DataCollectorActMultibodyInContact, | ||
45 | bp::bases<DataCollectorMultibodyInContact, DataCollectorActuation> >( | ||
46 | "DataCollectorActMultibodyInContact", | ||
47 | "Data collector for actuated multibody systems in contact.\n\n", | ||
48 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::init<pinocchio::Data*, boost::shared_ptr<ActuationDataAbstract>, |
49 | boost::shared_ptr<ContactDataMultiple> >( | ||
50 | 10 | bp::args("self", "pinocchio", "actuation", "contacts"), | |
51 | "Create multibody data collection.\n\n" | ||
52 | ":param pinocchio: Pinocchio data\n" | ||
53 | ":param actuation: actuation data\n" | ||
54 | ✗ | ":param contacts: contacts data")[bp::with_custodian_and_ward<1, | |
55 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | 2>()]) |
56 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def(CopyableVisitor<DataCollectorActMultibodyInContact>()); |
57 | |||
58 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::class_< |
59 | DataCollectorJointActMultibodyInContact, | ||
60 | bp::bases<DataCollectorActMultibodyInContact, DataCollectorJoint> >( | ||
61 | "DataCollectorJointActMultibodyInContact", | ||
62 | "Data collector for actuated-joint multibody systems in contact.\n\n", | ||
63 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::init<pinocchio::Data*, boost::shared_ptr<ActuationDataAbstract>, |
64 | boost::shared_ptr<JointDataAbstract>, | ||
65 | boost::shared_ptr<ContactDataMultiple> >( | ||
66 | 10 | bp::args("self", "pinocchio", "actuation", "joint", "contacts"), | |
67 | "Create multibody data collection.\n\n" | ||
68 | ":param pinocchio: Pinocchio data\n" | ||
69 | ":param actuation: actuation data\n" | ||
70 | ":param joint: joint data\n" | ||
71 | ✗ | ":param contacts: contacts data")[bp::with_custodian_and_ward<1, | |
72 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | 2>()]) |
73 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def(CopyableVisitor<DataCollectorJointActMultibodyInContact>()); |
74 | 10 | } | |
75 | |||
76 | } // namespace python | ||
77 | } // namespace crocoddyl | ||
78 |