Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the possibility to pass the list containing the mesh path while building the model #1036

Merged
merged 5 commits into from
Dec 13, 2022

Conversation

GiulioRomualdi
Copy link
Member

Currently, iDynTree loads the meshes searching inside the directories listed in some environment variables. i.e., GAZEBO_MODEL_PATH, ROS_PACKAGE_PATH and AMENT_PREFIX_PATH. This PR allows passing a list containing the mesh path while the urdf is loaded by the ModelLoader class. In case no package is specified iDynTree will look for the meshes in GAZEBO_MODEL_PATH, ROS_PACKAGE_PATH and AMENT_PREFIX_PATH as usual.

Pinocchio already supports this feature and I find it really useful for two possible reasons:

  1. I recently added the support of iDynTree in 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 to GAZEBO_MODEL_PATH, ROS_PACKAGE_PATH, or AMENT_PREFIX_PATH. Thanks to this feature I can load the model and its meshes by specifying the package.
  2. 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 in GAZEBO_MODEL_PATH however as first mitigation I would give the user the possibility to specify the urdf path and the package 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

@traversaro
Copy link
Member

Thanks! Two questions:

  • Can you update the CHANGELOG ?
  • Can you document somewhere which directory needs to be passed to package dirs? In the sense, if I have a model that search for the meshes in package://StrangeModel/Nested/mesh.stl, and the actual mesh is in /usr/local/share/StrangeModel/Nested/mesh.stl, what should I pass to packageDirs? /usr/local/share/StrangeModel or /usr/local/share ?

@GiulioRomualdi
Copy link
Member Author

Thanks! Two questions:

  • Can you update the CHANGELOG ?

Done in 5d7e347

  • Can you document somewhere which directory needs to be passed to package dirs? In the sense, if I have a model that search for the meshes in package://StrangeModel/Nested/mesh.stl, and the actual mesh is in /usr/local/share/StrangeModel/Nested/mesh.stl, what should I pass to packageDirs? /usr/local/share/StrangeModel or /usr/local/share ?

/usr/local/share. In a481bb1 I improved the documentation

@traversaro traversaro closed this Dec 13, 2022
@traversaro traversaro reopened this Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants