Skip to content
Draft
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
16 changes: 16 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,29 @@ jobs:
- run: nix build -L .#libpinocchio
- run: nix build -L .#pinocchio-py

nix-eigen_5:
runs-on: "${{ matrix.os }}-latest"
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
steps:
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v16
with:
name: gepetto
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L .#libpinocchio-eigen_5

check:
if: always()
name: check-macos-linux-nix

needs:
- nix-full
- nix-split
- nix-eigen_5

runs-on: Ubuntu-latest

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Changed
- Homogenize python viewers examples ([#2771](https://github.com/stack-of-tasks/pinocchio/pull/2771))

### Added
- Add docker images ([#2776](https://github.com/stack-of-tasks/pinocchio/pull/2776))
- ROS: added jrl_cmakemodules dependency ([#2789](https://github.com/stack-of-tasks/pinocchio/pull/2789))

### Fixed
- Fix compatibility issues with Eigen5 ([#2779](https://github.com/stack-of-tasks/pinocchio/pull/2779))

## [3.8.0] - 2025-09-17

### Added
Expand Down
20 changes: 20 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
};
packages = {
default = self'.packages.pinocchio;
eigen_5 = pkgs.eigen.overrideAttrs (super: rec {
version = "5.0.0";
src = pkgs.fetchFromGitLab {
inherit (super.src) owner repo;
tag = version;
hash = "sha256-L1KUFZsaibC/FD6abTXrT3pvaFhbYnw+GaWsxM2gaxM=";
};
patches = [ ];
postPatch = "";
});
pinocchio = pkgs.python3Packages.pinocchio.overrideAttrs (super: {
propagatedBuildInputs = super.propagatedBuildInputs ++ [ pkgs.example-robot-data ];
src = pkgs.lib.fileset.toSource {
Expand Down Expand Up @@ -71,6 +81,16 @@
];
};
});

libpinocchio-eigen_5 =
(self'.packages.libpinocchio.override { eigen = self'.packages.eigen_5; }).overrideAttrs
(super: {
pname = "${super.pname}-eigen_5";
cmakeFlags = super.cmakeFlags ++ [
"-DBUILD_WITH_CASADI_SUPPORT=OFF"
"-DBUILD_WITH_COLLISION_SUPPORT=OFF"
];
});
pinocchio-py = pkgs.python3Packages.pinocchio.overrideAttrs (super: {
pname = "pinocchio-py";
cmakeFlags = super.cmakeFlags ++ [ "-DBUILD_STANDALONE_PYTHON_INTERFACE=ON" ];
Expand Down
40 changes: 37 additions & 3 deletions include/pinocchio/autodiff/casadi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ namespace Eigen
{
return std::numeric_limits<double>::digits10;
}

#if EIGEN_VERSION_AT_LEAST(3, 4, 90)
EIGEN_DEVICE_FUNC constexpr static int digits()
{
return NumTraits<double>::digits();
}

EIGEN_DEVICE_FUNC constexpr static int max_digits10()
{
return NumTraits<double>::max_digits10();
}
#endif
};
} // namespace Eigen

Expand Down Expand Up @@ -391,7 +403,6 @@ namespace Eigen
typedef
typename ScalarBinaryOpTraits<LhsScalar, RhsScalar, scalar_max_op>::ReturnType result_type;

EIGEN_EMPTY_STRUCT_CTOR(scalar_max_op)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type
operator()(const LhsScalar & a, const RhsScalar & b) const
{
Expand All @@ -412,7 +423,6 @@ namespace Eigen
typedef
typename ScalarBinaryOpTraits<LhsScalar, RhsScalar, scalar_max_op>::ReturnType result_type;

EIGEN_EMPTY_STRUCT_CTOR(scalar_max_op)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type
operator()(const LhsScalar & a, const RhsScalar & b) const
{
Expand All @@ -428,14 +438,38 @@ namespace Eigen
typedef
typename ScalarBinaryOpTraits<LhsScalar, RhsScalar, scalar_max_op>::ReturnType result_type;

EIGEN_EMPTY_STRUCT_CTOR(scalar_max_op)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type
operator()(const LhsScalar & a, const RhsScalar & b) const
{
return ::pinocchio::math::internal::call_max<LhsScalar, RhsScalar>::run(a, b);
}
};

} // namespace internal
namespace numext
{
#if EIGEN_VERSION_AT_LEAST(3, 4, 90)
// The function Eigen::internal::gemv_dense_selector::run defined in
// Eigen/src/Core/GeneralProduct.h call at some point Eigen::numext::is_exactly_zero function.
// Since equality operator is not defined on casadi scalar type this create a compilation error.
// To overcome this issue, overload Eigen::numext::equal_strict_impl::run function.
template<>
struct equal_strict_impl<
::casadi::Matrix<::casadi::SXElem>,
::casadi::Matrix<::casadi::SXElem>,
false,
true,
false,
true>
{
static EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool
run(const ::casadi::Matrix<::casadi::SXElem> &, const ::casadi::Matrix<::casadi::SXElem> &)
{
return false;
}
};
#endif
} // namespace numext
} // namespace Eigen

#include "pinocchio/autodiff/casadi/spatial/se3-tpl.hpp"
Expand Down
20 changes: 10 additions & 10 deletions include/pinocchio/math/tridiagonal-matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ namespace pinocchio
subDiagonal().setZero();
}

EIGEN_CONSTEXPR Eigen::Index rows() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index rows() const noexcept
{
return m_size;
}
EIGEN_CONSTEXPR Eigen::Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index cols() const noexcept
{
return m_size;
}
Expand Down Expand Up @@ -358,11 +358,11 @@ namespace pinocchio
m_lhs.subDiagonal().asDiagonal() * m_rhs.topRows(reduced_size);
}

EIGEN_CONSTEXPR Eigen::Index rows() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index rows() const noexcept
{
return m_lhs.rows();
}
EIGEN_CONSTEXPR Eigen::Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index cols() const noexcept
{
return m_rhs.cols();
}
Expand Down Expand Up @@ -407,11 +407,11 @@ namespace pinocchio
m_lhs.rightCols(reduced_size) * m_rhs.subDiagonal().asDiagonal();
}

EIGEN_CONSTEXPR Eigen::Index rows() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index rows() const noexcept
{
return m_lhs.rows();
}
EIGEN_CONSTEXPR Eigen::Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index cols() const noexcept
{
return m_rhs.cols();
}
Expand Down Expand Up @@ -496,11 +496,11 @@ namespace pinocchio
}
}

