Commit a8a97c79 authored by Nicolas Mansard's avatar Nicolas Mansard Committed by nmansard
Browse files

First tentative of transfer of COM-vel, compiling but python module not loading properly.

parent 3282bbb5
Pipeline #18699 failed with stage
in 19 minutes and 42 seconds
......@@ -37,8 +37,14 @@ include("${JRL_CMAKE_MODULES}/python.cmake")
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
project(${PROJECT_NAME} ${PROJECT_ARGS})
SET(CXX_DISABLE_WERROR True)
# Project dependencies
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
ADD_PROJECT_DEPENDENCY(pinocchio 2.4.7 REQUIRED PKG_CONFIG_REQUIRES "pinocchio >= 2.4.7")
ADD_PROJECT_DEPENDENCY(eigenpy 2.6.4 REQUIRED PKG_CONFIG_REQUIRES "eigenpy >= 2.6.4")
ADD_PROJECT_DEPENDENCY(example-robot-data 3.7.0 REQUIRED PKG_CONFIG_REQUIRES "example-robot-data >= 3.7.0")
ADD_PROJECT_DEPENDENCY(crocoddyl 1.8.0 REQUIRED PKG_CONFIG_REQUIRES "crocoddyl >= 1.8.0")
if(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
......@@ -49,6 +55,9 @@ endif()
# Main Library
set(${PROJECT_NAME}_HEADERS
include/${PROJECT_NAME}/fwd.hpp
include/${PROJECT_NAME}/com-velocity.hpp
include/${PROJECT_NAME}/com-velocity.hxx
include/${PROJECT_NAME}/gepadd.hpp
include/${PROJECT_NAME}/python.hpp
)
......@@ -57,8 +66,11 @@ set(${PROJECT_NAME}_SOURCES
src/gepadd.cpp
)
ADD_COMPILE_OPTIONS(-Wno-error)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
target_link_libraries(${PROJECT_NAME} crocoddyl::crocoddyl)
target_link_libraries(${PROJECT_NAME} eigenpy::eigenpy)
if(SUFFIX_SO_VERSION)
set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
......@@ -75,7 +87,7 @@ if(BUILD_PYTHON_INTERFACE)
endif()
# Unit tests
add_subdirectory(tests)
#add_subdirectory(tests)
# Installation
install(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
......
......@@ -6,8 +6,8 @@
// All rights reserved.
///////////////////////////////////////////////////////////////////////////////
#ifndef CROCODDYL_MULTIBODY_RESIDUALS_COM_VELOCITY_HPP_
#define CROCODDYL_MULTIBODY_RESIDUALS_COM_VELOCITY_HPP_
#ifndef SOBEC_COM_VELOCITY_HPP_
#define SOBEC_COM_VELOCITY_HPP_
#include "crocoddyl/multibody/fwd.hpp"
#include "crocoddyl/core/residual-base.hpp"
......@@ -144,6 +144,7 @@ struct ResidualDataCoMVelocityTpl : public ResidualDataAbstractTpl<_Scalar> {
/* --- Details -------------------------------------------------------------- */
/* --- Details -------------------------------------------------------------- */
/* --- Details -------------------------------------------------------------- */
#include "crocoddyl/multibody/residuals/com-velocity.hxx"
#endif // CROCODDYL_MULTIBODY_RESIDUALS_COM_VELOCITY_HPP_
#include "sobec/com-velocity.hxx"
#endif // SOBEC_COM_VELOCITY_HPP_
......@@ -6,10 +6,10 @@
// All rights reserved.
///////////////////////////////////////////////////////////////////////////////
#include "crocoddyl/multibody/residuals/com-velocity.hpp"
#include "crocoddyl/core/utils/exception.hpp"
#include "pinocchio/algorithm/center-of-mass.hpp"
#include "pinocchio/algorithm/center-of-mass-derivatives.hpp"
#include "sobec/com-velocity.hpp"
#include <crocoddyl/core/utils/exception.hpp>
#include <pinocchio/algorithm/center-of-mass.hpp>
#include <pinocchio/algorithm/center-of-mass-derivatives.hpp>
namespace crocoddyl {
......
///////////////////////////////////////////////////////////////////////////////
// BSD 3-Clause License
//
// Copyright (C) 2019-2021, LAAS-CNRS, University of Edinburgh, INRIA
// Copyright note valid unless otherwise stated in individual files.
// All rights reserved.
///////////////////////////////////////////////////////////////////////////////
#ifndef SOBEC_FWD_HPP_
#define SOBEC_FWD_HPP_
namespace crocoddyl {
template <typename Scalar>
class ResidualModelCoMVelocityTpl;
template <typename Scalar>
struct ResidualDataCoMVelocityTpl;
typedef ResidualModelCoMVelocityTpl<double> ResidualModelCoMVelocity;
typedef ResidualDataCoMVelocityTpl<double> ResidualDataCoMVelocity;
} // namespace crocoddyl
#endif // SOBEC_FWD_HPP_
set(${PY_NAME}_SOURCES
gepadd.cpp
main.cpp
com-velocity.cpp
)
add_library(${PY_NAME}_pywrap SHARED ${${PY_NAME}_SOURCES})
target_link_libraries(${PY_NAME}_pywrap PUBLIC eigenpy::eigenpy)
target_link_libraries(${PY_NAME}_pywrap PUBLIC ${PROJECT_NAME})
target_include_directories(${PY_NAME}_pywrap SYSTEM PRIVATE ${PYTHON_INCLUDE_DIR})
set_target_properties(${PY_NAME}_pywrap PROPERTIES
......
......@@ -6,12 +6,22 @@
// All rights reserved.
///////////////////////////////////////////////////////////////////////////////
#include "python/crocoddyl/multibody/multibody.hpp"
#include "crocoddyl/multibody/residuals/com-velocity.hpp"
//#include "python/crocoddyl/multibody/multibody.hpp"
//#include <crocoddyl/multibody/fwd.hpp>
#include "sobec/fwd.hpp"
#include "sobec/com-velocity.hpp"
#include <pinocchio/fwd.hpp>
//#include "python/crocoddyl/fwd.hpp"
#include <eigenpy/eigenpy.hpp>
#include <boost/python.hpp>
#include <boost/python/enum.hpp>
namespace crocoddyl {
namespace python {
namespace bp = boost::python;
void exposeResidualCoMVelocity() {
bp::register_ptr_to_python<boost::shared_ptr<ResidualModelCoMVelocity> >();
......
#include "sobec/python.hpp"
//#include "python.hpp"
#include <eigenpy/eigenpy.hpp>
namespace crocoddyl {
namespace python {
void exposeResidualCoMVelocity();
}}
BOOST_PYTHON_MODULE(sobec_pywrap) { gepetto::sobec::exposeSobec(); }
//#include "com-velocity.
//BOOST_PYTHON_MODULE(sobec_pywrap) { gepetto::sobec::exposeSobec(); }
BOOST_PYTHON_MODULE(sobec_pywrap)
{
eigenpy::enableEigenPy();
gepetto::sobec::exposeSobec();
crocoddyl::python::exposeResidualCoMVelocity();
}
from .sobec_pywrap import add, sub # noqa: F401
#from .sobec_pywrap import ResidualModelCoMVelocity
#import .sobec_pywrap as py
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment