Commit 67464977 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files
parent 104fcdce
Loading
Loading
Loading
Loading
+0 −52
Original line number Diff line number Diff line
From 1cb7fe38e3ec43117c646cae521eb8347145965a Mon Sep 17 00:00:00 2001
From: Guilhem Saurel <guilhem.saurel@laas.fr>
Date: Tue, 14 Oct 2025 19:37:16 +0200
Subject: [PATCH] fix for crocoddyl v3.1.0 explicit template instanciation

ref. https://github.com/loco-3d/crocoddyl/pull/1367

Yes, that was a breaking change
---
 tests/factory/point-mass.hpp | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tests/factory/point-mass.hpp b/tests/factory/point-mass.hpp
index e82c977..c2e93af 100644
--- a/tests/factory/point-mass.hpp
+++ b/tests/factory/point-mass.hpp
@@ -60,6 +60,17 @@ class DAMPointMass1D : public crocoddyl::DifferentialActionModelAbstract {
   // Destructor
   virtual ~DAMPointMass1D();
 
+  // Explicit template instanciation
+  std::shared_ptr<crocoddyl::DifferentialActionModelBase> cloneAsDouble()
+      const override {
+    return std::make_shared<DAMPointMass1D>(*this);
+  }
+
+  std::shared_ptr<crocoddyl::DifferentialActionModelBase> cloneAsFloat()
+      const override {
+    return std::make_shared<DAMPointMass1D>(*this);
+  }
+
   // Cost & dynamics
   void calc(const std::shared_ptr<DifferentialActionDataAbstract>& data,
             const Eigen::Ref<const VectorXd>& x,
@@ -135,6 +146,17 @@ class DAMPointMass2D : public crocoddyl::DifferentialActionModelAbstract {
   // Destructor
   virtual ~DAMPointMass2D();
 
+  // Explicit template instanciation
+  std::shared_ptr<crocoddyl::DifferentialActionModelBase> cloneAsDouble()
+      const override {
+    return std::make_shared<DAMPointMass2D>(*this);
+  }
+
+  std::shared_ptr<crocoddyl::DifferentialActionModelBase> cloneAsFloat()
+      const override {
+    return std::make_shared<DAMPointMass2D>(*this);
+  }
+
   // Cost & dynamics
   void calc(const std::shared_ptr<DifferentialActionDataAbstract>& data,
             const Eigen::Ref<const VectorXd>& x,
+2 −14
Original line number Diff line number Diff line
@@ -14,27 +14,15 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "mim-solvers";
  version = "0.1.1";
  version = "0.3.0";

  src = fetchFromGitHub {
    owner = "machines-in-motion";
    repo = "mim_solvers";
    rev = "v${finalAttrs.version}";
    hash = "sha256-1Mqu9Hfy65HUIOVG/gJBpSMlOwDWVcH+LrR8CaWz0BE=";
    hash = "sha256-t21zzUo+Oiqvr3lYN9v1lCeoki3I1FWPqo3gWzM6Kdw=";
  };

  patches = [
    # ref. https://github.com/machines-in-motion/mim_solvers/pull/71 merged upstream
    (fetchpatch {
      name = "build-standalone-python-interface.patch";
      url = "https://github.com/machines-in-motion/mim_solvers/commit/796eecf05dd9165dd0795aa562ead17de4f19633.patch";
      hash = "sha256-/OiMzyDVEbpC/Dr/HcguwAdhmbQNxnIRsHAVkX68xqA=";
    })
    # Fix for crocoddyl 3.1.0
    # ref. https://github.com/machines-in-motion/mim_solvers/pull/72
    ./fix-croco-310.patch
  ];

  nativeBuildInputs = [
    cmake
    pkg-config