Skip to content

Commit 8d34198

Browse files
committed
Fix bug: cannot load mesh files using file://$(find <package_name>) syntax in xacro files
1 parent 1fbea8b commit 8d34198

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
## [4.3.4]
4+
5+
修复:
6+
7+
Fixed:
8+
9+
- Bug: Cannot load mesh files using `file://$(find <package_name>)` syntax in xacro files ([Issue#14](https://github.com/MorningFrog/urdf-visualizer/issues/14))
10+
11+
Bug: Xacro 文件中 Mesh 使用 `file://$(find <package_name>)` 无法正常加载资源 ([Issue#14](https://github.com/MorningFrog/urdf-visualizer/issues/14))
12+
313
## [4.3.3]
414

515
修复:

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ There are three installation methods:
8484

8585
## Release Notes
8686

87+
### 4.3.4
88+
89+
Fixed:
90+
91+
- Bug: Cannot load mesh files using `file://$(find <package_name>)` syntax in xacro files ([Issue#14](https://github.com/MorningFrog/urdf-visualizer/issues/14))
92+
8793
### 4.3.3
8894

8995
Fixed:

README_zh-CN.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ A VSCode extension for visualizing URDF files and xacro files.
8585

8686
## Release Notes
8787

88+
### 4.3.4
89+
90+
修复:
91+
92+
- Bug: Xacro 文件中 Mesh 使用 `file://$(find <package_name>)` 无法正常加载资源 ([Issue#14](https://github.com/MorningFrog/urdf-visualizer/issues/14))
93+
94+
### 4.3.3
95+
8896
修复:
8997

9098
- Bug: 第一次打开时有时不会加载模型

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "git",
77
"url": "https://github.com/MorningFrog/urdf-visualizer"
88
},
9-
"version": "4.3.3",
9+
"version": "4.3.4",
1010
"publisher": "morningfrog",
1111
"engines": {
1212
"vscode": "^1.70.0"

src/webview/module_urdf.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ export class ModuleURDF {
155155
if (!url.startsWith("/")) {
156156
url = "/" + url;
157157
}
158+
// 如果出现两个 `//` 忽略第一个 `/` 前的所有内容
159+
const doubleSlashIndex = url.indexOf("//");
160+
if (doubleSlashIndex !== -1) {
161+
url = url.slice(doubleSlashIndex + 1);
162+
}
158163
// console.log("url", url);
159164
return this.uriPrefix + url;
160165
});

0 commit comments

Comments
 (0)