Commit b049042b authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

Remove the use of environment variable to get the files path and use relative...

Remove the use of environment variable to get the files path and use relative path from installation folder
parent df26342d
Pipeline #15012 passed with stage
in 28 seconds
...@@ -6,7 +6,11 @@ import numpy as np ...@@ -6,7 +6,11 @@ import numpy as np
import os import os
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody as Parent from hpp.corbaserver.rbprm.rbprmfullbody import FullBody as Parent
from pinocchio import SE3 from pinocchio import SE3
from pathlib import Path
def prefix(module):
"""$prefix/lib/pythonX.Y/site-packages/$module/__init__.py: extract prefix from module"""
return Path(module.__file__).parent.parent.parent.parent.parent
class Robot(Parent): class Robot(Parent):
# Information to retrieve urdf and srdf files. # Information to retrieve urdf and srdf files.
...@@ -366,12 +370,12 @@ class Robot(Parent): ...@@ -366,12 +370,12 @@ class Robot(Parent):
lArmKinematicConstraints = kinematicConstraintsPath + larm + "_com_constraints.obj" lArmKinematicConstraints = kinematicConstraintsPath + larm + "_com_constraints.obj"
minDist = 0.4 minDist = 0.4
# Constraints used by SL1M: # Constraints used by SL1M:
filekin_right = os.environ["INSTALL_HPP_DIR"] + "/share/talos-rbprm/com_inequalities/feet_quasi_flat/COM_constraints_in_RF_effector_frame_REDUCED.obj" filekin_right = prefix(talos_rbprm) / "share/talos-rbprm/com_inequalities/feet_quasi_flat/COM_constraints_in_RF_effector_frame_REDUCED.obj"
filekin_left = os.environ["INSTALL_HPP_DIR"] + "/share/talos-rbprm/com_inequalities/feet_quasi_flat/COM_constraints_in_LF_effector_frame_REDUCED.obj" filekin_left = prefix(talos_rbprm) / "share/talos-rbprm/com_inequalities/feet_quasi_flat/COM_constraints_in_LF_effector_frame_REDUCED.obj"
file_rf_in_lf = os.environ["INSTALL_HPP_DIR"] + "/share/talos-rbprm/relative_effector_positions/RF_constraints_in_LF_quasi_flat_REDUCED.obj" file_rf_in_lf = prefix(talos_rbprm) / "share/talos-rbprm/relative_effector_positions/RF_constraints_in_LF_quasi_flat_REDUCED.obj"
file_lf_in_rf = os.environ["INSTALL_HPP_DIR"] + "/share/talos-rbprm/relative_effector_positions/LF_constraints_in_RF_quasi_flat_REDUCED.obj" file_lf_in_rf = prefix(talos_rbprm) / "share/talos-rbprm/relative_effector_positions/LF_constraints_in_RF_quasi_flat_REDUCED.obj"
kinematic_constraints_path = os.environ["INSTALL_HPP_DIR"] + "/share/talos-rbprm/com_inequalities/feet_quasi_flat/" kinematic_constraints_path = prefix(talos_rbprm) / "share/talos-rbprm/com_inequalities/feet_quasi_flat/"
relative_feet_constraints_path = os.environ["INSTALL_HPP_DIR"] + "/share/talos-rbprm/relative_effector_positions/" relative_feet_constraints_path = prefix(talos_rbprm) / "share/talos-rbprm/relative_effector_positions/"
# data used by scripts : # data used by scripts :
limbs_names = [rLegId, lLegId, rArmId, lArmId] limbs_names = [rLegId, lLegId, rArmId, lArmId]
dict_limb_rootJoint = {rLegId: rleg, lLegId: lleg, rArmId: rarm, lArmId: larm} dict_limb_rootJoint = {rLegId: rleg, lLegId: lleg, rArmId: rarm, lArmId: larm}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment