From c0ec9405a15f2f281661c8a012ccbaba3609d55b Mon Sep 17 00:00:00 2001 From: jcarpent <jcarpent@laas.fr> Date: Tue, 27 Sep 2016 14:37:10 +0200 Subject: [PATCH] [Python] Fix relative path for model files and dirs --- python/display.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/display.py b/python/display.py index 338cf55f5..f8d770009 100644 --- a/python/display.py +++ b/python/display.py @@ -1,12 +1,16 @@ import unittest import pinocchio as se3 import numpy as np +import os from pinocchio.robot_wrapper import RobotWrapper # Warning : the paths are here hard-coded. This file is only here as an example -list_py = ["/local/fvalenza/devel/src/pinocchio/models","titi"] -robot = RobotWrapper("/local/fvalenza/devel/src/pinocchio/models/romeo.urdf",list_py, se3.JointModelFreeFlyer()) +romeo_model_path = os.path.abspath(os.path.join(current_file, '../models')) +romeo_model_file = romeo_model_path + "/romeo.urdf" + +list_hints = [romeo_model_path,"titi"] +robot = RobotWrapper(romeo_model_file,list_hints, se3.JointModelFreeFlyer()) robot.initDisplay() robot.loadDisplayModel("world/pinocchio") -- GitLab