Add the possibility to pass the list containing the mesh path while building the model #1036
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, iDynTree loads the meshes searching inside the directories listed in some environment variables. i.e.,
GAZEBO_MODEL_PATH
,ROS_PACKAGE_PATH
andAMENT_PREFIX_PATH
. This PR allows passing a list containing the mesh path while the urdf is loaded by theModelLoader
class. In case no package is specified iDynTree will look for the meshes inGAZEBO_MODEL_PATH
,ROS_PACKAGE_PATH
andAMENT_PREFIX_PATH
as usual.Pinocchio already supports this feature and I find it really useful for two possible reasons:
robot-descriptions
Add the support to iDynTree robot-descriptions/robot_descriptions.py#21, this python package automatically clones the package containing the urdf of the robot and the meshes. With the current version of iDynTree, it is impossible to display the meshes if the package path is not added toGAZEBO_MODEL_PATH
,ROS_PACKAGE_PATH
, orAMENT_PREFIX_PATH
. Thanks to this feature I can load the model and its meshes by specifying the package.robot-log-visualizer
currently supports only the robot stored in icub-models. I found this very limiting Look for the model.urdf inside the installation folders ami-iit/robot-log-visualizer#35 a possible solution is to search for the model inGAZEBO_MODEL_PATH
however as first mitigation I would give the user the possibility to specify theurdf
path and thepackage dirs
manually in one of the menus of the application. Thanks to this the visualizer can be easily used with other robots without changing the environment variables.cc @traversaro