For doing simple simulations in Bullet with viz in ThreeJS, Collada is too complicated. It would be very useful to load URDF files for objects if possible.
Do you have a link to the URDF spec?
Ah, I should have included that, sorry: http://wiki.ros.org/urdf/XML And the package level description as well: http://wiki.ros.org/urdf
Thanks! We'll also need sample files.
I have been using this robot and this duck to create a rather strange animation of R2D2 chasing a rubber duck into infinity. Pretty fun! Would like to do it in ThreeJS.
I wonder if @yomboprime would like to give it a try.
It would follow the threejs_physics
he contributed.
And there is a port of Bullet called ammo.js
I have been playing with. Happy to try the other physics lib.
I'd like to, but I don't have time ATM for this project, sorry.
I would do a URDFLoader
which implements the parser and then implement a class for each physics engine. For example a AmmoURDFBuilder
to start, and so on.
Hey @buddha314!
I've been using URDF for visualization in THREE, as well, and have a repo with a URDF loader here:
https://github.com/gkjohnson/urdf-loaders/tree/master/javascript
It has primarily been tested with the features the robots I've worked with use (continuous, prismatic, revolute joints, mesh geometry) but I've been slowly adding more features into it. Here's a demo page! Some of the less advertised features there are that you can drag and drop folders with URDF models to visualize them and drag the joints around.
My use case has primarily been visualization but I'd be happy to work with you to add other features you might need for physics simulation to round it out! A couple things I noticed when testing your models:
0.0
, which the browser's xml parser does not like. They seem to work just fine if you change it to 1.0
.I've been writing an exporter for URDF models, as well, if that's of interest. Hope that's helpful!
Oh, this is cool! Just saw it and thanks!
Excellent Work! I just wish IK was included in your example @gkjohnson I hope somebody can help me get IK integrated to the library of that URDF loader. Can anyone please help me ?
Most helpful comment
Hey @buddha314!
I've been using URDF for visualization in THREE, as well, and have a repo with a URDF loader here:
https://github.com/gkjohnson/urdf-loaders/tree/master/javascript
It has primarily been tested with the features the robots I've worked with use (continuous, prismatic, revolute joints, mesh geometry) but I've been slowly adding more features into it. Here's a demo page! Some of the less advertised features there are that you can drag and drop folders with URDF models to visualize them and drag the joints around.
My use case has primarily been visualization but I'd be happy to work with you to add other features you might need for physics simulation to round it out! A couple things I noticed when testing your models:
0.0
, which the browser's xml parser does not like. They seem to work just fine if you change it to1.0
.I've been writing an exporter for URDF models, as well, if that's of interest. Hope that's helpful!