Commit 045dd40c authored by ggory15's avatar ggory15
Browse files

Add python binding

parent baecd2af
......@@ -48,7 +48,7 @@ ELSE(WIN32)
ENDIF(WIN32)
# --- OPTIONS ----------------------------------------
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" OFF)
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
OPTION (BUILD_UNIT_TESTS "Build the unitary tests" ON)
OPTION (INITIALIZE_WITH_NAN "Initialize Eigen entries with NaN" OFF)
OPTION (EIGEN_RUNTIME_NO_MALLOC "If ON, it can assert in case of runtime allocation" ON)
......@@ -75,16 +75,19 @@ ENDIF(EIGEN_NO_AUTOMATIC_RESIZING)
ADD_REQUIRED_DEPENDENCY("eigen3 >= 3.2.0") # Eigen::Ref appeared from 3.2.0
ADD_REQUIRED_DEPENDENCY("pinocchio >= 1.3.0")
SET(BOOST_COMPONENTS unit_test_framework)
SET(BOOST_REQUIERED_COMPONENTS filesystem system)
SET(BOOST_BUILD_COMPONENTS unit_test_framework)
SET(BOOST_OPTIONAL_COMPONENTS "")
IF(BUILD_PYTHON_INTERFACE)
ADD_COMPILE_DEPENDENCY("eigenpy >= 1.3.1")
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
FINDPYTHON(2.7 EXACT REQUIRED)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
SET(BOOST_OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS} python)
FINDPYTHON()
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
ENDIF(BUILD_PYTHON_INTERFACE)
SET(BOOST_COMPONENTS ${BOOST_REQUIERED_COMPONENTS} ${BOOST_OPTIONAL_COMPONENTS} ${BOOST_BUILD_COMPONENTS})
SEARCH_FOR_BOOST()
# Path to boost headers
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
# ----------------------------------------------------
......@@ -186,7 +189,8 @@ ENDFOREACH(header ${HEADERS})
ADD_SUBDIRECTORY(src)
# --- BINDINGS ----------------------------------------------------------------
#ADD_SUBDIRECTORY(bindings)
SET(PYWRAP ${PROJECT_NAME}_pywrap)
ADD_SUBDIRECTORY(bindings)
# --- UNIT TESTS ---------------------------------------------------------------
ADD_SUBDIRECTORY(unittest)
......
......@@ -26,3 +26,23 @@ To install [pinocchio](https://github.com/stack-of-tasks/pinocchio) follow the i
cd _build-RELEASE
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$DEVEL/openrobots
make install
## TSID for Python
To operate it in python environment, we offer python binding module using boost::python and eigenpy
To install eigenpy on Ubuntu,
git clone https://github.com/stack-of-tasks/eigenpy
or sudo apt install robotpkg-py27-eigenpy
For testing TSID in python, you can operate unit test scripts in script folder.
For instance,
ipython script/test_formulation.py
To operate demo with gepetto-viewer
ipython demo/demo_romeo.py
#
# Copyright (c) 2016 CNRS
#
# This file is part of Pinocchio
# pinocchio is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
# pinocchio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# pinocchio If not, see
# <http://www.gnu.org/licenses/>.
IF(BUILD_PYTHON_INTERFACE)
ADD_SUBDIRECTORY(python)
ENDIF(BUILD_PYTHON_INTERFACE)
# --- MACROS --- #
MACRO(SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH)
FOREACH(header ${HEADERS})
GET_FILENAME_COMPONENT(headerName ${header} NAME)
GET_FILENAME_COMPONENT(headerPath ${header} PATH)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E ${LINK}
${CMAKE_CURRENT_SOURCE_DIR}/${header}
${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/${SUBPATH}/${header})
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${header}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}/${SUBPATH}/${headerPath}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
ENDFOREACH(header)
ENDMACRO(SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH)
# --- PYTHON TARGET --- #
ADD_CUSTOM_TARGET(python)
SET_TARGET_PROPERTIES(python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)
# --- DEPENDENCIES --- #
SET(PKG_CONFIG_PYWRAP_REQUIRES "eigenpy >= 1.4.0")
FOREACH(dep ${PKG_CONFIG_PYWRAP_REQUIRES})
ADD_COMPILE_DEPENDENCY(${dep})
ENDFOREACH(dep ${PKG_CONFIG_PYWRAP_REQUIRES})
# --- LIBRARY --- #
SET(${PYWRAP}_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/${PROJECT_NAME})
SET(${PROJECT_NAME}_PYTHON_HEADERS
robots/robot-wrapper.hpp
robots/expose-robots.hpp
constraint/constraint-bound.hpp
constraint/constraint-equality.hpp
constraint/constraint-inequality.hpp
constraint/expose-constraints.hpp
contacts/expose-contact.hpp
contacts/contact.hpp
trajectories/expose-trajectories.hpp
trajectories/trajectory-euclidian.hpp
trajectories/trajectory-se3.hpp
trajectories/trajectory-base.hpp
tasks/expose-tasks.hpp
tasks/task-com-equality.hpp
tasks/task-se3-equality.hpp
tasks/task-joint-posture.hpp
utils/container.hpp
solvers/expose-solvers.hpp
solvers/solver-HQP-eiquadprog.hpp
solvers/HQPData.hpp
solvers/HQPOutput.hpp
formulations/formulation.hpp
formulations/expose-formulations.hpp
)
SET(${PROJECT_NAME}_PYTHON_SOURCES
module.cpp
robots/robot-wrapper.cpp
constraint/constraint-bound.cpp
constraint/constraint-equality.cpp
constraint/constraint-inequality.cpp
contacts/contact.cpp
trajectories/trajectory-euclidian.cpp
trajectories/trajectory-se3.cpp
trajectories/trajectory-base.cpp
tasks/task-com-equality.cpp
tasks/task-se3-equality.cpp
tasks/task-joint-posture.cpp
solvers/solver-HQP-eiquadprog.cpp
solvers/HQPData.cpp
solvers/HQPOutput.cpp
formulations/formulation.cpp
)
LIST(APPEND HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS})
LIST(REMOVE_DUPLICATES HEADERS)
# Headers of the python binding
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/tsid/bindings/python")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/tsid/bindings/python/robots")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/tsid/bindings/python/constraint")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/tsid/bindings/python/contacts")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/tsid/bindings/python/trajectories")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/tsid/bindings/python/tasks")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/tsid/bindings/python/solvers")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/tsid/bindings/python/formulations")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/tsid/bindings/python/utils")
SYMLINK_AND_INSTALL_HEADERS("${${PROJECT_NAME}_PYTHON_HEADERS}" "bindings/python")
# --- COMPILE WRAPPER
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/bindings/python/${PROJECT_NAME}")
SET(${PYWRAP}_SOURCES ${${PROJECT_NAME}_PYTHON_SOURCES})
SET(${PYWRAP}_HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS})
ADD_LIBRARY(${PYWRAP} SHARED ${${PYWRAP}_SOURCES} ${${PYWRAP}_HEADERS})
ADD_DEPENDENCIES(python ${PYWRAP})
IF(BUILD_WITH_COMMIT_VERSION)
TAG_LIBRARY_VERSION(${PYWRAP})
ENDIF(BUILD_WITH_COMMIT_VERSION)
ADD_HEADER_GROUP(${PYWRAP}_HEADERS)
ADD_SOURCE_GROUP(${PYWRAP}_SOURCES)
PKG_CONFIG_USE_DEPENDENCY(${PYWRAP} eigenpy)
TARGET_LINK_LIBRARIES(${PYWRAP} ${PROJECT_NAME})
TARGET_LINK_BOOST_PYTHON(${PYWRAP})
IF(APPLE)
# We need to change the extension for python bindings
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES SUFFIX ".so")
ENDIF(APPLE)
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bindings/python/${PROJECT_NAME}")
INSTALL(TARGETS ${PYWRAP} DESTINATION ${${PYWRAP}_INSTALL_DIR})
# --- INSTALL SCRIPTS
SET(PYTHON_FILES
__init__.py
)
FOREACH(python ${PYTHON_FILES})
INSTALL(FILES
"${${PROJECT_NAME}_SOURCE_DIR}/bindings/python/${python}"
DESTINATION ${${PYWRAP}_INSTALL_DIR})
ENDFOREACH(python)
# --- PACKAGING --- #
# Format string
SET(_PKG_CONFIG_PYWRAP_LIBDIR ${${PYWRAP}_INSTALL_DIR})
SET(_PKG_CONFIG_PYWRAP_BINDIR ${${PYWRAP}_INSTALL_DIR})
SET(_PKG_CONFIG_PYWRAP_CONFLICTS)
SET(_PKG_CONFIG_PYWRAP_REQUIRES "${PROJECT_NAME}")
FOREACH(dep ${PKG_CONFIG_PYWRAP_REQUIRES})
SET(_PKG_CONFIG_PYWRAP_REQUIRES "${_PKG_CONFIG_PYWRAP_REQUIRES}, ${dep}")
ENDFOREACH(dep ${PKG_CONFIG_PYWRAP_REQUIRES})
SET(_PKG_CONFIG_PYWRAP_LIBS "-L\${libdir} -l${PYWRAP}")
IF(APPLE)
SET(_PKG_CONFIG_PYWRAP_LIBS "${_PKG_CONFIG_PYWRAP_LIBS} -Wl,-undefined,dynamic_lookup,${Boost_${UPPERCOMPONENT}_LIBRARY}")
ELSE(APPLE)
SET(_PKG_CONFIG_PYWRAP_LIBS "${_PKG_CONFIG_PYWRAP_LIBS} ${LIBINCL_KW}boost_python")
ENDIF(APPLE)
SET(_PKG_CONFIG_PYWRAP_CFLAGS "-I\${includedir} -I/usr/local/include")
SET(_PKG_CONFIG_PYWRAP_CFLAGS "${_PKG_CONFIG_PYWRAP_CFLAGS} -I${PYTHON_INCLUDE_DIRS}")
FOREACH(cflags ${CFLAGS_DEPENDENCIES})
SET(_PKG_CONFIG_PYWRAP_CFLAGS "${_PKG_CONFIG_PYWRAP_CFLAGS} ${cflags}")
ENDFOREACH(cflags ${CFLAGS_DEPENDENCIES})
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/tsidpy.pc.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/tsidpy.pc")
INSTALL(
FILES "${CMAKE_CURRENT_BINARY_DIR}/tsidpy.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
import libtsid_pywrap as tsid
from libtsid_pywrap import *
#include "tsid/bindings/python/constraint/constraint-bound.hpp"
#include "tsid/bindings/python/constraint/expose-constraints.hpp"
namespace tsid
{
namespace python
{
void exposeConstraintBound()
{
ConstraintPythonVisitor<tsid::math::ConstraintBound>::expose("ConstraintBound");
}
}
}
#ifndef __tsid_python_constriant_bound_hpp__
#define __tsid_python_constriant_bound_hpp__
#include <boost/python.hpp>
#include <string>
#include <eigenpy/eigenpy.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include "tsid/math/constraint-bound.hpp"
namespace tsid
{
namespace python
{
namespace bp = boost::python;
template<typename ConstraintBound>
struct ConstraintPythonVisitor
: public boost::python::def_visitor< ConstraintPythonVisitor<ConstraintBound> >
{
typedef double Scalar;
typedef Eigen::Matrix<Scalar,Eigen::Dynamic,1> Vector;
typedef Eigen::Ref<Vector> RefVector;
typedef const Eigen::Ref<const Vector> ConstRefVector;
template<class PyClass>
void visit(PyClass& cl) const
{
cl
.def(bp::init<std::string>((bp::arg("name")), "Default constructor with name."))
.def(bp::init<std::string, unsigned int>((bp::arg("name"), bp::arg("size")), "Default constructor with name and size."))
.def(bp::init<std::string, Eigen::VectorXd, Eigen::VectorXd>((bp::arg("name"), bp::arg("lb"), bp::arg("ub")), "Default constructor with name and constraint."))
.add_property("rows", &ConstraintBound::rows)
.add_property("cols", &ConstraintBound::cols)
.def("resize",&ConstraintBound::resize, (bp::arg("r"), bp::arg("c")),"Resize constraint size.")
.add_property("isEquality", &ConstraintBound::isEquality)
.add_property("isInequality", &ConstraintBound::isInequality)
.add_property("isBound", &ConstraintBound::isBound)
.add_property("vector", &ConstraintPythonVisitor::vector)
.add_property("lowerBound", &ConstraintPythonVisitor::lowerBound)
.add_property("upperBound", &ConstraintPythonVisitor::upperBound)
.def("setVector", (bool (ConstraintBound::*)(const Eigen::VectorXd &) const) &ConstraintBound::setVector, bp::args("vector"), "Set Vector")
.def("setLowerBound", (bool (ConstraintBound::*)(const Eigen::VectorXd &) const) &ConstraintBound::setLowerBound, bp::args("lb"), "Set LowerBound")
.def("setUpperBound", (bool (ConstraintBound::*)(const Eigen::VectorXd &) const) &ConstraintBound::setUpperBound, bp::args("ub"), "Set UpperBound")
;
}
static Eigen::VectorXd vector (const ConstraintBound & self) {return self.vector();}
static Eigen::VectorXd lowerBound (const ConstraintBound & self) {return self.lowerBound();}
static Eigen::VectorXd upperBound (const ConstraintBound & self) {return self.upperBound();}
static void expose(const std::string & class_name)
{
std::string doc = "Constraint Bound info.";
bp::class_<ConstraintBound>(class_name.c_str(),
doc.c_str(),
bp::no_init)
.def(ConstraintPythonVisitor<ConstraintBound>());
}
};
}
}
#endif // ifndef __tsid_python_constriant_bound_hpp__
\ No newline at end of file
#include "tsid/bindings/python/constraint/constraint-equality.hpp"
#include "tsid/bindings/python/constraint/expose-constraints.hpp"
namespace tsid
{
namespace python
{
void exposeConstraintEquality()
{
ConstraintEqPythonVisitor<tsid::math::ConstraintEquality>::expose("ConstraintEquality");
}
}
}
#ifndef __tsid_python_constriant_equality_hpp__
#define __tsid_python_constriant_equality_hpp__
#include <boost/python.hpp>
#include <string>
#include <eigenpy/eigenpy.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include "tsid/math/constraint-equality.hpp"
namespace tsid
{
namespace python
{
namespace bp = boost::python;
template<typename ConstraintEquality>
struct ConstraintEqPythonVisitor
: public boost::python::def_visitor< ConstraintEqPythonVisitor<ConstraintEquality> >
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef double Scalar;
typedef Eigen::Matrix<Scalar,Eigen::Dynamic,1> Vector;
typedef Eigen::Ref<Vector> RefVector;
typedef const Eigen::Ref<const Vector> ConstRefVector;
template<class PyClass>
void visit(PyClass& cl) const
{
cl
.def(bp::init<std::string>((bp::arg("name")), "Default constructor with name."))
.def(bp::init<std::string, unsigned int, unsigned int>((bp::arg("name"), bp::arg("row"), bp::arg("col")), "Default constructor with name and size."))
.def(bp::init<std::string, Eigen::MatrixXd, Eigen::VectorXd>((bp::arg("name"), bp::arg("A"), bp::arg("b")), "Default constructor with name and constraint."))
.add_property("rows", &ConstraintEquality::rows)
.add_property("cols", &ConstraintEquality::cols)
.def("resize",&ConstraintEquality::resize, (bp::arg("r"), bp::arg("c")),"Resize constraint size.")
.add_property("isEquality", &ConstraintEquality::isEquality)
.add_property("isInequality", &ConstraintEquality::isInequality)
.add_property("isBound", &ConstraintEquality::isBound)
.add_property("matrix", &ConstraintEqPythonVisitor::matrix)
.add_property("vector", &ConstraintEqPythonVisitor::vector)
.add_property("lowerBound", &ConstraintEqPythonVisitor::lowerBound)
.add_property("upperBound", &ConstraintEqPythonVisitor::upperBound)
.def("setMatrix", (bool (ConstraintEquality::*)(const Eigen::MatrixXd &) const) &ConstraintEquality::setMatrix, bp::args("matrix"), "Set Matrix")
.def("setVector", (bool (ConstraintEquality::*)(const Eigen::VectorXd &) const) &ConstraintEquality::setVector, bp::args("vector"), "Set Vector")
.def("setLowerBound", (bool (ConstraintEquality::*)(const Eigen::VectorXd &) const) &ConstraintEquality::setLowerBound, bp::args("lb"), "Set LowerBound")
.def("setUpperBound", (bool (ConstraintEquality::*)(const Eigen::VectorXd &) const) &ConstraintEquality::setUpperBound, bp::args("ub"), "Set UpperBound")
;
}
static Eigen::MatrixXd matrix (const ConstraintEquality & self) {return self.matrix();}
static Eigen::VectorXd vector (const ConstraintEquality & self) {return self.vector();}
static Eigen::VectorXd lowerBound (const ConstraintEquality & self) {return self.lowerBound();}
static Eigen::VectorXd upperBound (const ConstraintEquality & self) {return self.upperBound();}
static void expose(const std::string & class_name)
{
std::string doc = "Constraint Equality info.";
bp::class_<ConstraintEquality>(class_name.c_str(),
doc.c_str(),
bp::no_init)
.def(ConstraintEqPythonVisitor<ConstraintEquality>());
eigenpy::enableEigenPySpecific<Eigen::MatrixXd>();
}
};
}
}
#endif // ifndef __tsid_python_constriant_equality_hpp__
\ No newline at end of file
#include "tsid/bindings/python/constraint/constraint-inequality.hpp"
#include "tsid/bindings/python/constraint/expose-constraints.hpp"
namespace tsid
{
namespace python
{
void exposeConstraintInequality()
{
ConstraintIneqPythonVisitor<tsid::math::ConstraintInequality>::expose("ConstraintInequality");
}
}
}
#ifndef __tsid_python_constriant_inequality_hpp__
#define __tsid_python_constriant_inequality_hpp__
#include <boost/python.hpp>
#include <string>
#include <eigenpy/eigenpy.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include "tsid/math/constraint-inequality.hpp"
namespace tsid
{
namespace python
{
namespace bp = boost::python;
template<typename ConstraintInequality>
struct ConstraintIneqPythonVisitor
: public boost::python::def_visitor< ConstraintIneqPythonVisitor<ConstraintInequality> >
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef double Scalar;
typedef Eigen::Matrix<Scalar,Eigen::Dynamic,1> Vector;
typedef Eigen::Ref<Vector> RefVector;
typedef const Eigen::Ref<const Vector> ConstRefVector;
template<class PyClass>
void visit(PyClass& cl) const
{
cl
.def(bp::init<std::string>((bp::arg("name")), "Default constructor with name."))
.def(bp::init<std::string, unsigned int, unsigned int>((bp::arg("name"), bp::arg("row"), bp::arg("col")), "Default constructor with name and size."))
.def(bp::init<std::string, Eigen::MatrixXd, Eigen::VectorXd, Eigen::VectorXd>((bp::arg("name"), bp::arg("A"), bp::arg("lb"), bp::arg("ub")), "Default constructor with name and constraint."))
.add_property("rows", &ConstraintInequality::rows)
.add_property("cols", &ConstraintInequality::cols)
.def("resize",&ConstraintInequality::resize, (bp::arg("r"), bp::arg("c")),"Resize constraint size.")
.add_property("isEquality", &ConstraintInequality::isEquality)
.add_property("isInequality", &ConstraintInequality::isInequality)
.add_property("isBound", &ConstraintInequality::isBound)
.add_property("matrix", &ConstraintIneqPythonVisitor::matrix)
.add_property("vector", &ConstraintIneqPythonVisitor::vector)
.add_property("lowerBound", &ConstraintIneqPythonVisitor::lowerBound)
.add_property("upperBound", &ConstraintIneqPythonVisitor::upperBound)
.def("setMatrix", (bool (ConstraintInequality::*)(const Eigen::MatrixXd &) const) &ConstraintInequality::setMatrix, bp::args("matrix"), "Set Matrix")
.def("setVector", (bool (ConstraintInequality::*)(const Eigen::VectorXd &) const) &ConstraintInequality::setVector, bp::args("vector"), "Set Vector")
.def("setLowerBound", (bool (ConstraintInequality::*)(const Eigen::VectorXd &) const) &ConstraintInequality::setLowerBound, bp::args("lb"), "Set LowerBound")
.def("setUpperBound", (bool (ConstraintInequality::*)(const Eigen::VectorXd &) const) &ConstraintInequality::setUpperBound, bp::args("ub"), "Set UpperBound")
;
}
static Eigen::MatrixXd matrix (const ConstraintInequality & self) {return self.matrix();}
static Eigen::VectorXd vector (const ConstraintInequality & self) {return self.vector();}
static Eigen::VectorXd lowerBound (const ConstraintInequality & self) {return self.lowerBound();}
static Eigen::VectorXd upperBound (const ConstraintInequality & self) {return self.upperBound();}
static void expose(const std::string & class_name)
{
std::string doc = "Constraint Inequality info.";
bp::class_<ConstraintInequality>(class_name.c_str(),
doc.c_str(),
bp::no_init)
.def(ConstraintIneqPythonVisitor<ConstraintInequality>());
}
};
}
}
#endif // ifndef __tsid_python_constriant_inequality_hpp__
\ No newline at end of file
#ifndef __tsid_python_expose_constraint_bound_hpp__
#define __tsid_python_expose_constraint_bound_hpp__
#include "tsid/bindings/python/constraint/constraint-bound.hpp"
#include "tsid/bindings/python/constraint/constraint-equality.hpp"
#include "tsid/bindings/python/constraint/constraint-inequality.hpp"
namespace tsid
{
namespace python
{
void exposeConstraintBound();
void exposeConstraintEquality();
void exposeConstraintInequality();
inline void exposeConstraints()
{
exposeConstraintBound();
exposeConstraintEquality();
exposeConstraintInequality();
}
} // namespace python
} // namespace tsid
#endif // ifndef __tsid_python_expose_constraint_bound_hpp__
#include "tsid/bindings/python/contacts/contact.hpp"
#include "tsid/bindings/python/contacts/expose-contact.hpp"
namespace tsid
{
namespace python
{
void exposeContact6d()
{
ContactPythonVisitor<tsid::contacts::Contact6d>::expose("Contact6d");
}
}
}
#ifndef __tsid_python_contact_hpp__
#define __tsid_python_contact_hpp__
#include <boost/python.hpp>
#include <string>
#include <eigenpy/eigenpy.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include "tsid/contacts/contact-6d.hpp"
#include "tsid/robots/robot-wrapper.hpp"
#include "tsid/math/constraint-inequality.hpp"
#include "tsid/math/constraint-equality.hpp"
#include "tsid/math/constraint-base.hpp"
#include "tsid/tasks/task-se3-equality.hpp"
namespace tsid
{
namespace python
{
namespace bp = boost::python;
template<typename Contact6d>
struct ContactPythonVisitor
: public boost::python::def_visitor< ContactPythonVisitor<Contact6d> >
{
template<class PyClass>
void visit(PyClass& cl) const
{
cl