@operato/scene-urdf 10.0.0-beta.1 → 10.0.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/TODO.md +58 -0
- package/dist/editors/index.d.ts +7 -0
- package/dist/editors/index.js +12 -1
- package/dist/editors/index.js.map +1 -1
- package/dist/editors/property-editor-urdf-joints.d.ts +54 -0
- package/dist/editors/property-editor-urdf-joints.js +246 -0
- package/dist/editors/property-editor-urdf-joints.js.map +1 -0
- package/dist/editors/property-editor-urdf-preset.d.ts +8 -0
- package/dist/editors/property-editor-urdf-preset.js +114 -0
- package/dist/editors/property-editor-urdf-preset.js.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/dist/joint-controller.d.ts +35 -0
- package/dist/joint-controller.js +34 -0
- package/dist/joint-controller.js.map +1 -0
- package/dist/real-object-urdf.d.ts +106 -0
- package/dist/real-object-urdf.js +527 -0
- package/dist/real-object-urdf.js.map +1 -0
- package/dist/smoothing-controller.d.ts +15 -0
- package/dist/smoothing-controller.js +88 -0
- package/dist/smoothing-controller.js.map +1 -0
- package/dist/templates/index.d.ts +3 -0
- package/dist/templates/index.js +2 -3
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/{urdf-controller.d.ts → urdf.d.ts} +3 -0
- package/dist/templates/urdf.js +19 -0
- package/dist/templates/urdf.js.map +1 -0
- package/dist/urdf-object.d.ts +264 -0
- package/dist/urdf-object.js +190 -0
- package/dist/urdf-object.js.map +1 -0
- package/dist/urdf-presets.d.ts +22 -0
- package/dist/urdf-presets.js +176 -0
- package/dist/urdf-presets.js.map +1 -0
- package/icons/urdf.png +0 -0
- package/package.json +5 -4
- package/translations/en.json +10 -16
- package/translations/ja.json +10 -16
- package/translations/ko.json +10 -16
- package/translations/ms.json +10 -16
- package/translations/zh.json +10 -16
- package/dist/elements/drag-n-drop.d.ts +0 -2
- package/dist/elements/drag-n-drop.js +0 -126
- package/dist/elements/drag-n-drop.js.map +0 -1
- package/dist/elements/urdf-controller-element.d.ts +0 -12
- package/dist/elements/urdf-controller-element.js +0 -283
- package/dist/elements/urdf-controller-element.js.map +0 -1
- package/dist/elements/urdf-drag-controls.d.ts +0 -32
- package/dist/elements/urdf-drag-controls.js +0 -197
- package/dist/elements/urdf-drag-controls.js.map +0 -1
- package/dist/elements/urdf-manipulator-element.d.ts +0 -15
- package/dist/elements/urdf-manipulator-element.js +0 -112
- package/dist/elements/urdf-manipulator-element.js.map +0 -1
- package/dist/elements/urdf-viewer-element.d.ts +0 -53
- package/dist/elements/urdf-viewer-element.js +0 -414
- package/dist/elements/urdf-viewer-element.js.map +0 -1
- package/dist/templates/urdf-controller.js +0 -16
- package/dist/templates/urdf-controller.js.map +0 -1
- package/dist/templates/urdf-viewer.d.ts +0 -14
- package/dist/templates/urdf-viewer.js +0 -16
- package/dist/templates/urdf-viewer.js.map +0 -1
- package/dist/urdf-controller.d.ts +0 -15
- package/dist/urdf-controller.js +0 -70
- package/dist/urdf-controller.js.map +0 -1
- package/dist/urdf-viewer.d.ts +0 -16
- package/dist/urdf-viewer.js +0 -202
- package/dist/urdf-viewer.js.map +0 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* URDF 로봇을 things-scene 3D 공간에 네이티브로 임베드한다.
|
|
5
|
+
* GLTFObject와 대칭적인 구조 — 2D 탑뷰는 스냅샷 렌더로 표현한다.
|
|
6
|
+
*/
|
|
7
|
+
import { __decorate } from "tslib";
|
|
8
|
+
import { RectPath, Shape, sceneComponent } from '@hatiolab/things-scene';
|
|
9
|
+
import { RealObjectURDF } from './real-object-urdf.js';
|
|
10
|
+
const BASE_URL_ALIAS = '$base_url';
|
|
11
|
+
const NATURE = {
|
|
12
|
+
mutable: false,
|
|
13
|
+
resizable: true,
|
|
14
|
+
rotatable: true,
|
|
15
|
+
properties: [
|
|
16
|
+
{
|
|
17
|
+
type: 'urdf-preset',
|
|
18
|
+
label: 'preset',
|
|
19
|
+
name: 'preset'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: 'string',
|
|
23
|
+
label: 'url',
|
|
24
|
+
name: 'src',
|
|
25
|
+
property: {
|
|
26
|
+
displayField: 'id',
|
|
27
|
+
displayFullUrl: true,
|
|
28
|
+
baseUrlAlias: BASE_URL_ALIAS,
|
|
29
|
+
defaultStorage: '3d-model',
|
|
30
|
+
storageFilters: {
|
|
31
|
+
type: Array,
|
|
32
|
+
value: [
|
|
33
|
+
{
|
|
34
|
+
name: 'category',
|
|
35
|
+
value: 'urdf'
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
useUpload: true,
|
|
40
|
+
category: 'application'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'select',
|
|
45
|
+
label: 'up-axis',
|
|
46
|
+
name: 'upAxis',
|
|
47
|
+
property: {
|
|
48
|
+
options: [
|
|
49
|
+
{ display: 'Z (URDF default)', value: 'z' },
|
|
50
|
+
{ display: 'Y (Three.js default)', value: 'y' }
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'number',
|
|
56
|
+
label: 'unit-scale',
|
|
57
|
+
name: 'unitScale',
|
|
58
|
+
placeholder: '1000'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: 'select',
|
|
62
|
+
label: 'auto-animate',
|
|
63
|
+
name: 'autoAnimate',
|
|
64
|
+
property: {
|
|
65
|
+
options: [
|
|
66
|
+
{ display: 'Off', value: 'none' },
|
|
67
|
+
{ display: 'Sine swing', value: 'sine' }
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: 'select',
|
|
73
|
+
label: 'physics',
|
|
74
|
+
name: 'physics',
|
|
75
|
+
property: {
|
|
76
|
+
options: [
|
|
77
|
+
{ display: 'Direct (immediate)', value: 'none' },
|
|
78
|
+
{ display: 'Smooth (damped)', value: 'smooth' }
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: 'urdf-joints',
|
|
84
|
+
label: '',
|
|
85
|
+
name: 'joints',
|
|
86
|
+
editor: {
|
|
87
|
+
fullwidth: true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
'value-property': 'source',
|
|
92
|
+
help: 'scene/component/urdf'
|
|
93
|
+
};
|
|
94
|
+
let URDFObject = class URDFObject extends RectPath(Shape) {
|
|
95
|
+
get hasTextProperty() {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
is3dish() {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
get controls() {
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
render(context) {
|
|
105
|
+
const { left, top, width, height } = this.bounds;
|
|
106
|
+
context.beginPath();
|
|
107
|
+
const snapshot = this._topViewSnapshot;
|
|
108
|
+
if (snapshot) {
|
|
109
|
+
context.drawImage(snapshot, left, top, width, height);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
// 폴백: 로봇 아이콘 박스 + 중앙 라벨
|
|
113
|
+
context.rect(left, top, width, height);
|
|
114
|
+
context.fillStyle = '#e3f2fd';
|
|
115
|
+
context.fill();
|
|
116
|
+
context.strokeStyle = '#1976d2';
|
|
117
|
+
context.lineWidth = 1;
|
|
118
|
+
context.stroke();
|
|
119
|
+
const src = this.getState('src');
|
|
120
|
+
const label = src ? src.split('/').pop()?.replace(/\.[^.]+$/, '') || 'URDF' : 'URDF';
|
|
121
|
+
const fontSize = Math.max(10, Math.min(width, height) * 0.12);
|
|
122
|
+
context.fillStyle = '#1976d2';
|
|
123
|
+
context.font = `${fontSize}px sans-serif`;
|
|
124
|
+
context.textAlign = 'center';
|
|
125
|
+
context.textBaseline = 'middle';
|
|
126
|
+
context.fillText(label, left + width / 2, top + height / 2, width * 0.9);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async ready() {
|
|
130
|
+
await super.ready();
|
|
131
|
+
this._ensureTopViewSnapshot();
|
|
132
|
+
}
|
|
133
|
+
onchange(after, before) {
|
|
134
|
+
super.onchange(after, before);
|
|
135
|
+
if ('src' in after) {
|
|
136
|
+
this._topViewSnapshot = undefined;
|
|
137
|
+
this._ensureTopViewSnapshot();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
_ensureTopViewSnapshot() {
|
|
141
|
+
const src = this.getState('src');
|
|
142
|
+
if (!src)
|
|
143
|
+
return;
|
|
144
|
+
const cached = RealObjectURDF.getTopViewCache(src);
|
|
145
|
+
if (cached) {
|
|
146
|
+
this._topViewSnapshot = cached;
|
|
147
|
+
this.invalidate();
|
|
148
|
+
}
|
|
149
|
+
// 캐시 miss인 경우 3D 씬이 활성화되면 _onLoaded에서 자동 생성한다.
|
|
150
|
+
}
|
|
151
|
+
buildRealObject() {
|
|
152
|
+
return new RealObjectURDF(this);
|
|
153
|
+
}
|
|
154
|
+
get nature() {
|
|
155
|
+
return NATURE;
|
|
156
|
+
}
|
|
157
|
+
get source() {
|
|
158
|
+
return this.getState('src');
|
|
159
|
+
}
|
|
160
|
+
set source(source) {
|
|
161
|
+
this.setState('src', source);
|
|
162
|
+
}
|
|
163
|
+
set dimension(dimension) {
|
|
164
|
+
const { width = 1, height = 1, depth = 1 } = dimension;
|
|
165
|
+
this.setState({ width, height, depth });
|
|
166
|
+
this.realObject?.updateDimension();
|
|
167
|
+
}
|
|
168
|
+
// --- URDF 바인딩 API ---
|
|
169
|
+
/** 조인트 상태 맵. 값은 숫자(라디안/거리) 또는 { value } 형식 허용. */
|
|
170
|
+
get joints() {
|
|
171
|
+
return this.getState('joints');
|
|
172
|
+
}
|
|
173
|
+
set joints(value) {
|
|
174
|
+
this.setState('joints', value);
|
|
175
|
+
}
|
|
176
|
+
/** 로드된 URDF의 조인트 메타 정보. property editor가 슬라이더 UI 생성에 사용. */
|
|
177
|
+
get jointMeta() {
|
|
178
|
+
const ro = this.realObject;
|
|
179
|
+
return ro?.jointMeta ?? [];
|
|
180
|
+
}
|
|
181
|
+
get jointNames() {
|
|
182
|
+
const ro = this.realObject;
|
|
183
|
+
return ro?.jointNames ?? [];
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
URDFObject = __decorate([
|
|
187
|
+
sceneComponent('urdf')
|
|
188
|
+
], URDFObject);
|
|
189
|
+
export { URDFObject };
|
|
190
|
+
//# sourceMappingURL=urdf-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urdf-object.js","sourceRoot":"","sources":["../src/urdf-object.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EACL,QAAQ,EACR,KAAK,EACL,cAAc,EAIf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD,MAAM,cAAc,GAAG,WAAW,CAAA;AAElC,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE;gBACR,YAAY,EAAE,IAAI;gBAClB,cAAc,EAAE,IAAI;gBACpB,YAAY,EAAE,cAAc;gBAC5B,cAAc,EAAE,UAAU;gBAC1B,cAAc,EAAE;oBACd,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE,UAAU;4BAChB,KAAK,EAAE,MAAM;yBACd;qBACF;iBACF;gBACD,SAAS,EAAE,IAAI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CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IAC9B,CAAC;IAED,IAAI,SAAS,CAAC,SAA2D;QACvE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,SAAS,CAAA;QACtD,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;QACvC,IAAI,CAAC,UAAU,EAAE,eAAe,EAAE,CAAA;IACpC,CAAC;IAED,uBAAuB;IAEvB,kDAAkD;IAClD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,MAAM,CAAC,KAA0D;QACnE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChC,CAAC;IAED,4DAA4D;IAC5D,IAAI,SAAS;QACX,MAAM,EAAE,GAAG,IAAI,CAAC,UAAwC,CAAA;QACxD,OAAO,EAAE,EAAE,SAAS,IAAI,EAAE,CAAA;IAC5B,CAAC;IAED,IAAI,UAAU;QACZ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAwC,CAAA;QACxD,OAAO,EAAE,EAAE,UAAU,IAAI,EAAE,CAAA;IAC7B,CAAC;CACF,CAAA;AA7GY,UAAU;IADtB,cAAc,CAAC,MAAM,CAAC;GACV,UAAU,CA6GtB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n *\n * URDF 로봇을 things-scene 3D 공간에 네이티브로 임베드한다.\n * GLTFObject와 대칭적인 구조 — 2D 탑뷰는 스냅샷 렌더로 표현한다.\n */\n\nimport {\n RectPath,\n Shape,\n sceneComponent,\n type ComponentNature,\n type Control,\n type IRealObject\n} from '@hatiolab/things-scene'\nimport { RealObjectURDF } from './real-object-urdf.js'\nimport type { URDFJointState, URDFJointMeta } from './real-object-urdf.js'\n\nconst BASE_URL_ALIAS = '$base_url'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'urdf-preset',\n label: 'preset',\n name: 'preset'\n },\n {\n type: 'string',\n label: 'url',\n name: 'src',\n property: {\n displayField: 'id',\n displayFullUrl: true,\n baseUrlAlias: BASE_URL_ALIAS,\n defaultStorage: '3d-model',\n storageFilters: {\n type: Array,\n value: [\n {\n name: 'category',\n value: 'urdf'\n }\n ]\n },\n useUpload: true,\n category: 'application'\n }\n },\n {\n type: 'select',\n label: 'up-axis',\n name: 'upAxis',\n property: {\n options: [\n { display: 'Z (URDF default)', value: 'z' },\n { display: 'Y (Three.js default)', value: 'y' }\n ]\n }\n },\n {\n type: 'number',\n label: 'unit-scale',\n name: 'unitScale',\n placeholder: '1000'\n },\n {\n type: 'select',\n label: 'auto-animate',\n name: 'autoAnimate',\n property: {\n options: [\n { display: 'Off', value: 'none' },\n { display: 'Sine swing', value: 'sine' }\n ]\n }\n },\n {\n type: 'select',\n label: 'physics',\n name: 'physics',\n property: {\n options: [\n { display: 'Direct (immediate)', value: 'none' },\n { display: 'Smooth (damped)', value: 'smooth' }\n ]\n }\n },\n {\n type: 'urdf-joints',\n label: '',\n name: 'joints',\n editor: {\n fullwidth: true\n }\n }\n ],\n 'value-property': 'source',\n help: 'scene/component/urdf'\n}\n\n@sceneComponent('urdf')\nexport class URDFObject extends RectPath(Shape) {\n get hasTextProperty() {\n return false\n }\n\n is3dish() {\n return true\n }\n\n get controls(): Array<Control> | undefined {\n return []\n }\n\n render(context: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n\n context.beginPath()\n\n const snapshot = (this as any)._topViewSnapshot as HTMLCanvasElement | undefined\n if (snapshot) {\n context.drawImage(snapshot, left, top, width, height)\n } else {\n // 폴백: 로봇 아이콘 박스 + 중앙 라벨\n context.rect(left, top, width, height)\n context.fillStyle = '#e3f2fd'\n context.fill()\n context.strokeStyle = '#1976d2'\n context.lineWidth = 1\n context.stroke()\n\n const src = this.getState('src') as string | undefined\n const label = src ? src.split('/').pop()?.replace(/\\.[^.]+$/, '') || 'URDF' : 'URDF'\n const fontSize = Math.max(10, Math.min(width, height) * 0.12)\n context.fillStyle = '#1976d2'\n context.font = `${fontSize}px sans-serif`\n context.textAlign = 'center'\n context.textBaseline = 'middle'\n context.fillText(label, left + width / 2, top + height / 2, width * 0.9)\n }\n }\n\n async ready() {\n await super.ready()\n this._ensureTopViewSnapshot()\n }\n\n onchange(after: Record<string, any>, before: Record<string, any>) {\n super.onchange(after, before)\n if ('src' in after) {\n (this as any)._topViewSnapshot = undefined\n this._ensureTopViewSnapshot()\n }\n }\n\n private _ensureTopViewSnapshot() {\n const src = this.getState('src') as string | undefined\n if (!src) return\n\n const cached = RealObjectURDF.getTopViewCache(src)\n if (cached) {\n (this as any)._topViewSnapshot = cached\n this.invalidate()\n }\n // 캐시 miss인 경우 3D 씬이 활성화되면 _onLoaded에서 자동 생성한다.\n }\n\n buildRealObject(): IRealObject | undefined {\n return new RealObjectURDF(this as any)\n }\n\n get nature() {\n return NATURE\n }\n\n get source() {\n return this.getState('src')\n }\n\n set source(source) {\n this.setState('src', source)\n }\n\n set dimension(dimension: { width: number; height: number; depth: number }) {\n const { width = 1, height = 1, depth = 1 } = dimension\n this.setState({ width, height, depth })\n this.realObject?.updateDimension()\n }\n\n // --- URDF 바인딩 API ---\n\n /** 조인트 상태 맵. 값은 숫자(라디안/거리) 또는 { value } 형식 허용. */\n get joints(): Record<string, URDFJointState | number> | undefined {\n return this.getState('joints')\n }\n\n set joints(value: Record<string, URDFJointState | number> | undefined) {\n this.setState('joints', value)\n }\n\n /** 로드된 URDF의 조인트 메타 정보. property editor가 슬라이더 UI 생성에 사용. */\n get jointMeta(): URDFJointMeta[] {\n const ro = this.realObject as RealObjectURDF | undefined\n return ro?.jointMeta ?? []\n }\n\n get jointNames(): string[] {\n const ro = this.realObject as RealObjectURDF | undefined\n return ro?.jointNames ?? []\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface UrdfPreset {
|
|
2
|
+
/** 고유 식별자 (select value) */
|
|
3
|
+
id: string;
|
|
4
|
+
/** 표시 이름 */
|
|
5
|
+
display: string;
|
|
6
|
+
/** 로봇 분류 (arm / mobile / aerial / humanoid / quadruped) */
|
|
7
|
+
category: 'arm' | 'mobile' | 'aerial' | 'humanoid' | 'quadruped';
|
|
8
|
+
/** URDF 파일 URL */
|
|
9
|
+
src: string;
|
|
10
|
+
/** 컴포넌트 기본 dimension (mm). 로드 시 uniform best-fit scale 적용. */
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
depth: number;
|
|
14
|
+
/** 좌표계 up 축 (URDF는 보통 'z') */
|
|
15
|
+
upAxis: 'z' | 'y';
|
|
16
|
+
/** URDF meter → 에디터 mm 스케일 (보통 1000) */
|
|
17
|
+
unitScale: number;
|
|
18
|
+
/** ROS `package://<pkg>/...` prefix 해석 맵. 없으면 URDF 상대 경로만 지원. */
|
|
19
|
+
packages?: Record<string, string>;
|
|
20
|
+
}
|
|
21
|
+
export declare const URDF_PRESETS: UrdfPreset[];
|
|
22
|
+
export declare function findPreset(id: string): UrdfPreset | undefined;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* 공개된 URDF 프리셋 목록. 프리셋 선택 시 컴포넌트의 src 뿐 아니라 크기/축/
|
|
5
|
+
* 단위 스케일도 적절한 기본값으로 함께 설정한다. 모든 URL은 raw.githubusercontent
|
|
6
|
+
* .com 경유로 CORS 열려있음.
|
|
7
|
+
*/
|
|
8
|
+
export const URDF_PRESETS = [
|
|
9
|
+
{
|
|
10
|
+
id: 'ur5',
|
|
11
|
+
display: 'Universal Robots UR5 (6-DOF arm)',
|
|
12
|
+
category: 'arm',
|
|
13
|
+
src: 'https://raw.githubusercontent.com/mmatl/urdfpy/master/tests/data/ur5/ur5.urdf',
|
|
14
|
+
width: 200, height: 200, depth: 200,
|
|
15
|
+
upAxis: 'z',
|
|
16
|
+
unitScale: 1000
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'kuka-iiwa',
|
|
20
|
+
display: 'KUKA LBR iiwa (7-DOF arm)',
|
|
21
|
+
category: 'arm',
|
|
22
|
+
src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/kuka_iiwa/model.urdf',
|
|
23
|
+
width: 200, height: 200, depth: 200,
|
|
24
|
+
upAxis: 'z',
|
|
25
|
+
unitScale: 1000
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'kuka-lwr',
|
|
29
|
+
display: 'KUKA LWR (7-DOF research arm)',
|
|
30
|
+
category: 'arm',
|
|
31
|
+
src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/kuka_lwr/kuka.urdf',
|
|
32
|
+
width: 200, height: 200, depth: 200,
|
|
33
|
+
upAxis: 'z',
|
|
34
|
+
unitScale: 1000
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'widowx',
|
|
38
|
+
display: 'WidowX (6-DOF small arm)',
|
|
39
|
+
category: 'arm',
|
|
40
|
+
src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/widowx/widowx.urdf',
|
|
41
|
+
width: 200, height: 200, depth: 200,
|
|
42
|
+
upAxis: 'z',
|
|
43
|
+
unitScale: 1000
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'husky',
|
|
47
|
+
display: 'Clearpath Husky (4-wheel mobile)',
|
|
48
|
+
category: 'mobile',
|
|
49
|
+
src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/husky/husky.urdf',
|
|
50
|
+
width: 200, height: 200, depth: 200,
|
|
51
|
+
upAxis: 'z',
|
|
52
|
+
unitScale: 1000
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'minitaur',
|
|
56
|
+
display: 'Ghost Minitaur (quadruped)',
|
|
57
|
+
category: 'quadruped',
|
|
58
|
+
src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/quadruped/minitaur.urdf',
|
|
59
|
+
width: 200, height: 200, depth: 200,
|
|
60
|
+
upAxis: 'z',
|
|
61
|
+
unitScale: 1000
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'quadrotor',
|
|
65
|
+
display: 'Quadrotor (drone)',
|
|
66
|
+
category: 'aerial',
|
|
67
|
+
src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/Quadrotor/quadrotor.urdf',
|
|
68
|
+
width: 200, height: 200, depth: 200,
|
|
69
|
+
upAxis: 'z',
|
|
70
|
+
unitScale: 1000
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'nao',
|
|
74
|
+
display: 'Aldebaran NAO (humanoid)',
|
|
75
|
+
category: 'humanoid',
|
|
76
|
+
src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/humanoid/nao.urdf',
|
|
77
|
+
width: 200, height: 200, depth: 200,
|
|
78
|
+
upAxis: 'z',
|
|
79
|
+
unitScale: 1000
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'racecar',
|
|
83
|
+
display: 'Racecar (4-wheel)',
|
|
84
|
+
category: 'mobile',
|
|
85
|
+
src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/racecar/racecar.urdf',
|
|
86
|
+
width: 200, height: 200, depth: 200,
|
|
87
|
+
upAxis: 'z',
|
|
88
|
+
unitScale: 1000
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'differential',
|
|
92
|
+
display: 'Differential Drive (simple mobile)',
|
|
93
|
+
category: 'mobile',
|
|
94
|
+
src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/differential/diff_ring.urdf',
|
|
95
|
+
width: 200, height: 200, depth: 200,
|
|
96
|
+
upAxis: 'z',
|
|
97
|
+
unitScale: 1000
|
|
98
|
+
},
|
|
99
|
+
// --- Unitree Robotics 시리즈 (package:// 경로 사용) ---
|
|
100
|
+
{
|
|
101
|
+
id: 'unitree-a1',
|
|
102
|
+
display: 'Unitree A1 (mini quadruped)',
|
|
103
|
+
category: 'quadruped',
|
|
104
|
+
src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/a1_description/urdf/a1.urdf',
|
|
105
|
+
packages: {
|
|
106
|
+
a1_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/a1_description'
|
|
107
|
+
},
|
|
108
|
+
width: 200, height: 200, depth: 200,
|
|
109
|
+
upAxis: 'z',
|
|
110
|
+
unitScale: 1000
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 'unitree-go1',
|
|
114
|
+
display: 'Unitree Go1 (quadruped)',
|
|
115
|
+
category: 'quadruped',
|
|
116
|
+
src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/go1_description/urdf/go1.urdf',
|
|
117
|
+
packages: {
|
|
118
|
+
go1_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/go1_description'
|
|
119
|
+
},
|
|
120
|
+
width: 200, height: 200, depth: 200,
|
|
121
|
+
upAxis: 'z',
|
|
122
|
+
unitScale: 1000
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'unitree-aliengo',
|
|
126
|
+
display: 'Unitree Aliengo (large quadruped)',
|
|
127
|
+
category: 'quadruped',
|
|
128
|
+
src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/aliengo_description/urdf/aliengo.urdf',
|
|
129
|
+
packages: {
|
|
130
|
+
aliengo_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/aliengo_description'
|
|
131
|
+
},
|
|
132
|
+
width: 200, height: 200, depth: 200,
|
|
133
|
+
upAxis: 'z',
|
|
134
|
+
unitScale: 1000
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 'unitree-laikago',
|
|
138
|
+
display: 'Unitree Laikago (quadruped)',
|
|
139
|
+
category: 'quadruped',
|
|
140
|
+
src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/laikago_description/urdf/laikago.urdf',
|
|
141
|
+
packages: {
|
|
142
|
+
laikago_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/laikago_description'
|
|
143
|
+
},
|
|
144
|
+
width: 200, height: 200, depth: 200,
|
|
145
|
+
upAxis: 'z',
|
|
146
|
+
unitScale: 1000
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'unitree-z1',
|
|
150
|
+
display: 'Unitree Z1 (6-DOF arm)',
|
|
151
|
+
category: 'arm',
|
|
152
|
+
src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/z1_description/xacro/z1.urdf',
|
|
153
|
+
packages: {
|
|
154
|
+
z1_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/z1_description'
|
|
155
|
+
},
|
|
156
|
+
width: 200, height: 200, depth: 200,
|
|
157
|
+
upAxis: 'z',
|
|
158
|
+
unitScale: 1000
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'unitree-h1',
|
|
162
|
+
display: 'Unitree H1 (humanoid)',
|
|
163
|
+
category: 'humanoid',
|
|
164
|
+
src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/h1_description/urdf/h1.urdf',
|
|
165
|
+
packages: {
|
|
166
|
+
h1_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/h1_description'
|
|
167
|
+
},
|
|
168
|
+
width: 200, height: 200, depth: 200,
|
|
169
|
+
upAxis: 'z',
|
|
170
|
+
unitScale: 1000
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
export function findPreset(id) {
|
|
174
|
+
return URDF_PRESETS.find(p => p.id === id);
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=urdf-presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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A0G;QAC/G,QAAQ,EAAE;YACR,cAAc,EAAE,4FAA4F;SAC7G;QACD,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG;QACnC,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,IAAI;KAChB;IACD;QACE,EAAE,EAAE,YAAY;QAChB,OAAO,EAAE,uBAAuB;QAChC,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,yGAAyG;QAC9G,QAAQ,EAAE;YACR,cAAc,EAAE,4FAA4F;SAC7G;QACD,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG;QACnC,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,IAAI;KAChB;CACF,CAAA;AAED,MAAM,UAAU,UAAU,CAAC,EAAU;IACnC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AAC5C,CAAC","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n *\n * 공개된 URDF 프리셋 목록. 프리셋 선택 시 컴포넌트의 src 뿐 아니라 크기/축/\n * 단위 스케일도 적절한 기본값으로 함께 설정한다. 모든 URL은 raw.githubusercontent\n * .com 경유로 CORS 열려있음.\n */\n\nexport interface UrdfPreset {\n /** 고유 식별자 (select value) */\n id: string\n /** 표시 이름 */\n display: string\n /** 로봇 분류 (arm / mobile / aerial / humanoid / quadruped) */\n category: 'arm' | 'mobile' | 'aerial' | 'humanoid' | 'quadruped'\n /** URDF 파일 URL */\n src: string\n /** 컴포넌트 기본 dimension (mm). 로드 시 uniform best-fit scale 적용. */\n width: number\n height: number\n depth: number\n /** 좌표계 up 축 (URDF는 보통 'z') */\n upAxis: 'z' | 'y'\n /** URDF meter → 에디터 mm 스케일 (보통 1000) */\n unitScale: number\n /** ROS `package://<pkg>/...` prefix 해석 맵. 없으면 URDF 상대 경로만 지원. */\n packages?: Record<string, string>\n}\n\nexport const URDF_PRESETS: UrdfPreset[] = [\n {\n id: 'ur5',\n display: 'Universal Robots UR5 (6-DOF arm)',\n category: 'arm',\n src: 'https://raw.githubusercontent.com/mmatl/urdfpy/master/tests/data/ur5/ur5.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'kuka-iiwa',\n display: 'KUKA LBR iiwa (7-DOF arm)',\n category: 'arm',\n src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/kuka_iiwa/model.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'kuka-lwr',\n display: 'KUKA LWR (7-DOF research arm)',\n category: 'arm',\n src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/kuka_lwr/kuka.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'widowx',\n display: 'WidowX (6-DOF small arm)',\n category: 'arm',\n src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/widowx/widowx.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'husky',\n display: 'Clearpath Husky (4-wheel mobile)',\n category: 'mobile',\n src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/husky/husky.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'minitaur',\n display: 'Ghost Minitaur (quadruped)',\n category: 'quadruped',\n src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/quadruped/minitaur.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'quadrotor',\n display: 'Quadrotor (drone)',\n category: 'aerial',\n src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/Quadrotor/quadrotor.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'nao',\n display: 'Aldebaran NAO (humanoid)',\n category: 'humanoid',\n src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/humanoid/nao.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'racecar',\n display: 'Racecar (4-wheel)',\n category: 'mobile',\n src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/racecar/racecar.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'differential',\n display: 'Differential Drive (simple mobile)',\n category: 'mobile',\n src: 'https://raw.githubusercontent.com/bulletphysics/bullet3/master/data/differential/diff_ring.urdf',\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n // --- Unitree Robotics 시리즈 (package:// 경로 사용) ---\n {\n id: 'unitree-a1',\n display: 'Unitree A1 (mini quadruped)',\n category: 'quadruped',\n src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/a1_description/urdf/a1.urdf',\n packages: {\n a1_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/a1_description'\n },\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'unitree-go1',\n display: 'Unitree Go1 (quadruped)',\n category: 'quadruped',\n src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/go1_description/urdf/go1.urdf',\n packages: {\n go1_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/go1_description'\n },\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'unitree-aliengo',\n display: 'Unitree Aliengo (large quadruped)',\n category: 'quadruped',\n src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/aliengo_description/urdf/aliengo.urdf',\n packages: {\n aliengo_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/aliengo_description'\n },\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'unitree-laikago',\n display: 'Unitree Laikago (quadruped)',\n category: 'quadruped',\n src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/laikago_description/urdf/laikago.urdf',\n packages: {\n laikago_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/laikago_description'\n },\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'unitree-z1',\n display: 'Unitree Z1 (6-DOF arm)',\n category: 'arm',\n src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/z1_description/xacro/z1.urdf',\n packages: {\n z1_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/z1_description'\n },\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n },\n {\n id: 'unitree-h1',\n display: 'Unitree H1 (humanoid)',\n category: 'humanoid',\n src: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/h1_description/urdf/h1.urdf',\n packages: {\n h1_description: 'https://raw.githubusercontent.com/unitreerobotics/unitree_ros/master/robots/h1_description'\n },\n width: 200, height: 200, depth: 200,\n upAxis: 'z',\n unitScale: 1000\n }\n]\n\nexport function findPreset(id: string): UrdfPreset | undefined {\n return URDF_PRESETS.find(p => p.id === id)\n}\n"]}
|
package/icons/urdf.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/scene-urdf",
|
|
3
3
|
"description": "Scene module for manipulating robot simulation through URDF format",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.0.0-beta.
|
|
5
|
+
"version": "10.0.0-beta.19",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
@@ -29,11 +29,12 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@hatiolab/things-scene": "^10.0.0-beta.1",
|
|
32
|
+
"@operato/i18n": "^10.0.0-beta.1",
|
|
33
|
+
"@operato/property-editor": "^10.0.0-beta.1",
|
|
32
34
|
"@operato/styles": "^10.0.0-beta.1",
|
|
33
35
|
"lit": "^3.1.2",
|
|
34
36
|
"three": "^0.183.0",
|
|
35
|
-
"urdf-loader": "^0.
|
|
36
|
-
"xacro-parser": "^0.3.9"
|
|
37
|
+
"urdf-loader": "^0.12.7"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
@@ -65,5 +66,5 @@
|
|
|
65
66
|
"prettier --write"
|
|
66
67
|
]
|
|
67
68
|
},
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "a48eaab9f00d20b5adb280183f5ff830237895e7"
|
|
69
70
|
}
|
package/translations/en.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"component.urdf
|
|
3
|
-
"
|
|
4
|
-
"label.
|
|
5
|
-
"label.
|
|
6
|
-
"label.
|
|
7
|
-
"label.
|
|
8
|
-
"label.
|
|
9
|
-
"label.
|
|
10
|
-
"label.
|
|
11
|
-
"label.
|
|
12
|
-
"label.no-auto-recenter": "no auto recenter",
|
|
13
|
-
"label.disable-dragging": "disable dragging",
|
|
14
|
-
"label.no-camera-control": "disable cam. control",
|
|
15
|
-
"label.init-camera-pos-x": "cam pos(x)",
|
|
16
|
-
"label.init-camera-pos-y": "cam pos(y)",
|
|
17
|
-
"label.init-camera-pos-z": "cam pos(z)"
|
|
2
|
+
"component.urdf": "URDF",
|
|
3
|
+
"label.preset": "preset",
|
|
4
|
+
"label.url": "URL",
|
|
5
|
+
"label.up-axis": "up axis",
|
|
6
|
+
"label.unit-scale": "unit scale",
|
|
7
|
+
"label.auto-animate": "auto animate",
|
|
8
|
+
"label.physics": "physics",
|
|
9
|
+
"label.joints": "joints",
|
|
10
|
+
"label.waiting-for-urdf-load": "waiting for URDF to load…",
|
|
11
|
+
"label.reset-all": "reset all"
|
|
18
12
|
}
|
package/translations/ja.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"component.urdf
|
|
3
|
-
"
|
|
4
|
-
"label.
|
|
5
|
-
"label.
|
|
6
|
-
"label.
|
|
7
|
-
"label.
|
|
8
|
-
"label.
|
|
9
|
-
"label.
|
|
10
|
-
"label.
|
|
11
|
-
"label.
|
|
12
|
-
"label.no-auto-recenter": "自動リセンタリングなし",
|
|
13
|
-
"label.disable-dragging": "ドラッグを無効にする",
|
|
14
|
-
"label.no-camera-control": "カメラコントロールを無効にする",
|
|
15
|
-
"label.init-camera-pos-x": "カメラ位置(x)",
|
|
16
|
-
"label.init-camera-pos-y": "カメラ位置(y)",
|
|
17
|
-
"label.init-camera-pos-z": "カメラ位置(z)"
|
|
2
|
+
"component.urdf": "URDF",
|
|
3
|
+
"label.preset": "プリセット",
|
|
4
|
+
"label.url": "URL",
|
|
5
|
+
"label.up-axis": "上軸",
|
|
6
|
+
"label.unit-scale": "単位スケール",
|
|
7
|
+
"label.auto-animate": "自動アニメーション",
|
|
8
|
+
"label.physics": "物理",
|
|
9
|
+
"label.joints": "関節",
|
|
10
|
+
"label.waiting-for-urdf-load": "URDFの読み込みを待っています…",
|
|
11
|
+
"label.reset-all": "すべてリセット"
|
|
18
12
|
}
|
package/translations/ko.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"component.urdf
|
|
3
|
-
"
|
|
4
|
-
"label.
|
|
5
|
-
"label.
|
|
6
|
-
"label.
|
|
7
|
-
"label.
|
|
8
|
-
"label.
|
|
9
|
-
"label.
|
|
10
|
-
"label.
|
|
11
|
-
"label.
|
|
12
|
-
"label.no-auto-recenter": "자동 센터링 않기",
|
|
13
|
-
"label.disable-dragging": "드래깅 불가",
|
|
14
|
-
"label.no-camera-control": "카메라 이동 불가",
|
|
15
|
-
"label.init-camera-pos-x": "Cam 위치(x)",
|
|
16
|
-
"label.init-camera-pos-y": "Cam 위치(y)",
|
|
17
|
-
"label.init-camera-pos-z": "Cam 위치(z)"
|
|
2
|
+
"component.urdf": "URDF",
|
|
3
|
+
"label.preset": "프리셋",
|
|
4
|
+
"label.url": "URL",
|
|
5
|
+
"label.up-axis": "위 축",
|
|
6
|
+
"label.unit-scale": "단위 스케일",
|
|
7
|
+
"label.auto-animate": "자동 애니메이션",
|
|
8
|
+
"label.physics": "물리",
|
|
9
|
+
"label.joints": "관절",
|
|
10
|
+
"label.waiting-for-urdf-load": "URDF 로드 대기 중…",
|
|
11
|
+
"label.reset-all": "모두 초기화"
|
|
18
12
|
}
|
package/translations/ms.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"component.urdf
|
|
3
|
-
"
|
|
4
|
-
"label.
|
|
5
|
-
"label.
|
|
6
|
-
"label.
|
|
7
|
-
"label.
|
|
8
|
-
"label.
|
|
9
|
-
"label.
|
|
10
|
-
"label.
|
|
11
|
-
"label.
|
|
12
|
-
"label.no-auto-recenter": "tiada auto-recenter",
|
|
13
|
-
"label.disable-dragging": "matikan seret",
|
|
14
|
-
"label.no-camera-control": "matikan kawalan kamera",
|
|
15
|
-
"label.init-camera-pos-x": "posisi kamera(x)",
|
|
16
|
-
"label.init-camera-pos-y": "posisi kamera(y)",
|
|
17
|
-
"label.init-camera-pos-z": "posisi kamera(z)"
|
|
2
|
+
"component.urdf": "URDF",
|
|
3
|
+
"label.preset": "pratetap",
|
|
4
|
+
"label.url": "URL",
|
|
5
|
+
"label.up-axis": "paksi atas",
|
|
6
|
+
"label.unit-scale": "skala unit",
|
|
7
|
+
"label.auto-animate": "animasi auto",
|
|
8
|
+
"label.physics": "fizik",
|
|
9
|
+
"label.joints": "sendi",
|
|
10
|
+
"label.waiting-for-urdf-load": "menunggu URDF dimuatkan…",
|
|
11
|
+
"label.reset-all": "tetapkan semula semua"
|
|
18
12
|
}
|
package/translations/zh.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"component.urdf
|
|
3
|
-
"
|
|
4
|
-
"label.
|
|
5
|
-
"label.
|
|
6
|
-
"label.
|
|
7
|
-
"label.
|
|
8
|
-
"label.
|
|
9
|
-
"label.
|
|
10
|
-
"label.
|
|
11
|
-
"label.
|
|
12
|
-
"label.no-auto-recenter": "不自动居中",
|
|
13
|
-
"label.disable-dragging": "禁用拖动",
|
|
14
|
-
"label.no-camera-control": "禁用相机控制",
|
|
15
|
-
"label.init-camera-pos-x": "相机位置(x)",
|
|
16
|
-
"label.init-camera-pos-y": "相机位置(y)",
|
|
17
|
-
"label.init-camera-pos-z": "相机位置(z)"
|
|
2
|
+
"component.urdf": "URDF",
|
|
3
|
+
"label.preset": "预设",
|
|
4
|
+
"label.url": "URL",
|
|
5
|
+
"label.up-axis": "上轴",
|
|
6
|
+
"label.unit-scale": "单位比例",
|
|
7
|
+
"label.auto-animate": "自动动画",
|
|
8
|
+
"label.physics": "物理",
|
|
9
|
+
"label.joints": "关节",
|
|
10
|
+
"label.waiting-for-urdf-load": "正在等待URDF加载…",
|
|
11
|
+
"label.reset-all": "全部重置"
|
|
18
12
|
}
|