-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate URDF XML Parsing #172
Comments
I'm interested in helping with this since I'd like to use the URDF loader with Worldview (https://webviz.io/worldview/) instead of three.js. I noticed that three.js math types such as Vector3 and Quaternion are used during loading, what would you recommend in place of those for removing the three.js dependency from the core loader? |
Hello @jhurliman! If the parser is going to be restructured to separate some of the parser logic I think I'd like to see a {
namedMaterials: [ /* material data ... */ ],
links: [ /* link data ... */ ],
joints: [ /* joint data ... */ ],
// ... etc
} And the current URDFLoader can be split into two files: // src/base/URDFLoaderBase.js
class URDFLoaderBase {
load( url ) {
/* ... */
}
// returns parsed URDF XML as javascript object
parse( xmlOrString ) {
/* ... */
}
}
// src/three/URDFLoader.js
class URDFLoader extends URDFLoaderBase {
parse( ...args ) {
const urdfData = super.parse( ...args );
/* ... generate three.js URDFRobot, etc */
}
} See the 3DTilesRendererJS B3DMLoaderBase and three.js-specific B3DMLoader for a rough model of how I'm imagining this being structured. To that end I don't think any math functions will be required in the base parser and will just be required for engine-specific implementations which is probably for the best so we can keep the dependency list low. With that approach I don't believe the result of the current URDFLoader should have to change and it should make it easier to produce other engine-specific urdf model loader implementations. Let me know how that sounds to you! |
Separate the URDF XML parsing to provide a clean, fully defaulted json representation of the URDF data so it can be used to implement loaders in other engines including Babylon.js. The structure from the 3DTilesRenderer could be reused -- ie a
base
andthree
folder to denote reusable and platform/engine-specific code.Related to #168.
The text was updated successfully, but these errors were encountered: