From ed9df1646672301addd58ba7cfd688b47f5461f2 Mon Sep 17 00:00:00 2001
From: Guilhem Saurel <guilhem.saurel@laas.fr>
Date: Fri, 12 Nov 2021 14:53:03 +0100
Subject: [PATCH] allow customization of model path (#109)

---
 python/example_robot_data/robots_loader.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/python/example_robot_data/robots_loader.py b/python/example_robot_data/robots_loader.py
index a8399ae..018e317 100644
--- a/python/example_robot_data/robots_loader.py
+++ b/python/example_robot_data/robots_loader.py
@@ -58,6 +58,7 @@ class RobotLoader(object):
     has_rotor_parameters = False
     free_flyer = False
     verbose = False
+    model_path = None
 
     def __init__(self):
         if self.urdf_filename:
@@ -71,7 +72,8 @@ class RobotLoader(object):
                 builder = RobotWrapper.BuildFromSDF
             except AttributeError:
                 raise ImportError("Building SDF models require pinocchio >= 3.0.0")
-        self.model_path = getModelPath(df_path, self.verbose)
+        if self.model_path is None:
+            self.model_path = getModelPath(df_path, self.verbose)
         self.df_path = join(self.model_path, df_path)
         self.robot = builder(self.df_path, [join(self.model_path, '../..')],
                              pin.JointModelFreeFlyer() if self.free_flyer else None)
-- 
GitLab