GCC Code Coverage Report


Directory: ./
File: bindings/python/crocoddyl/multibody/actuations/full.cpp
Date: 2025-02-24 23:41:29
Exec Total Coverage
Lines: 16 16 100.0%
Branches: 13 26 50.0%

Line Branch Exec Source
1 ///////////////////////////////////////////////////////////////////////////////
2 // BSD 3-Clause License
3 //
4 // Copyright (C) 2019-2023, LAAS-CNRS, University of Edinburgh
5 // Heriot-Watt University
6 // Copyright note valid unless otherwise stated in individual files.
7 // All rights reserved.
8 ///////////////////////////////////////////////////////////////////////////////
9
10 #include "crocoddyl/multibody/actuations/full.hpp"
11
12 #include "python/crocoddyl/multibody/multibody.hpp"
13 #include "python/crocoddyl/utils/copyable.hpp"
14
15 namespace crocoddyl {
16 namespace python {
17
18 10 void exposeActuationFull() {
19 10 bp::register_ptr_to_python<std::shared_ptr<crocoddyl::ActuationModelFull> >();
20
21
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 bp::class_<ActuationModelFull, bp::bases<ActuationModelAbstract> >(
22 "ActuationModelFull", "Full actuation models.",
23
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 bp::init<std::shared_ptr<StateAbstract> >(
24 20 bp::args("self", "state"),
25 "Initialize the full actuation model.\n\n"
26 ":param state: state of dynamical system"))
27
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 .def("calc", &ActuationModelFull::calc,
28
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
20 bp::args("self", "data", "x", "u"),
29 "Compute the actuation signal and actuation set from the joint "
30 "torque input u.\n\n"
31 ":param data: full actuation data\n"
32 ":param x: state point (dim. state.nx)\n"
33 ":param u: joint torque input (dim. nu)")
34
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 .def("calcDiff", &ActuationModelFull::calcDiff,
35
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
20 bp::args("self", "data", "x", "u"),
36 "Compute the derivatives of the actuation model.\n\n"
37 "It computes the partial derivatives of the full actuation. It "
38 "assumes that calc\n"
39 "has been run first. The reason is that the derivatives are "
40 "constant and\n"
41 "defined in createData. The Hessian is constant, so we don't write "
42 "again this value.\n"
43 ":param data: full actuation data\n"
44 ":param x: state point (dim. state.nx)\n"
45 ":param u: joint torque input (dim. nu)")
46
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 .def("commands", &ActuationModelFull::commands,
47
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
20 bp::args("self", "data", "x", "tau"),
48 "Compute the joint torque commands from the generalized torques.\n\n"
49 "It stores the results in data.u.\n"
50 ":param data: actuation data\n"
51 ":param x: state point (dim. state.nx)\n"
52 ":param tau: generalized torques (dim state.nv)")
53
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 .def("torqueTransform", &ActuationModelFull::torqueTransform,
54
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
20 bp::args("self", "data", "x", "tau"),
55 "Compute the torque transform from generalized torques to joint "
56 "torque inputs.\n\n"
57 "It stores the results in data.Mtau.\n"
58 ":param data: actuation data\n"
59 ":param x: state point (dim. state.nx)\n"
60 ":param tau: generalized torques (dim state.nv)")
61
2/4
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
20 .def("createData", &ActuationModelFull::createData, bp::args("self"),
62 "Create the full actuation data.\n\n"
63 "Each actuation model (AM) has its own data that needs to be "
64 "allocated.\n"
65 "This function returns the allocated data for a predefined AM.\n"
66 ":return AM data.")
67
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 .def(CopyableVisitor<ActuationModelFull>());
68 10 }
69
70 } // namespace python
71 } // namespace crocoddyl
72