diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f0a06c32e44cddf21fa6bc4878537d0acb79ee91..64b02759a3c821b1c83ff9804e7e1efc30c2f7b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,38 +1,44 @@ ci: - autoupdate_branch: 'devel' + autoupdate_branch: devel repos: -- repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.3 - hooks: - - id: clang-format - args: [--style=Google] -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: - - id: check-added-large-files - - id: check-ast - - id: check-executables-have-shebangs - - id: check-json - - id: check-merge-conflict - - id: check-symlinks - - id: check-toml - - id: check-yaml - - id: debug-statements - - id: destroyed-symlinks - - id: detect-private-key - - id: end-of-file-fixer - - id: fix-byte-order-marker - - id: mixed-line-ending - - id: trailing-whitespace -- repo: https://github.com/psf/black - rev: 23.10.0 - hooks: - - id: black -- repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 - hooks: - - id: flake8 -- repo: https://github.com/cheshirekow/cmake-format-precommit - rev: v0.6.13 - hooks: - - id: cmake-format +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.3.4 + hooks: + - id: ruff + args: + - --fix + - --exit-non-zero-on-fix + - id: ruff-format +- repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + - id: cmake-format +- repo: https://github.com/pappasam/toml-sort + rev: v0.23.1 + hooks: + - id: toml-sort-fix + exclude: poetry.lock +- repo: https://github.com/pre-commit/mirrors-clang-format + rev: v18.1.2 + hooks: + - id: clang-format + args: + - --style=Google +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-added-large-files + - id: check-ast + - id: check-executables-have-shebangs + - id: check-json + - id: check-merge-conflict + - id: check-symlinks + - id: check-toml + - id: check-yaml + - id: debug-statements + - id: destroyed-symlinks + - id: detect-private-key + - id: end-of-file-fixer + - id: fix-byte-order-marker + - id: mixed-line-ending + - id: trailing-whitespace diff --git a/CMakeLists.txt b/CMakeLists.txt index 640dbb05e9ddf55c21474d7ab7eb24c7ecec4517..b932d7f8a9d7afc9d59a06c98a8d678759601a1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.10) set(PROJECT_NAME hpp-manipulation) set(PROJECT_DESCRIPTION "Classes for manipulation planning.") @@ -31,9 +31,40 @@ set(PROJECT_DESCRIPTION "Classes for manipulation planning.") set(PROJECT_USE_CMAKE_EXPORT TRUE) set(CXX_DISABLE_WERROR TRUE) -include(cmake/hpp.cmake) -include(cmake/boost.cmake) -include(cmake/test.cmake) +# Check if the submodule cmake have been initialized +set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake") +if(EXISTS "${JRL_CMAKE_MODULES}/base.cmake") + message(STATUS "JRL cmakemodules found in 'cmake/' git submodule") +else() + find_package(jrl-cmakemodules QUIET CONFIG) + if(jrl-cmakemodules_FOUND) + get_property( + JRL_CMAKE_MODULES + TARGET jrl-cmakemodules::jrl-cmakemodules + PROPERTY INTERFACE_INCLUDE_DIRECTORIES) + message(STATUS "JRL cmakemodules found on system at ${JRL_CMAKE_MODULES}") + elseif(${CMAKE_VERSION} VERSION_LESS "3.14.0") + message( + FATAL_ERROR + "\nCan't find jrl-cmakemodules. Please either:\n" + " - use git submodule: 'git submodule update --init'\n" + " - or install https://github.com/jrl-umi3218/jrl-cmakemodules\n" + " - or upgrade your CMake version to >= 3.14 to allow automatic fetching\n" + ) + else() + message(STATUS "JRL cmakemodules not found. Let's fetch it.") + include(FetchContent) + FetchContent_Declare( + "jrl-cmakemodules" + GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git") + FetchContent_MakeAvailable("jrl-cmakemodules") + FetchContent_GetProperties("jrl-cmakemodules" SOURCE_DIR JRL_CMAKE_MODULES) + endif() +endif() + +include("${JRL_CMAKE_MODULES}/hpp.cmake") +include("${JRL_CMAKE_MODULES}/boost.cmake") +include("${JRL_CMAKE_MODULES}/test.cmake") compute_project_args(PROJECT_ARGS LANGUAGES CXX) project(${PROJECT_NAME} ${PROJECT_ARGS}) @@ -132,7 +163,8 @@ set(${PROJECT_NAME}_SOURCES add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS}) -target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>) +target_include_directories( + ${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) target_link_libraries(${PROJECT_NAME} hpp-core::hpp-core Boost::regex) install( diff --git a/cmake b/cmake index 9403226002b930d592ca83b50d3cd714a1c2dc01..657b07cb721ecbc383d4e76438eb6ec5c421a332 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 9403226002b930d592ca83b50d3cd714a1c2dc01 +Subproject commit 657b07cb721ecbc383d4e76438eb6ec5c421a332 diff --git a/package.xml b/package.xml index 2cbb0af67dbe677fbd24004e254a88f625adce12..2037746a27a9afb8cec23d4603425ebba00d1cf3 100644 --- a/package.xml +++ b/package.xml @@ -1,7 +1,7 @@ <?xml version='1.0'?> <package format='2'> <name>hpp-manipulation</name> - <version>4.15.1</version> + <version>5.0.0</version> <description>Classes for manipulation planning. </description> <maintainer email='hpp@laas.fr'>Joseph Mirabel</maintainer> diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..a5333a8b34f59be815cc36db7c829347b3b3578e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[build-system] +build-backend = "cmeel.build" +requires = [ + "cmeel-boost ~= 1.83.0", + "cmeel[build]", + "hpp-core[build]" +] + +[project] +dependencies = [ + "cmeel-boost ~= 1.83.0", + "hpp-core" +] +description = "Classes for manipulation planning." +license = "BSD-2-Clause" +name = "hpp-manipulation" +version = "5.0.0" + +[tool.ruff] +extend-exclude = ["cmake"] + +[tool.ruff.lint] +extend-select = ["I", "NPY", "RUF", "UP", "W"] + +[tool.tomlsort] +all = true diff --git a/src/graph/edge.cc b/src/graph/edge.cc index b5a727e62649c98f114795a66a8d28bd43a488a0..7842db027c4cac36279aa5082a532fc904a526cd 100644 --- a/src/graph/edge.cc +++ b/src/graph/edge.cc @@ -445,8 +445,7 @@ bool WaypointEdge::build(core::PathPtr_t& path, ConfigurationIn_t q1, hppDout(info, "Waypoint edge " << name() << ": generateTargetConfig failed at waypoint " << i - << "." - << "\nUse cache: " << useCache); + << "." << "\nUse cache: " << useCache); lastSucceeded_ = false; return false; } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c0d3d8877d12c81ca53e2eb117252f9de19ed3f9..6aa942ebaad792678ac9fe8b783d1d9f89b3d6e0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -30,3 +30,7 @@ add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN) add_unit_test(test-constraintgraph test-constraintgraph.cc) target_link_libraries(test-constraintgraph ${PROJECT_NAME} Boost::unit_test_framework) +set_tests_properties( + test-constraintgraph + PROPERTIES ENVIRONMENT + "ROS_PACKAGE_PATH=${example-robot-data_DIR}/../../../share") diff --git a/tests/test-constraintgraph.cc b/tests/test-constraintgraph.cc index f79e09cb31fcc7592f6c474de3171d9b1cba2640..ff17c49e6f07dd6385891bf33d15fc58e1934c7a 100644 --- a/tests/test-constraintgraph.cc +++ b/tests/test-constraintgraph.cc @@ -80,12 +80,11 @@ void initialize(bool ur5) { hpp::manipulation::ProblemPtr_t problem( hpp::manipulation::Problem::create(robot)); if (ur5) { - hpp::pinocchio::urdf::loadModel( - robot, 0, "ur5/", "anchor", - "package://example-robot-data/robots/ur_description/urdf/" - "ur5_joint_limited_robot.urdf", - "package://example-robot-data/robots/ur_description/srdf/" - "ur5_joint_limited_robot.srdf"); + hpp::pinocchio::urdf::loadModel(robot, 0, "ur5/", "anchor", + "package://ur_description/urdf/" + "ur5_joint_limited_robot.urdf", + "package://ur_description/srdf/" + "ur5_joint_limited_robot.srdf"); } SteeringMethodPtr_t sm( hpp::manipulation::steeringMethod::Graph::create(problem));