ros_gz icon indicating copy to clipboard operation
ros_gz copied to clipboard

Geometries not found when defined inside ROS package

Open MCFurry opened this issue 3 years ago • 1 comments

Loading a robot description from the ROS parameter server works nicely, but mesh-files are not found. In our URDF-files we include meshes like so: <geometry> <mesh filename="package://my_package/meshes/frame.stl" /> </geometry>

But these result in file not found errors: [GUI] [Err] [SystemPaths.cc:357] Unable to find file with URI [model://my_package/meshes/frame.stl] [GUI] [Err] [SystemPaths.cc:444] Could not resolve file [model://my_package/meshes/frame.stl] [GUI] [Err] [MeshManager.cc:172] Unable to find file[model://my_package/meshes/frame.stl] [GUI] [Err] [MeshDescriptor.cc:56] Mesh manager can't find mesh named [model://my_package/meshes/frame.stl]

Changing the paths to absolute paths works fine, but this makes the URDF not portable unfortunately. Would it be possible to use the rospkg tooling to resolve these paths?

MCFurry avatar Jan 14 '21 10:01 MCFurry

Could you try using relative paths to the meshes? Like meshes/frame.stl.

Alternatively, you can create env hooks to set environment variables telling Ignition where to find your meshes, like:

prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;share/@PROJECT_NAME@/models
prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;share/@PROJECT_NAME@/worlds

See an example here:

https://github.com/chapulina/dolly/blob/foxy/dolly_ignition/env-hooks/dolly_ignition.dsv.in

chapulina avatar Jan 14 '21 18:01 chapulina