Skip to content

Commit

Permalink
Merge branch 'devel' into 'devel'
Browse files Browse the repository at this point in the history
Format

See merge request loco-3d/multicontact-api!10
  • Loading branch information
nim65s committed Sep 12, 2019
2 parents b528980 + 7ab19b5 commit 9493409
Show file tree
Hide file tree
Showing 68 changed files with 3,275 additions and 3,970 deletions.
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ SET(PROJECT_DESCRIPTION "Multi-contact locomotion for multi-body systems")
SET(PROJECT_URL "https://gepgitlab.laas.fr/${PROJECT_NAMESPACE}/${PROJECT_NAME}")

OPTION(BUILD_PYTHON_INTERFACE "Build the python binding" ON)
OPTION (INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python binding" OFF)

IF(INSTALL_PYTHON_INTERFACE_ONLY)
SET(INSTALL_DOCUMENTATION OFF CACHE BOOL "documentation is not in python interface")
SET(INSTALL_GENERATED_HEADERS OFF CACHE BOOL "headers are not in python interface")
SET(INSTALL_PKG_CONFIG_FILE OFF CACHE BOOL ".pc is not in python interface")
ENDIF(INSTALL_PYTHON_INTERFACE_ONLY)

SET(DOXYGEN_USE_MATHJAX YES)
SET(CXX_DISABLE_WERROR True)
Expand All @@ -40,7 +47,9 @@ ENDIF(BUILD_PYTHON_INTERFACE)
SEARCH_FOR_BOOST()
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})

ADD_SUBDIRECTORY(include/${CUSTOM_HEADER_DIR})
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ADD_SUBDIRECTORY(include/${CUSTOM_HEADER_DIR})
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ADD_SUBDIRECTORY(bindings)
ADD_SUBDIRECTORY(unittest)

Expand Down
15 changes: 5 additions & 10 deletions bindings/python/geometry/ellipsoid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
#include "multicontact-api/bindings/python/geometry/ellipsoid.hpp"
#include "multicontact-api/bindings/python/geometry/expose-geometry.hpp"

namespace multicontact_api
{
namespace python
{
void exposeEllipsoid()
{
EllipsoidPythonVisitor<multicontact_api::geometry::Ellipsoid3d>::expose("Ellipsoid3d");
}
}
}
namespace multicontact_api {
namespace python {
void exposeEllipsoid() { EllipsoidPythonVisitor<multicontact_api::geometry::Ellipsoid3d>::expose("Ellipsoid3d"); }
} // namespace python
} // namespace multicontact_api
17 changes: 7 additions & 10 deletions bindings/python/geometry/linear-cone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
#include "multicontact-api/bindings/python/geometry/linear-cone.hpp"
#include "multicontact-api/bindings/python/geometry/expose-geometry.hpp"

