File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/resolve_robotics_uri_py Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,20 @@ def resolve_robotics_uri(
95
95
Note:
96
96
By default the function will look for the file in the
97
97
default search paths specified by the environment variables in `SupportedEnvVars`.
98
-
98
+
99
99
If the `package_dirs` argument is provided, the model is also searched in the folders
100
100
specified in `package_dirs` . In particular if a file is specified by the uri
101
- `package://ModelName/meshes/mesh.stl`, and the actual file is in
101
+ `package://ModelName/meshes/mesh.stl`, and the actual file is in
102
102
`/usr/local/share/ModelName/meshes/mesh.stl`, the `package_dirs` should contain `/usr/local/share`.
103
103
"""
104
104
package_dirs = package_dirs if isinstance (package_dirs , list ) else [package_dirs ]
105
105
106
+ # Add additional search paths from the RRU_ADDITIONAL_PATHS environment variable
107
+ if additional_paths := os .getenv ("RRU_ADDITIONAL_PATHS" ):
108
+ # Split the paths by os.pathsep and add them to the package_dirs
109
+ package_dirs += additional_paths .split (os .pathsep )
110
+ package_dirs = list ({path for path in package_dirs if path and path != "" })
111
+
106
112
# If the URI has no scheme, use by default file:// which maps the resolved input
107
113
# path to a URI with empty authority
108
114
if not any (uri .startswith (scheme ) for scheme in SupportedSchemes ):
You can’t perform that action at this time.
0 commit comments