| Line |
Branch |
Exec |
Source |
| 1 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
| 2 |
|
|
// BSD 3-Clause License |
| 3 |
|
|
// |
| 4 |
|
|
// Copyright (C) 2018-2020, LAAS-CNRS, University of Edinburgh, INRIA |
| 5 |
|
|
// Copyright note valid unless otherwise stated in individual files. |
| 6 |
|
|
// All rights reserved. |
| 7 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
| 8 |
|
|
|
| 9 |
|
|
#include "crocoddyl/core/utils/version.hpp" |
| 10 |
|
|
#include "fwd.hpp" |
| 11 |
|
|
#include "vector-converter.hpp" |
| 12 |
|
|
|
| 13 |
|
|
namespace quadruped_walkgen { |
| 14 |
|
|
namespace python { |
| 15 |
|
|
|
| 16 |
|
|
namespace bp = boost::python; |
| 17 |
|
|
|
| 18 |
|
✗ |
BOOST_PYTHON_MODULE(quadruped_walkgen_pywrap) { |
| 19 |
|
✗ |
bp::scope().attr("__version__") = crocoddyl::printVersion(); |
| 20 |
|
|
|
| 21 |
|
✗ |
eigenpy::enableEigenPy(); |
| 22 |
|
|
|
| 23 |
|
|
typedef double Scalar; |
| 24 |
|
|
typedef Eigen::Matrix<Scalar, 6, 1> Vector6; |
| 25 |
|
|
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 3> MatrixX3; |
| 26 |
|
|
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> VectorX; |
| 27 |
|
|
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> MatrixX; |
| 28 |
|
|
|
| 29 |
|
✗ |
eigenpy::enableEigenPySpecific<Vector6>(); |
| 30 |
|
✗ |
eigenpy::enableEigenPySpecific<MatrixX3>(); |
| 31 |
|
|
|
| 32 |
|
|
// Register converters between std::vector and Python list |
| 33 |
|
|
// TODO(cmastalli): figure out how to convert std::vector<double> to Python |
| 34 |
|
|
// list bp::to_python_converter<std::vector<double, std::allocator<double> >, |
| 35 |
|
|
// vector_to_list<double, false>, true>(); |
| 36 |
|
|
// bp::to_python_converter<std::vector<VectorX, std::allocator<VectorX> >, |
| 37 |
|
|
// vector_to_list<VectorX, false>, true>(); |
| 38 |
|
|
// bp::to_python_converter<std::vector<MatrixX, std::allocator<MatrixX> >, |
| 39 |
|
|
// vector_to_list<MatrixX, false>, true>(); |
| 40 |
|
✗ |
list_to_vector() |
| 41 |
|
✗ |
.from_python<std::vector<double, std::allocator<double> > >() |
| 42 |
|
✗ |
.from_python<std::vector<VectorX, std::allocator<VectorX> > >() |
| 43 |
|
✗ |
.from_python<std::vector<MatrixX, std::allocator<MatrixX> > >(); |
| 44 |
|
|
|
| 45 |
|
✗ |
exposeCore(); |
| 46 |
|
|
} |
| 47 |
|
|
|
| 48 |
|
|
} // namespace python |
| 49 |
|
|
} // namespace quadruped_walkgen |
| 50 |
|
|
|