Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gsaurel/hpp-centroidal-dynamics
  • humanoid-path-planner/hpp-centroidal-dynamics
2 results
Show changes
Commits on Source (84)
name: "CI - Nix"
on:
push:
jobs:
tests:
name: "Nix build on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}-latest"
strategy:
matrix:
os: [ubuntu]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- uses: cachix/cachix-action@v15
with:
name: gepetto
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L
include: http://rainboard.laas.fr/project/hpp-centroidal-dynamics/.gitlab-ci.yml
include: https://rainboard.laas.fr/project/hpp-centroidal-dynamics/.gitlab-ci.yml
pull_request_rules:
- name: merge automatically when CI passes and PR is approved
conditions:
- check-success = "gitlab-ci"
- check-success = "Nix build on ubuntu"
- check-success = "pre-commit.ci - pr"
- or:
- author = pre-commit-ci[bot]
- author = dependabot[bot]
actions:
merge:
ci:
autoupdate_branch: 'devel'
autoupdate_branch: devel
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v15.0.6
hooks:
- id: clang-format
args: [--style=Google]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.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: 22.12.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.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.8.1
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.24.2
hooks:
- id: toml-sort-fix
exclude: poetry.lock
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.4
hooks:
- id: clang-format
args:
- --style=Google
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.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
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.10)
# Project properties
set(PROJECT_NAME hpp-centroidal-dynamics)
......@@ -8,15 +8,46 @@ set(PROJECT_DESCRIPTION
# Project options
option(BUILD_PYTHON_INTERFACE "Build the python bindings" ON)
option(BUILD_WITH_CLP "Build the python bindings" OFF)
# Project configuration
set(PROJECT_USE_CMAKE_EXPORT TRUE)
set(CUSTOM_HEADER_DIR "hpp/centroidal-dynamics")
set(CXX_DISABLE_WERROR TRUE)
# JRL-cmakemodule setup
include(cmake/hpp.cmake)
include(cmake/boost.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")
# Project definition
compute_project_args(PROJECT_ARGS LANGUAGES CXX)
......@@ -29,24 +60,24 @@ endif(BUILD_PYTHON_INTERFACE)
# Project dependencies
add_project_dependency(Eigen3 REQUIRED)
add_project_dependency(Boost REQUIRED)
set(CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/cmake/find-external/CDD
${PROJECT_SOURCE_DIR}/cmake/find-external/CLP
${PROJECT_SOURCE_DIR}/cmake/find-external/qpOASES)
find_package(CDD REQUIRED)
find_package(qpOASES REQUIRED)
find_package(CLP)
if("${CLP_LIBRARY}" STREQUAL "CLP_LIBRARY-NOTFOUND")
message(
STATUS
"CLP_LIBRARY equal to CLP_LIBRARY-NOTFOUND so I assume CLP was not found "
)
else()
message(STATUS "CLP library found, defining macro CLP_FOUND")
${JRL_CMAKE_MODULES}/find-external/CDD
${JRL_CMAKE_MODULES}/find-external/CLP
${JRL_CMAKE_MODULES}/find-external/CoinUtils
${JRL_CMAKE_MODULES}/find-external/qpOASES)
add_project_dependency(CDD REQUIRED FIND_EXTERNAL CDD)
add_project_dependency(qpOASES REQUIRED FIND_EXTERNAL qpOASES)
if(BUILD_WITH_CLP)
add_project_dependency(CLP REQUIRED FIND_EXTERNAL CLP)
add_project_dependency(CoinUtils REQUIRED FIND_EXTERNAL CoinUtils)
message(STATUS "Building with coin-or clp: ${CLP_PREFIX}")
add_definitions(-DCLP_FOUND)
else()
message(STATUS "Building without coin-or clp")
endif()
# Main Library
......@@ -71,17 +102,14 @@ 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} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIR} ${CDD_INCLUDE_DIRS}
${qpOASES_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${CDD_LIBRARIES} ${qpOASES_LIBRARY})
if(CLP_FOUND)
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${CLP_INCLUDE_DIR}")
target_link_libraries(${PROJECT_NAME} ${CLP_LIBRARIES}
/usr/lib/libCoinUtils.so)
endif(CLP_FOUND)
${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen qpOASES::qpOASES
CDD::CDD Boost::boost)
if(BUILD_WITH_CLP)
target_link_libraries(${PROJECT_NAME} PUBLIC CoinUtils::CoinUtils CLP::CLP)
endif()
install(
TARGETS ${PROJECT_NAME}
......
# CentroidalDynamicsLib
# HPP Centroidal Dynamics
[![Pipeline status](https://gitlab.laas.fr/humanoid-path-planner/hpp-centroidal-dynamics/badges/master/pipeline.svg)](https://gitlab.laas.fr/humanoid-path-planner/hpp-centroidal-dynamics/commits/master)
[![Coverage report](https://gitlab.laas.fr/humanoid-path-planner/hpp-centroidal-dynamics/badges/master/coverage.svg?job=doc-coverage)](https://gepettoweb.laas.fr/doc/humanoid-path-planner/hpp-centroidal-dynamics/master/coverage/)
......
Subproject commit 9403226002b930d592ca83b50d3cd714a1c2dc01
Subproject commit 29c0eb4e659304f44d55a0389e2749812d858659
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1717285511,
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1727174734,
"narHash": "sha256-xa3TynMF5vaWonmTOg/Ejc1Fmo0GkQnCaVRVkBc3z2I=",
"owner": "gepetto",
"repo": "nixpkgs",
"rev": "0ad139a0e4372abc12320c8c92ee90e0e5e296e1",
"type": "github"
},
"original": {
"owner": "gepetto",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
{
description = "Utility classes to check the (robust) equilibrium of a system in contact with the environment.";
inputs = {
nixpkgs.url = "github:gepetto/nixpkgs";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem =
{ pkgs, self', ... }:
{
apps.default = {
type = "app";
program = pkgs.python3.withPackages (_: [ self'.packages.default ]);
};
devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; };
packages = {
default = self'.packages.hpp-centroidal-dynamics;
hpp-centroidal-dynamics = pkgs.python3Packages.hpp-centroidal-dynamics.overrideAttrs (_: {
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./CMakeLists.txt
./include
./package.xml
./python
./src
./test
./test_data
];
};
});
};
};
};
}
......@@ -45,7 +45,7 @@ namespace centroidal_dynamics {
#define SEND_ERROR_MSG(msg) SEND_MSG(msg, MSG_TYPE_ERROR)
#define SEND_DEBUG_STREAM_MSG(msg)
#define SEND_INFO_STREAM_MSG(msg) \
#define SEND_WARNING_STREAM_MSG(msg) SEND_MSG(msg, MSG_TYPE_WARNING_STREAM)
#define SEND_WARNING_STREAM_MSG(msg) SEND_MSG(msg, MSG_TYPE_WARNING_STREAM)
#define SEND_ERROR_STREAM_MSG(msg) SEND_MSG(msg, MSG_TYPE_ERROR_STREAM)
#endif
......
<?xml version='1.0'?>
<package format='2'>
<name>hpp-centroidal-dynamics</name>
<version>4.15.1</version>
<version>6.0.0</version>
<description>Testing equilibrium of a system in contact with the environment</description>
<maintainer email='guilhem.saurel@laas.fr'>Guilhem Saurel</maintainer>
<license>BSD</license>
<license>GPL</license>
<author>Andrea Del Prete</author>
<author>Pierre Fernbach</author>
......
[tool.black]
exclude = "cmake"
[build-system]
build-backend = "cmeel.build"
requires = [
"cmeel-boost[build] ~= 1.83.0",
"cmeel-cddlib[build] ~= 0.94.13",
"cmeel-clp[build] ~= 1.17.9.1",
"cmeel-coinutils[build] ~= 2.11.10",
"cmeel-qpoases[build] ~= 3.2.1",
"cmeel[build]",
"eigenpy[build] ~= 3.1"
]
[project]
dependencies = [
"cmeel-boost ~= 1.83.0",
"cmeel-cddlib ~= 0.94.13",
"cmeel-clp ~= 1.17.9.1",
"cmeel-qpoases ~= 3.2.1",
"eigenpy ~= 3.1"
]
description = "Utility classes for testing (robust) equilibrium of a system in contact with the environment, and other centroidal dynamics methods."
license = "BSD-2-Clause"
name = "hpp-centroidal-dynamics"
version = "6.0.0"
[tool.ruff]
extend-exclude = ["cmake"]
[tool.ruff.lint]
extend-select = ["I", "NPY", "RUF", "UP", "W"]
[tool.tomlsort]
all = true
import unittest
from numpy import array, asmatrix, cross
from hpp_centroidal_dynamics import (
LP_STATUS_OPTIMAL,
Equilibrium,
EquilibriumAlgorithm,
SolverLP,
)
from numpy import array, asmatrix, cross
class TestCentroidalDynamics(unittest.TestCase):
......
[flake8]
exclude = cmake
max-line-length = 88
ignore = E226, E704, E24, E121, W504, E126, E123, W503, E203