namespace multicontact_api
{
namespace python
{
void exposeLinearCone()
{
ForceConePythonVisitor<multicontact_api::geometry::ForceCone>::expose("ForceCone");
WrenchConePythonVisitor<multicontact_api::geometry::WrenchCone>::expose("WrenchCone");
}
}
namespace multicontact_api {
namespace python {
void exposeLinearCone() {
ForceConePythonVisitor<multicontact_api::geometry::ForceCone>::expose("ForceCone");
WrenchConePythonVisitor<multicontact_api::geometry::WrenchCone>::expose("WrenchCone");
}
} // namespace python
} // namespace multicontact_api
17 changes: 7 additions & 10 deletions bindings/python/geometry/second-order-cone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
#include "multicontact-api/bindings/python/geometry/second-order-cone.hpp"
#include "multicontact-api/bindings/python/geometry/expose-geometry.hpp"

namespace multicontact_api
{
namespace python
{
void exposeSecondOrderCone()
{
SOCPythonVisitor<multicontact_api::geometry::SOC6d>::expose("SOC6");
SOCPythonVisitor<multicontact_api::geometry::SOC3d>::expose("SOC3");
}
}
namespace multicontact_api {
namespace python {
void exposeSecondOrderCone() {
SOCPythonVisitor<multicontact_api::geometry::SOC6d>::expose("SOC6");
SOCPythonVisitor<multicontact_api::geometry::SOC3d>::expose("SOC3");
}
} // namespace python
} // namespace multicontact_api
3 changes: 1 addition & 2 deletions bindings/python/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

namespace bp = boost::python;

BOOST_PYTHON_MODULE(libmulticontact_api)
{
BOOST_PYTHON_MODULE(libmulticontact_api) {
eigenpy::enableEigenPy();

using namespace multicontact_api::python;
Expand Down
15 changes: 6 additions & 9 deletions bindings/python/scenario/contact-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
#include "multicontact-api/bindings/python/scenario/expose-scenario.hpp"
#include "multicontact-api/bindings/python/scenario/contact-model-planar.hpp"

namespace multicontact_api
{
namespace python
{
void exposeContactModels()
{
ContactModelPlanarPythonVisitor<multicontact_api::scenario::ContactModelPlanar>::expose("ContactModelPlanar");
}
}
namespace multicontact_api {
namespace python {
void exposeContactModels() {
ContactModelPlanarPythonVisitor<multicontact_api::scenario::ContactModelPlanar>::expose("ContactModelPlanar");
}
} // namespace python
} // namespace multicontact_api
15 changes: 6 additions & 9 deletions bindings/python/scenario/contact-patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
#include "multicontact-api/bindings/python/scenario/expose-scenario.hpp"
#include "multicontact-api/bindings/python/scenario/contact-patch.hpp"

namespace multicontact_api
{
namespace python
{
void exposeContactPatch()
{
ContactPatchPythonVisitor<multicontact_api::scenario::ContactPatch>::expose("ContactPatch");
}
}
namespace multicontact_api {
namespace python {
void exposeContactPatch() {
ContactPatchPythonVisitor<multicontact_api::scenario::ContactPatch>::expose("ContactPatch");
}
} // namespace python
} // namespace multicontact_api
17 changes: 7 additions & 10 deletions bindings/python/scenario/contact-phase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
#include "multicontact-api/bindings/python/scenario/contact-phase.hpp"
#include "multicontact-api/bindings/python/scenario/contact-phase-humanoid.hpp"

namespace multicontact_api
{
namespace python
{
void exposeContactPhase()
{
ContactPhasePythonVisitor<multicontact_api::scenario::ContactPhase4>::expose("ContactPhase4");
ContactPhaseHumanoidPythonVisitor<multicontact_api::scenario::ContactPhaseHumanoid>::expose("ContactPhaseHumanoid");
}
}
namespace multicontact_api {
namespace python {
void exposeContactPhase() {
ContactPhasePythonVisitor<multicontact_api::scenario::ContactPhase4>::expose("ContactPhase4");
ContactPhaseHumanoidPythonVisitor<multicontact_api::scenario::ContactPhaseHumanoid>::expose("ContactPhaseHumanoid");
}
} // namespace python
} // namespace multicontact_api
20 changes: 9 additions & 11 deletions bindings/python/scenario/contact-sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
#include "multicontact-api/bindings/python/scenario/contact-phase-humanoid.hpp"
#include "multicontact-api/bindings/python/scenario/ms-interval.hpp"

namespace multicontact_api
{
namespace python
{
void exposeContactSequence()
{
// ContactSequencePythonVisitor<multicontact_api::scenario::ContactSequence4>::expose("ContactSequence4");
ContactSequencePythonVisitor<multicontact_api::scenario::ContactSequenceHumanoid>::expose("ContactSequenceHumanoid");
MSIntervalPythonVisitor<multicontact_api::scenario::ContactSequenceHumanoid::MSIntervalData>::expose("MSIntervalData");
}
}
namespace multicontact_api {
namespace python {
void exposeContactSequence() {
// ContactSequencePythonVisitor<multicontact_api::scenario::ContactSequence4>::expose("ContactSequence4");
ContactSequencePythonVisitor<multicontact_api::scenario::ContactSequenceHumanoid>::expose("ContactSequenceHumanoid");
MSIntervalPythonVisitor<multicontact_api::scenario::ContactSequenceHumanoid::MSIntervalData>::expose(
"MSIntervalData");
}
} // namespace python
} // namespace multicontact_api
55 changes: 24 additions & 31 deletions bindings/python/scenario/enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,32 @@

#include <boost/python/enum.hpp>

namespace multicontact_api
{
namespace python
{
namespace bp = boost::python;
namespace multicontact_api {
namespace python {
namespace bp = boost::python;

using namespace multicontact_api::scenario;
using namespace multicontact_api::scenario;

void exposeEnumHumanoidPhaseType()
{
bp::enum_<HumanoidPhaseType>("HumanoidPhaseType")
.value("SINGLE_SUPPORT",SINGLE_SUPPORT)
.value("DOUBLE_SUPPORT",DOUBLE_SUPPORT)
.value("TRIPLE_SUPPORT",TRIPLE_SUPPORT)
.value("QUADRUPLE_SUPPORT",QUADRUPLE_SUPPORT)
.value("NO_SUPPORT",NO_SUPPORT)
.value("HUMANOID_PHASE_UNDEFINED",HUMANOID_PHASE_UNDEFINED)
;
}
void exposeEnumHumanoidPhaseType() {
bp::enum_<HumanoidPhaseType>("HumanoidPhaseType")
.value("SINGLE_SUPPORT", SINGLE_SUPPORT)
.value("DOUBLE_SUPPORT", DOUBLE_SUPPORT)
.value("TRIPLE_SUPPORT", TRIPLE_SUPPORT)
.value("QUADRUPLE_SUPPORT", QUADRUPLE_SUPPORT)
.value("NO_SUPPORT", NO_SUPPORT)
.value("HUMANOID_PHASE_UNDEFINED", HUMANOID_PHASE_UNDEFINED);
}

void exposeEnumConicType()
{
bp::enum_<ConicType>("ConicType")
.value("CONIC_SOWC",CONIC_SOWC)
.value("CONIC_DOUBLE_DESCRIPTION",CONIC_DOUBLE_DESCRIPTION)
.value("CONIC_UNDEFINED",CONIC_UNDEFINED)
;
}
void exposeEnumConicType() {
bp::enum_<ConicType>("ConicType")
.value("CONIC_SOWC", CONIC_SOWC)
.value("CONIC_DOUBLE_DESCRIPTION", CONIC_DOUBLE_DESCRIPTION)
.value("CONIC_UNDEFINED", CONIC_UNDEFINED);
}

void exposeScenarioEnums()
{
exposeEnumHumanoidPhaseType();
exposeEnumConicType();
}
}
void exposeScenarioEnums() {
exposeEnumHumanoidPhaseType();
exposeEnumConicType();
}
} // namespace python
} // namespace multicontact_api
25 changes: 11 additions & 14 deletions bindings/python/trajectories/trajectories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@

#include "multicontact-api/bindings/python/trajectories/cubic-hermite-spline.hpp"

namespace multicontact_api
{
namespace python
{
void exposeTrajectories()
{
using namespace trajectories;
typedef CubicHermiteSplineTpl<double,3> CubicHermiteSpline3;
typedef CubicHermiteSplineTpl<double,Eigen::Dynamic> CubicHermiteSpline;
namespace multicontact_api {
namespace python {
void exposeTrajectories() {
using namespace trajectories;
typedef CubicHermiteSplineTpl<double, 3> CubicHermiteSpline3;
typedef CubicHermiteSplineTpl<double, Eigen::Dynamic> CubicHermiteSpline;

CubicHermiteSplinePythonVisitor<CubicHermiteSpline3>::expose("CubicHermiteSpline3");
CubicHermiteSplinePythonVisitor<CubicHermiteSpline>::expose("CubicHermiteSpline");
exposeSplineAlgos();
}
}
CubicHermiteSplinePythonVisitor<CubicHermiteSpline3>::expose("CubicHermiteSpline3");
CubicHermiteSplinePythonVisitor<CubicHermiteSpline>::expose("CubicHermiteSpline");
exposeSplineAlgos();
}
} // namespace python
} // namespace multicontact_api
Loading

0 comments on commit 9493409

Please sign in to comment.