Git Product home page Git Product logo

gkjohnson / urdf-loaders Goto Github PK

View Code? Open in Web Editor NEW
440.0 18.0 112.0 12.7 MB

URDF Loaders for Unity and THREE.js with example ATHLETE URDF Files open sourced from NASA JPL

Home Page: https://gkjohnson.github.io/urdf-loaders/javascript/example/bundle/index.html

License: Apache License 2.0

JavaScript 66.55% HTML 1.99% C# 28.89% CSS 2.56%
unity javascript threejs graphics robotics urdf urdf-models webcomponents nasa robots

urdf-loaders's Introduction

urdf-loaders

URDF loading code in both C# for Unity and Javascript for THREE.js, as well as example JPL ATHLETE URDF files

Demo Here!

Example

Flipped Models

The _flipped variants of the URDF ATHLETE models invert the revolute joint axes to model ATHLETE in a configuration with the legs attached to the bottom of the chassis.

LICENSE

The software is available under the Apache V2.0 license.

Copyright © 2020 California Institute of Technology. ALL RIGHTS RESERVED. United States Government Sponsorship Acknowledged. Neither the name of Caltech nor its operating division, the Jet Propulsion Laboratory, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

urdf-loaders's People

Contributors

amosbyon1224 avatar artificial-jon avatar bezineb5 avatar chamango90 avatar dependabot[bot] avatar ezrabrooks avatar gkjohnson avatar harmanpa avatar jaykay135 avatar jtbandes avatar lgtm-migrator avatar nikhilweee avatar noah-wardlow avatar one-for-all avatar pac48 avatar sidfernandezops avatar stevegolton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

urdf-loaders's Issues

Example prints error on drag and drop

Uncaught ReferenceError: animToggle is not defined
    at HTMLDocument.document.addEventListener.e (eval at module.exports (index.bundle.js:89), <anonymous>:156:5)

Rethink package API

Providing a string to replace package:// is technically incorrect by ROS standards. An option has been added to to provide a package map which could replace the currently functionality entirely. The URDF file should also not be loaded relative to the package path, either.

URDFLoader.js 0.2.0 Release TODO

Changes

  • URDFLoader is Instantiate-able
  • Add setValue field to update joint angles
  • Investigate joint inversion
  • Fix rendering inefficiency in element
  • Mesh scale (#37)
  • Separate the example code for use in other repos

Rethink THREE.js URDF Robot API

  • Add documentation for URDFRobot and URDFJoint.

  • Consider adding the workingPath as an option to options argument instead of an argument to parse. It could be an argument for the load function, as well.

  • Consider removing the onComplete callback from parse

  • There's no reason the function should return an array of robots.

  • A simple "setJoint" function would be nice to have on the root object and it seems like there's no reason to add cruft on the child objects, so that can possibly be removed.

  • Make the model instantiate-able

  • Provide THREE.LoadingManager to override URL fetces

  • Rename "angles" to something more general and applicable to all joint types. "values", "configuration", "articulation", "state", etc. Multi-dimensional joints should store data as an array. Waiting for an example model that uses planar or floating joint types.

  • Remove the urdf field from joints and links and put all those fields directly on the THREE object. type would get changed to jointType to not conflict with Object3D.type

Loader does not reuse geometry instances

The loader will create multiple instances of the same geometry rather than reusing it. This can be complicated for some geometry formats, but possibly the default mesh callback can cache the geometry and clone it.

Update the API

The API for the Unity Parser is a little out of date compared to the THREE.js one. Would be good to update it to support other joints and attributes.

  • Rename URDFJointList to URDFRobot
  • Rename URDFParser to URDFLoader
  • Make an options struct to pass into the URDFLoader functions
  • Support multiple package definitions via Dictionary<string, string>

Update the Documentation

The documentation does not specify what the object format is for the robot or joints very well, or what functions are available to be called.

These should probably be pulled out into separate classes.

Related #14

No way to know when full model is finished loading

Primitives are loaded separately from meshes, so there's no way to preprocess them the way we do meshes, which means it's a bit difficult to add shadow-receiving and casting state to them. To make it worse they're added on the next frame after load. Overall it would be nice to fire a mess after the model has completed loading all models.

Add support for meshes that are distributed over multiple packages

One feature that I would require is to find the meshes for an URDF in more than one ROS package, for the case that the robot description is distributed over multiple packages.

My idea is to list the required packages in a .rosinstall file (example), parse this from the URDF loader and then replace the <mesh filename="package://..." /> with the respective link from the list.
I was thinking of the .rosinstall format because I want to link to github repositories (and not to local packages of the pc).

I suppose to implement this feature optionally, so one skip the mentioned list-file if only one package is required.

@gkjohnson What do you think of this feature?

Fix Example ATHLETE Models

Some of the original changes to the URDF models were incorrect. The T12 model was intended to have the legs attached to the top side while the other TriATHLETE models were intended to have the legs attached to the bottom.

  • Revert the changed T12 URDF model
  • Swap the lower and upper limits for the TriATHLETE models
  • Update the picture for the README

Create test model

That includes all joint types, geometry types, multiple packages, etc.

Fix the sliders in Edge

Edge does not display the joint sliders well, at the moment because styling range-inputs across browsers is inconsistent. Using something like paper-slider would be more cross platform.

image

TriATHLETE URDFs do not specify prismatic joint limits

Neither TriATHLETE URDF models specify joint limits for the prismatic TC${ i }A and TC${ i }B joints.

A limit of 0 to 0.065 seems to be reasonable for the TriATHLETE robot.

Additionally, the TriATHLETE Climbing URDF moves the same joints in the wrong direction. The axis will need to be updated.

Clean up the example

The example page has gotten a little long and could be pulled into separate files. The controls could be pulled into their own element / wrap the URDF element

Properly handle revolute joint limits

Both loaders assume -Infinity to Infinity min max limits if they're not specified at the moment, which is incorrect according to the spec -- they should both be 0 by default. However, changing that will break the loading of the TriATHLETE URDF files because they do not specify joint limits. The limits should be copied over from the T12 urdf file before the change.

Shared textures are not reused

Textures are always newly loaded when processing a link material, even if it is used and has already been loaded for another visual link node:

material.map = this._textureloader.load(filePath);

Should add a map of loaded textures for every load and / or add an override-able defaultTextureLoader function similar to defaultMeshLoader function so textures can be cached globally if needed.

STL Models are not fully loaded

The STL Loading doesn't seem to handle the full model for some reason. Here is the foot model as viewed in the THREE.STLLoader

image

And the tool clamp
image

But the foot looks like this in the viewer:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.