GCC Code Coverage Report


Directory: ./
File: bindings/python/crocoddyl/core/actuation/squashing-base.hpp
Date: 2025-01-16 08:47:40
Exec Total Coverage
Lines: 2 10 20.0%
Branches: 0 28 0.0%

Line Branch Exec Source
1 ///////////////////////////////////////////////////////////////////////////////
2 // BSD 3-Clause License
3 //
4 // Copyright (C) 2019-2020, University of Edinburgh, IRI: CSIC-UPC
5 // Copyright note valid unless otherwise stated in individual files.
6 // All rights reserved.
7 ///////////////////////////////////////////////////////////////////////////////
8
9 #ifndef BINDINGS_PYTHON_CROCODDYL_CORE_SQUASHING_BASE_HPP_
10 #define BINDINGS_PYTHON_CROCODDYL_CORE_SQUASHING_BASE_HPP_
11
12 #include "crocoddyl/core/actuation/squashing-base.hpp"
13 #include "crocoddyl/core/utils/exception.hpp"
14 #include "python/crocoddyl/core/core.hpp"
15
16 namespace crocoddyl {
17 namespace python {
18
19 class SquashingModelAbstract_wrap : public SquashingModelAbstract,
20 public bp::wrapper<SquashingModelAbstract> {
21 public:
22 1 SquashingModelAbstract_wrap(const std::size_t ns)
23 1 : SquashingModelAbstract(ns), bp::wrapper<SquashingModelAbstract>() {}
24
25 void calc(const boost::shared_ptr<SquashingDataAbstract>& data,
26 const Eigen::Ref<const Eigen::VectorXd>& s) {
27 assert_pretty(static_cast<std::size_t>(s.size()) == ns_,
28 "s has wrong dimension");
29 return bp::call<void>(this->get_override("calc").ptr(), data,
30 (Eigen::VectorXd)s);
31 }
32
33 void calcDiff(const boost::shared_ptr<SquashingDataAbstract>& data,
34 const Eigen::Ref<const Eigen::VectorXd>& s) {
35 assert_pretty(static_cast<std::size_t>(s.size()) == ns_,
36 "s has wrong dimension");
37 return bp::call<void>(this->get_override("calcDiff").ptr(), data,
38 (Eigen::VectorXd)s);
39 }
40 };
41
42 } // namespace python
43 } // namespace crocoddyl
44
45 #endif // BINDINGS_PYTHON_CROCODDYL_CORE_SQUASHING_BASE_HPP_
46