{"action":"created","issue":{"url":"https://api.github.com/repos/ros-simulation/gazebo_ros_pkgs/issues/361","labels_url":"https://api.github.com/repos/ros-simulation/gazebo_ros_pkgs/issues/361/labels{/name}","comments_url":"https://api.github.com/repos/ros-simulation/gazebo_ros_pkgs/issues/361/comments","events_url":"https://api.github.com/repos/ros-simulation/gazebo_ros_pkgs/issues/361/events","html_url":"https://github.com/ros-simulation/gazebo_ros_pkgs/issues/361","id":109854173,"number":361,"title":"[gazebo_ros] spawning too slow if lot of resources in URDF","user":{"login":"guihomework","id":6583181,"avatar_url":"https://avatars.githubusercontent.com/u/6583181?v=3","gravatar_id":"","url":"https://api.github.com/users/guihomework","html_url":"https://github.com/guihomework","followers_url":"https://api.github.com/users/guihomework/followers","following_url":"https://api.github.com/users/guihomework/following{/other_user}","gists_url":"https://api.github.com/users/guihomework/gists{/gist_id}","starred_url":"https://api.github.com/users/guihomework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guihomework/subscriptions","organizations_url":"https://api.github.com/users/guihomework/orgs","repos_url":"https://api.github.com/users/guihomework/repos","events_url":"https://api.github.com/users/guihomework/events{/privacy}","received_events_url":"https://api.github.com/users/guihomework/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-05T18:10:18Z","updated_at":"2015-10-06T15:14:00Z","closed_at":null,"body":"We developed a tool that reads some extra tags in a URDF file. These tags are not valid URDF tags nor valid SDF tags, just additional XML tags that gazebo should ignore.\r\nUnfortunately inside these tags we re-used the similar syntax for resources since our tool uses rviz actually which can also resolve resources. They look something like this :\r\n```\r\n <tactile topic=\"tactile\">\r\n      <origin rpy=\"0 0 0\" xyz=\"0 0 0\"/>\r\n      <geometry>\r\n        <mesh filename=\"package://some_package_name/some_path/taxel.stl\"/>\r\n      </geometry>\r\n    </tactile>\r\n```\r\n\r\nWe have 200 of similar entries in our URDF and due to these additional tags, gazebo_ros model spawner gets so slow, more than 30 seconds, that our controllers spawner timeout and models are not cleanly loaded now.\r\n\r\nI guess the culprit is this :\r\nhttps://github.com/ros-simulation/gazebo_ros_pkgs/blob/jade-devel/gazebo_ros/src/gazebo_ros_api_plugin.cpp#L553\r\n\r\nany ```package://``` is resolved, with no cache, even for non SDF/URDF tags. This takes ages and is completely useless as gazebo will not read these resolved resources anyway.\r\n\r\nI think adding caching to the resource resolver (our 200 tags have the same package source for instance) would help, even for other models with a lot of resources (typically a hand with a lot of links).\r\nNot taking care of non URDF/SDF tags would be even better but more complex to implement in the current structure (separated resolving and urdf/sdf spawning)\r\n\r\nDo you think that is an easy fix ? I could probably try to add a very basic package name cache in this local resolver if you think that is the way to go.\r\n\r\nbest\r\nGuillaume\r\n"},"comment":{"url":"https://api.github.com/repos/ros-simulation/gazebo_ros_pkgs/issues/comments/145892139","html_url":"https://github.com/ros-simulation/gazebo_ros_pkgs/issues/361#issuecomment-145892139","issue_url":"https://api.github.com/repos/ros-simulation/gazebo_ros_pkgs/issues/361","id":145892139,"user":{"login":"adolfo-rt","id":1128028,"avatar_url":"https://avatars.githubusercontent.com/u/1128028?v=3","gravatar_id":"","url":"https://api.github.com/users/adolfo-rt","html_url":"https://github.com/adolfo-rt","followers_url":"https://api.github.com/users/adolfo-rt/followers","following_url":"https://api.github.com/users/adolfo-rt/following{/other_user}","gists_url":"https://api.github.com/users/adolfo-rt/gists{/gist_id}","starred_url":"https://api.github.com/users/adolfo-rt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adolfo-rt/subscriptions","organizations_url":"https://api.github.com/users/adolfo-rt/orgs","repos_url":"https://api.github.com/users/adolfo-rt/repos","events_url":"https://api.github.com/users/adolfo-rt/events{/privacy}","received_events_url":"https://api.github.com/users/adolfo-rt/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T15:14:00Z","updated_at":"2015-10-06T15:14:00Z","body":"> Do you think that is an easy fix ? I could probably try to add a very basic package name cache in this local resolver if you think that is the way to go.\r\n\r\nI say go for it!. The solution is not complex and the potential for performance gains significant."}}