GCC Code Coverage Report


Directory: ./
File: bindings/python/crocoddyl/multibody/data/impulses.cpp
Date: 2025-01-16 08:47:40
Exec Total Coverage
Lines: 14 15 93.3%
Branches: 9 18 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/impulses.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 exposeDataCollectorImpulses() {
18
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 bp::class_<DataCollectorImpulse, bp::bases<DataCollectorAbstract> >(
19 "DataCollectorImpulse", "Impulse data collector.\n\n",
20
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 bp::init<boost::shared_ptr<ImpulseDataMultiple> >(
21 20 bp::args("self", "impulses"),
22 "Create impulse data collection.\n\n"
23 ":param impulses: impulses data"))
24
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 .add_property(
25 "impulses",
26
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 bp::make_getter(&DataCollectorImpulse::impulses,
27 10 bp::return_value_policy<bp::return_by_value>()),
28 "impulses data")
29
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 .def(CopyableVisitor<DataCollectorImpulse>());
30
31
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 bp::class_<DataCollectorMultibodyInImpulse,
32 bp::bases<DataCollectorMultibody, DataCollectorImpulse> >(
33 "DataCollectorMultibodyInImpulse",
34 "Data collector for multibody systems in impulse.\n\n",
35
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 bp::init<pinocchio::Data*, boost::shared_ptr<ImpulseDataMultiple> >(
36 10 bp::args("self", "pinocchio", "impulses"),
37 "Create multibody data collection.\n\n"
38 ":param pinocchio: Pinocchio data\n"
39 ":param impulses: impulses 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<DataCollectorMultibodyInImpulse>());
42 10 }
43
44 } // namespace python
45 } // namespace crocoddyl
46