-
Notifications
You must be signed in to change notification settings - Fork 10
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
Switch to using MeshCat.MeshFileGeometry and MechanismGeometries.MeshFile. #32
Conversation
I tried this with https://github.com/tkoolen/universal-robot-dae-jl. For |
Hm, interesting. Does anything show up in the browser's console when you try to load the bad meshes? I can also look into this after work tonight. |
Chrome on Linux seems to give a more helpful error message:
|
So I guess the issue is here: |
Oh, wow, good catch. Hmm, I'm not sure what the right way to hand this is--general mesh loading is weirdly complicated precisely because each file tries to be an entire scene rather than just a single geometry. I think I just need to adjust the loader in meshcat to try to add all of the geometries in the file. |
Yeah, that sounds good. Most likely all the lamps and cameras left in the |
Oh man, this is compilcated. I think I need to re-think the way mesh files are handled--it's currently assumed internally that each mesh file produces some kind of three.js Geometry, but a .DAE file is really more like its own entire scene, which we'd need to represent as a three.js Group. A Group is an Object (a class containing its own geometries and materials), not a Geometry in three.js-land, so this will take some doing. A related question is: what exactly do we do with the materials inside a mesh file? It seems reasonable to provide an STL mesh geometry and a separate material specification, but a DAE file includes all of its material specifications internally. Should we let a user provide a material in that case? And what object would we apply that material to? I think the most sensible answer is probably to change Then, this gets even more complicated because OBJ files store their material as a reference to an |
Ok, with meshcat-dev/meshcat#51 and this PR and all its friends, the UR10 now loads properly: It looks a little goofy, though, because the DAE files include their own light sources for no apparent reason. We can either handle that by stripping them out in meshcat (on the javascript side), or just declare that we're doing the right thing and the mesh itself is silly. |
whoops, still need a tag for MechanismGeometries 0.4.0: JuliaRegistries/General#1966 |
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
+ Coverage 96.69% 96.72% +0.02%
==========================================
Files 5 5
Lines 121 122 +1
==========================================
+ Hits 117 118 +1
Misses 4 4
Continue to review full report at Codecov.
|
OK, build is passing. I'm going to quickly merge and tag a new version, since the latest release is now incompatible with the new MechanismGeometries version. |
Hmm, so with the new versions of everything I tried the UR10 again (https://github.com/tkoolen/universal-robot-dae-jl), and ran into #32 (comment) again. We're currently creating But the changes to those lines in meshcat-dev/meshcat#51 are not present in master. Should we be creating |
With https://github.com/JuliaRobotics/MeshCatMechanisms.jl/compare/tk/meshfileobject-hack?expand=1, I the And I was under the impression that the idea was to use |
I think we should just do the latter (as we are currently). I do wonder why you got the right link-relative poses in #32 (comment) but I didn't in #32 (comment). |
Maybe it has to do with https://github.com/rdeits/meshcat/pull/51/files#diff-1fdf421c05c1140f6d71444ea2b27638R687? |
#32 (comment) is fixed by meshcat-dev/meshcat#58. |
On top of #31.
Part of the plan from rdeits/MeshCat.jl#92 (comment). Ref JuliaRobotics/MechanismGeometries.jl#17.
Requires version tags for MeshCat, ValkyrieRobot, and MechanismGeometries.
Seems to be working though!
It does seem to be a lower-poly model than before though... Is there a way we can control that?
Also turned some really long short-form functions into long-form functions to improve readability; sorry, should have split that out.