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
  • jchemin/hpp-bezier-com-traj
  • pfernbac/hpp-bezier-com-traj
  • gsaurel/hpp-bezier-com-traj
  • humanoid-path-planner/hpp-bezier-com-traj
4 results
Show changes
Commits on Source (94)
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-bezier-com-traj/.gitlab-ci.yml include: https://rainboard.laas.fr/project/hpp-bezier-com-traj/.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: ci:
autoupdate_branch: 'devel' autoupdate_branch: devel
repos: repos:
- repo: https://github.com/pre-commit/mirrors-clang-format - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v15.0.6 rev: v0.8.1
hooks: hooks:
- id: clang-format - id: ruff
args: [--style=Google] args:
- repo: https://github.com/pre-commit/pre-commit-hooks - --fix
rev: v4.4.0 - --exit-non-zero-on-fix
hooks: - id: ruff-format
- id: check-added-large-files - repo: https://github.com/cheshirekow/cmake-format-precommit
- id: check-ast rev: v0.6.13
- id: check-executables-have-shebangs hooks:
- id: check-json - id: cmake-format
- id: check-merge-conflict - repo: https://github.com/pappasam/toml-sort
- id: check-symlinks rev: v0.24.2
- id: check-toml hooks:
- id: check-yaml - id: toml-sort-fix
- id: debug-statements exclude: poetry.lock
- id: destroyed-symlinks - repo: https://github.com/pre-commit/mirrors-clang-format
- id: detect-private-key rev: v19.1.4
- id: end-of-file-fixer hooks:
- id: fix-byte-order-marker - id: clang-format
- id: mixed-line-ending args:
- id: trailing-whitespace - --style=Google
- repo: https://github.com/psf/black - repo: https://github.com/pre-commit/pre-commit-hooks
rev: 22.12.0 rev: v5.0.0
hooks: hooks:
- id: black - id: check-added-large-files
- repo: https://github.com/PyCQA/flake8 - id: check-ast
rev: 6.0.0 - id: check-executables-have-shebangs
hooks: - id: check-json
- id: flake8 - id: check-merge-conflict
- repo: https://github.com/cheshirekow/cmake-format-precommit - id: check-symlinks
rev: v0.6.13 - id: check-toml
hooks: - id: check-yaml
- id: cmake-format - 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 # Project properties
set(PROJECT_NAME hpp-bezier-com-traj) set(PROJECT_NAME hpp-bezier-com-traj)
...@@ -16,9 +16,39 @@ set(PROJECT_USE_CMAKE_EXPORT TRUE) ...@@ -16,9 +16,39 @@ set(PROJECT_USE_CMAKE_EXPORT TRUE)
set(CUSTOM_HEADER_DIR "hpp/bezier-com-traj") set(CUSTOM_HEADER_DIR "hpp/bezier-com-traj")
set(CXX_DISABLE_WERROR TRUE) set(CXX_DISABLE_WERROR TRUE)
# JRL-cmakemodule setup # Check if the submodule cmake have been initialized
include(cmake/hpp.cmake) set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(cmake/boost.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 # Project definition
compute_project_args(PROJECT_ARGS LANGUAGES CXX) compute_project_args(PROJECT_ARGS LANGUAGES CXX)
...@@ -32,12 +62,10 @@ endif(BUILD_PYTHON_INTERFACE) ...@@ -32,12 +62,10 @@ endif(BUILD_PYTHON_INTERFACE)
# Project dependencies # Project dependencies
add_project_dependency(hpp-centroidal-dynamics REQUIRED) add_project_dependency(hpp-centroidal-dynamics REQUIRED)
add_project_dependency(ndcurves 1.0.0 REQUIRED) add_project_dependency(ndcurves REQUIRED)
if(USE_GLPK) if(USE_GLPK)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} add_project_dependency(glpk REQUIRED FIND_EXTERNAL glpk)
"${PROJECT_SOURCE_DIR}/cmake/find-external/glpk")
add_project_dependency(glpk REQUIRED)
add_definitions(-DUSE_GLPK_SOLVER=1) add_definitions(-DUSE_GLPK_SOLVER=1)
endif(USE_GLPK) endif(USE_GLPK)
...@@ -85,7 +113,8 @@ endif(USE_GLPK) ...@@ -85,7 +113,8 @@ endif(USE_GLPK)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES} add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES}
${${PROJECT_NAME}_HEADERS}) ${${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} ndcurves::ndcurves target_link_libraries(${PROJECT_NAME} ndcurves::ndcurves
hpp-centroidal-dynamics::hpp-centroidal-dynamics) hpp-centroidal-dynamics::hpp-centroidal-dynamics)
......
Subproject commit 9403226002b930d592ca83b50d3cd714a1c2dc01 Subproject commit 29c0eb4e659304f44d55a0389e2749812d858659
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1719877454,
"narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "4e3583423212f9303aa1a6337f8dffb415920e4f",
"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 = "Multi contact trajectory generation for the COM using Bezier curves";
nixConfig = {
extra-substituters = [ "https://gepetto.cachix.org" ];
extra-trusted-public-keys = [ "gepetto.cachix.org-1:toswMl31VewC0jGkN6+gOelO2Yom0SOHzPwJMY2XiDY=" ];
};
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', ... }:
{
devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; };
packages = {
default = self'.packages.hpp-bezier-com-traj;
hpp-bezier-com-traj = pkgs.hpp-bezier-com-traj.overrideAttrs (_: {
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./CMakeLists.txt
./include
./package.xml
./python
./src
./tests
];
};
});
};
};
};
}
<?xml version='1.0'?> <?xml version='1.0'?>
<package format='2'> <package format='2'>
<name>hpp-bezier-com-traj</name> <name>hpp-bezier-com-traj</name>
<version>4.15.1</version> <version>6.0.0</version>
<description>Multi contact trajectory generation for the COM using Bezier curves</description> <description>Multi contact trajectory generation for the COM using Bezier curves</description>
<maintainer email='guilhem.saurel@laas.fr'>Guilhem Saurel</maintainer> <maintainer email='guilhem.saurel@laas.fr'>Guilhem Saurel</maintainer>
......
[tool.black] [build-system]
exclude = "cmake" build-backend = "cmeel.build"
requires = [
"cmeel-boost[build] ~= 1.83.0",
"cmeel-glpk[build]",
"cmeel[build]",
"hpp-centroidal-dynamics[build]",
"ndcurves[build]"
]
[project]
dependencies = [
"cmeel-boost ~= 1.83.0",
"cmeel-glpk",
"hpp-centroidal-dynamics",
"ndcurves"
]
description = "Multi contact trajectory generation for the COM using Bezier curves"
license = "BSD-2-Clause"
name = "hpp-bezier-com-traj"
version = "6.0.0"
[tool.cmeel]
configure-args = ["-DUSE_GLPK=ON"]
[tool.ruff]
extend-exclude = ["cmake"]
[tool.ruff.lint]
extend-select = ["I", "NPY", "RUF", "UP", "W"]
[tool.tomlsort]
all = true
import ndcurves # noqa - necessary to register ndcurves::bezier_curve import ndcurves # noqa - necessary to register ndcurves::bezier_curve
import numpy as np import numpy as np
from numpy import array
from hpp_centroidal_dynamics import Equilibrium, EquilibriumAlgorithm, SolverLP
from hpp_bezier_com_traj import ( from hpp_bezier_com_traj import (
SOLVER_QUADPROG, SOLVER_QUADPROG,
ConstraintFlag, ConstraintFlag,
...@@ -11,6 +9,8 @@ from hpp_bezier_com_traj import ( ...@@ -11,6 +9,8 @@ from hpp_bezier_com_traj import (
computeCOMTraj, computeCOMTraj,
zeroStepCapturability, zeroStepCapturability,
) )
from hpp_centroidal_dynamics import Equilibrium, EquilibriumAlgorithm, SolverLP
from numpy import array
# testing constructors # testing constructors
eq = Equilibrium("test", 54.0, 4) eq = Equilibrium("test", 54.0, 4)
......
# -*- coding: utf-8 -*-
""" """
Created on Thu Sep 1 16:54:39 2016 Created on Thu Sep 1 16:54:39 2016
@author: stonneau @author: stonneau
""" """
from __future__ import print_function
from math import atan, pi from math import atan, pi
import numpy as np import numpy as np
from numpy import array, asarray, asmatrix
from numpy import cross as X
from numpy import matrix, zeros
from centroidal_dynamics import Equilibrium, EquilibriumAlgorithm from centroidal_dynamics import Equilibrium, EquilibriumAlgorithm
from curves import bezier
from numpy import array, asarray, asmatrix, matrix, zeros
from numpy import cross as X
from pinocchio_inv_dyn.multi_contact.bezier.bezier_0_step_capturability import ( from pinocchio_inv_dyn.multi_contact.bezier.bezier_0_step_capturability import (
BezierZeroStepCapturability, BezierZeroStepCapturability,
compute_CWC, compute_CWC,
...@@ -24,7 +20,6 @@ from pinocchio_inv_dyn.multi_contact.utils import ( ...@@ -24,7 +20,6 @@ from pinocchio_inv_dyn.multi_contact.utils import (
find_static_equilibrium_com, find_static_equilibrium_com,
generate_contacts, generate_contacts,
) )
from curves import bezier
__EPS = 1e-5 __EPS = 1e-5
np.set_printoptions(precision=2, suppress=True, linewidth=100) np.set_printoptions(precision=2, suppress=True, linewidth=100)
...@@ -116,7 +111,6 @@ def __check_trajectory(p0, p1, p2, p3, T, H, mass, g, time_step=0.1, dL=allZeros ...@@ -116,7 +111,6 @@ def __check_trajectory(p0, p1, p2, p3, T, H, mass, g, time_step=0.1, dL=allZeros
def test_continuous_cpp_vs_continuous_py(N_CONTACTS=2, solver="qpoases", verb=0): def test_continuous_cpp_vs_continuous_py(N_CONTACTS=2, solver="qpoases", verb=0):
mu = 0.5 mu = 0.5
# friction coefficient # friction coefficient
lx = 0.1 lx = 0.1
...@@ -163,7 +157,8 @@ def test_continuous_cpp_vs_continuous_py(N_CONTACTS=2, solver="qpoases", verb=0) ...@@ -163,7 +157,8 @@ def test_continuous_cpp_vs_continuous_py(N_CONTACTS=2, solver="qpoases", verb=0)
mass, [X_LB, Y_LB, Z_LB], [X_UB, Y_UB, Z_UB], H, h mass, [X_LB, Y_LB, Z_LB], [X_UB, Y_UB, Z_UB], H, h
) )
dc0 = np.random.uniform(-1, 1, size=3) rng = np.random.default_rng()
dc0 = rng.uniform(-1, 1, size=3)
Z_MIN = np.max(p[:, 2]) - 0.1 Z_MIN = np.max(p[:, 2]) - 0.1
Ineq_kin = zeros([3, 3]) Ineq_kin = zeros([3, 3])
......
[flake8]
exclude = cmake
max-line-length = 88
ignore = E226, E704, E24, E121, W504, E126, E123, W503, E203