EIGEN_CONSTEXPR Eigen::Index rows() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index rows() const noexcept
{
return m_size;
}
EIGEN_CONSTEXPR Eigen::Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index cols() const noexcept
{
return m_size;
}
Expand Down Expand Up @@ -576,11 +576,11 @@ namespace pinocchio
}
}

EIGEN_CONSTEXPR Eigen::Index rows() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index rows() const noexcept
{
return m_lhs.rows();
}
EIGEN_CONSTEXPR Eigen::Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Eigen::Index cols() const noexcept
{
return m_rhs.cols();
}
Expand Down
13 changes: 11 additions & 2 deletions include/pinocchio/multibody/joint/joint-revolute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,17 @@ namespace pinocchio
typedef Matrix3 AngularType;
typedef Matrix3 AngularRef;
typedef Matrix3 ConstAngularRef;
#if EIGEN_VERSION_AT_LEAST(3, 4, 90)
typedef typename Vector3::ZeroReturnType LinearType;
typedef const typename Vector3::ZeroReturnType ConstLinearType;
typedef typename Vector3::ZeroReturnType LinearRef;
typedef const typename Vector3::ZeroReturnType ConstLinearRef;
#else
typedef typename Vector3::ConstantReturnType LinearType;
typedef const typename Vector3::ConstantReturnType ConstLinearType;
typedef typename Vector3::ConstantReturnType LinearRef;
typedef const typename Vector3::ConstantReturnType ConstLinearRef;
#endif
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
}; // traits TransformRevoluteTpl
Expand All @@ -98,6 +106,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
PINOCCHIO_SE3_TYPEDEF_TPL(TransformRevoluteTpl);
typedef typename traits<TransformRevoluteTpl>::ConstLinearType ConstLinearType;

TransformRevoluteTpl()
{
Expand Down Expand Up @@ -180,9 +189,9 @@ namespace pinocchio
m_cos = cos;
}

LinearType translation() const
ConstLinearType translation() const
{
return LinearType::PlainObject::Zero(3);
return ConstLinearType::PlainObject::Zero(3);
}
AngularType rotation() const
{
Expand Down
2 changes: 1 addition & 1 deletion unittest/spatial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ BOOST_AUTO_TEST_CASE(test_SE3)
{
const double prec = Eigen::NumTraits<double>::dummy_precision();
SE3 M(SE3::Random());
M.rotation() += prec * SE3::Matrix3::Random();
M.rotation() += 2. * prec * SE3::Matrix3::Random();
BOOST_CHECK(!M.isNormalized());

SE3 M_normalized = M.normalized();
Expand Down
Loading