Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/5.2.0 #210

Merged
merged 19 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "Nix CI"
name: "CI - Nix"

on: [pull_request, push]
on:
push:

jobs:
tests:
Expand All @@ -11,9 +12,9 @@ jobs:
os: [ubuntu]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix --accept-flake-config build -L
- run: nix --accept-flake-config run .#cachix push gepetto $(readlink result)
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
- uses: cachix/install-nix-action@v27
- uses: cachix/cachix-action@v15
with:
name: gepetto
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include: http://rainboard.laas.fr/project/hpp-pinocchio/.gitlab-ci.yml
include: https://rainboard.laas.fr/project/hpp-pinocchio/.gitlab-ci.yml
11 changes: 11 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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:
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ci:
autoupdate_branch: devel
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.6.9
hooks:
- id: ruff
args:
Expand All @@ -19,13 +19,13 @@ repos:
- id: toml-sort-fix
exclude: poetry.lock
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.7
rev: v19.1.1
hooks:
- id: clang-format
args:
- --style=Google
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand Down
45 changes: 0 additions & 45 deletions default.nix

This file was deleted.

67 changes: 8 additions & 59 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 19 additions & 31 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,55 +1,43 @@
{
description = "Wrapping of Pinocchio library into HPP";

nixConfig = {
extra-substituters = [ "https://gepetto.cachix.org" ];
extra-trusted-public-keys = [ "gepetto.cachix.org-1:toswMl31VewC0jGkN6+gOelO2Yom0SOHzPwJMY2XiDY=" ];
};

inputs = {
nixpkgs.url = "github:nim65s/nixpkgs/gepetto";
nixpkgs.url = "github:gepetto/nixpkgs";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
hpp-environments = {
url = "github:humanoid-path-planner/hpp-environments/release/5.1.0";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
hpp-util = {
url = "github:humanoid-path-planner/hpp-util/release/5.1.0";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
};

outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ];
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem =
{ pkgs, self', ... }:
{
self',
pkgs,
system,
...
}:
{
devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; };
packages = {
inherit (pkgs) cachix;
default = pkgs.callPackage ./. {
hpp-environments = inputs.hpp-environments.packages.${system}.default;
hpp-util = inputs.hpp-util.packages.${system}.default;
};
default = self'.packages.hpp-pinocchio;
hpp-pinocchio = pkgs.hpp-pinocchio.overrideAttrs (_: {
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./CMakeLists.txt
./doc
./include
./package.xml
./src
./tests
];
};
});
};
devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; };
};
};
}
52 changes: 26 additions & 26 deletions include/hpp/pinocchio/util.hh
Original file line number Diff line number Diff line change
Expand Up @@ -126,32 +126,32 @@ std::ostream& operator<<(std::ostream& os, const PrettyPrint<T, Option> pp) {

/// Generic implementation for Eigen objects
template <typename Derived, int Option>
struct HPP_PINOCCHIO_DLLAPI prettyPrintEigen {
static inline std::ostream& run(std::ostream& os, const Derived& M) {
enum {
Condensed = ((Option & OutputFormatBits) == OneLineOutput) ||
((Option & OutputFormatBits) == CondensedOutput)
};
static const Eigen::IOFormat mfmt_py =
eigen_format<Condensed, true, false>::run();
static const Eigen::IOFormat vfmt_py =
eigen_format<Condensed, true, true>::run();
static const Eigen::IOFormat mfmt_raw =
eigen_format<Condensed, false, false>::run();
static const Eigen::IOFormat vfmt_raw =
eigen_format<Condensed, false, true>::run();
bool use_py_fmt = (getpythonformat(os) != 0);
const Eigen::IOFormat& fmt =
(Derived::IsVectorAtCompileTime ? (use_py_fmt ? vfmt_py : vfmt_raw)
: (use_py_fmt ? mfmt_py : mfmt_raw));
bool transpose = (Derived::ColsAtCompileTime == 1);

if (transpose)
return os << M.transpose().format(fmt);
else
return os << M.format(fmt);
}
};
struct HPP_PINOCCHIO_DLLAPI prettyPrintEigen{
static inline std::ostream &
run(std::ostream & os, const Derived& M){
enum {Condensed = ((Option & OutputFormatBits) == OneLineOutput) ||
((Option & OutputFormatBits) == CondensedOutput)};
static const Eigen::IOFormat mfmt_py =
eigen_format<Condensed, true, false>::run();
static const Eigen::IOFormat vfmt_py =
eigen_format<Condensed, true, true>::run();
static const Eigen::IOFormat mfmt_raw =
eigen_format<Condensed, false, false>::run();
static const Eigen::IOFormat vfmt_raw =
eigen_format<Condensed, false, true>::run();
bool use_py_fmt = (getpythonformat(os) != 0);
const Eigen::IOFormat& fmt =
(Derived::IsVectorAtCompileTime ? (use_py_fmt ? vfmt_py : vfmt_raw)
: (use_py_fmt ? mfmt_py : mfmt_raw));
bool transpose = (Derived::ColsAtCompileTime == 1);

if (transpose)
return os << M.transpose().format(fmt);
else
return os << M.format(fmt);
} // namespace hpp
}
;
/// FIXME All eigen object must be manually specialized as follow...

/// Pretty printer for Eigen::Matrix
Expand Down
9 changes: 5 additions & 4 deletions src/joint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,11 @@ value_type computeMaximalDistanceToParent(
const Model& model,
const ::pinocchio::JointModelPrismaticTpl<Scalar, Options, Axis>& jmodel,
const SE3& jointPlacement) {
return computeMaximalDistanceToParentForAlignedTranslation<
Axis == 0, Axis == 1, Axis == 2>(
model.lowerPositionLimit.segment<1>(jmodel.idx_q()),
model.upperPositionLimit.segment<1>(jmodel.idx_q()), jointPlacement);
return computeMaximalDistanceToParentForAlignedTranslation < Axis == 0,
Axis == 1,
Axis == 2 > (model.lowerPositionLimit.segment<1>(jmodel.idx_q()),
model.upperPositionLimit.segment<1>(jmodel.idx_q()),
jointPlacement);
}

template <typename Scalar, int Options>
Expand Down