urdf-loader
Advanced tools
Comparing version 0.0.2 to 0.1.0
{ | ||
"name": "urdf-loader", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "URDF Loader for THREE.js and webcomponent viewer", | ||
"scripts": { | ||
@@ -12,5 +9,3 @@ "server": "cd .. && static-server", | ||
}, | ||
"license": "Apache-2.0", | ||
"repository": { | ||
@@ -20,9 +15,6 @@ "type": "git", | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/gkjohnson/urdf-loaders/issues" | ||
}, | ||
"homepage": "https://github.com/gkjohnson/urdf-loaders#readme", | ||
"keywords": [ | ||
@@ -37,7 +29,5 @@ "javascript", | ||
], | ||
"peerDependencies": { | ||
"three": "^0.89.0" | ||
}, | ||
"devDependencies": { | ||
@@ -44,0 +34,0 @@ "@webcomponents/webcomponentsjs": "^1.0.7", |
@@ -1,6 +0,6 @@ | ||
# javascript urdf-loader | ||
# javascript urdf-loader [![npm version](https://badge.fury.io/js/urdf-loader.svg)](https://www.npmjs.com/package/urdf-loader) | ||
[![npm version](https://badge.fury.io/js/urdf-loader.svg)](https://www.npmjs.com/package/urdf-loader) | ||
Utilities for loading URDF files into THREE.js and a Web Component that loads and renders the model. | ||
Utilities for loading URDF files into THREE.js and a Web Component that loads and renders the model | ||
[Demo here!](https://gkjohnson.github.io/urdf-loaders/javascript/example/index.bundle.html) | ||
@@ -23,3 +23,3 @@ ![Example](/javascript/docs/javascript-example.gif) | ||
### API | ||
#### URDFLoader.load(package, urdfpath, robotsCallback, geometryLoader) | ||
#### URDFLoader.load(package, urdfpath, robotsCallback, geometryLoader, fetchOptions) | ||
@@ -50,4 +50,10 @@ Loads and builds the specified URDF robot in THREE.js | ||
A optional function that can be used to override the default mesh loading functionality. The default loader is specified at `URDFLoader.defaultMeshLoader`. `doneCallback` is called with the mesh once the geometry has been loaded. | ||
An optional function that can be used to override the default mesh loading functionality. The default loader is specified at `URDFLoader.defaultMeshLoader`. `doneCallback` is called with the mesh once the geometry has been loaded. | ||
##### fetchOptions | ||
_optional_ | ||
An optional object with the set of options to pass to the `fetch` function call used to load the URDF file. | ||
## urdf-viewer Element | ||
@@ -54,0 +60,0 @@ ```html |
@@ -275,3 +275,4 @@ // urdf-viewer element | ||
}) | ||
}) | ||
}, | ||
{ mode: 'cors', credentials: 'same-origin' }) | ||
} | ||
@@ -278,0 +279,0 @@ } |
@@ -45,7 +45,7 @@ /* URDFLoader Class */ | ||
// cb: Callback that is passed the model once loaded | ||
static load(pkg, urdf, cb, loadMeshCb) { | ||
static load(pkg, urdf, cb, loadMeshCb, fetchOptions) { | ||
loadMeshCb = loadMeshCb || this.defaultMeshLoader | ||
const path = `${pkg}/${urdf}` | ||
fetch(path, { credentials:'include' }) | ||
fetch(path, fetchOptions) | ||
.then(res => res.text()) | ||
@@ -132,4 +132,4 @@ .then(data => this.loadStr(pkg, data, cb, loadMeshCb)) | ||
let child = null | ||
let xyz = null | ||
let rpy = null | ||
let xyz = [0, 0, 0] | ||
let rpy = [0, 0, 0] | ||
@@ -213,4 +213,4 @@ // Extract the attributes | ||
static _processVisualNode(pkg, vn, linkObj, loadMeshCb) { | ||
let xyz = null | ||
let rpy = null | ||
let xyz = [0, 0, 0] | ||
let rpy = [0, 0, 0] | ||
let mesh = null | ||
@@ -217,0 +217,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2482729
5789
135