-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Prebuilt drake-visualizer fails to load obj/mtl files #6333
Comments
/cc @jwnimmer-tri, @jamiesnape |
@jamiesnape are you the right person to shepherd this through a fix? If not, please reassign (back to me is OK). |
(The work-around for now is to manually launch a |
To clarify, this is the issue with @jwnimmer-tri Yes, just trying to work out the best plan of action. We will need to talk to VTK, I think. |
Yes. |
The background is that a fork of VTK's |
I guess I'm no longer as sure what's exactly wrong. This is my current work-around, which indicates it might not be the MTL problem in fact?
Maybe some automatic DAE->OBJ heuristic got lost? |
Ah. From case DrakeShapes::MESH: {
...
if (mesh.uri_.find("package://") == 0) {
geometry_data.string_data = mesh.uri_;
} else {
geometry_data.string_data = mesh.resolved_filename_;
} I suspect the problem is that because Director and Drake no longer share a superbuild, the |
@jwnimmer-tri, that seems like a separate issue from the OBJ/MTL issue, no? |
Yes, though (from my quick testing) it is the only reason why Jon's example in the first post doesn't work; the automotive demo's problem does not appear to be related to the VTK5 OBJ importer stuff. |
This is the package map logic in the drakevisualizer.py side of things: https://github.com/RobotLocomotion/director/blob/master/src/python/director/drakevisualizer.py#L184 I think you might find that the prius loading works because drake has a |
@stonier asked me to take a quick look at this since it is holding us up at the moment. I ran the demo briefly, and I saw the following output:
(I shortened the backtrace for brevity). From that, I surmised that the problem was that the visualizer frontend was failing in the very first resolvePackageFilename(), which happens to be the prius.dae. The parts that we can see (the chassis floor, wheels, hubs, etc) are instantiated before that. Thus, it seemed to me to be a PYTHONPATH problem. Indeed, if I make automotive_demo.py have a dependency on |
Does the demo need the dependency or the |
@jamiesnape Good point. Let me try out just the visualizer target. |
(You may need to add the location to the PYTHONPATH in the wrapper scripts.) |
Why should the prebuilt version of |
No, I don't think so. |
when https://github.com/RobotLocomotion/director/blob/master/src/python/director/drakevisualizer.py#L185 This code could be refactored if we deem it unnecessary to call |
To be honest, I'm not 100% sure what "prebuilt" means in this context. I just updated drake to the latest as of an hour ago, built, and then saw the problem. Does that use the prebuilt visualizer, or build it as part of the build process? |
It uses the prebuilt. |
@patmarion Yeah, I was thinking the same thing. Possibly there should be a try block there so that if |
When that code was added, the expectation was that drake-visualizer was installed in the same location as the pydrake module, so failure to import pydrake should be a hard fail. If the bazel build lays out an installation such that there is no guarantee that pydrake can be imported, then i agree it makes sense to put a try/except around the import. I think without the call to |
My intuition is that it would be both more reliable and less compile time (fewer dependencies) for the |
... but if for some reason keeping |
Sounds good to me. In some scenarios drake-visualizer is launched without the wrapper (like in cmake builds such as spartan) but those builds can successfully import pydrake, and also spartan has an environment file that all users source so we can set paths there, too. Would you like to assign someone the task of opening a director PR to add a try/except around the |
My goal was to be sure I understood what was happening, which I now do; thanks! (I didn't realize that it was intentional for the drake-visualizer binary release to runtime load pydrake from elsewhere in order to bootstrap paths, but it makes sense now.) I am OK with @clalancette deciding whether to fix Drake's BUILD rules to make |
In order to get us unstuck for now, I'll probably open PR fixing the BUILD rules (or following @jamiesnape 's advice and fixing the PYTHONPATH in the drake_visualizer_*.sh). If you think we should also make the change to director, I'm happy to do that as well. |
If the first PR (fixing the BUILD rules) ends up being robust, then I think it's enough. If people later tire of waiting for all of Drake to rebuild anytime they want to launch the visualizer, then we can prune the |
#6259 has apparently broken AutomotiveSimulator's ability to render cars and RoadGeometries correctly within DrakeVisualizer. This has been verified on both Trusty and Xenial.
When running out-of-box simulations such as
bazel run //drake/automotive:demo -- --num_dragway_lanes=3 --num_trajectory_car=12
, the following is what is visualized:For commits earlier than #6259, we have the following:
The text was updated successfully, but these errors were encountered: