-
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
drake_visualizer as provided by bazel is not able to find/visualize resources using package:// #6834
Comments
N.B. - one way that this has worked in the past is that the drake-visualizer component could replace the |
drake-visualizer looks at Most users don't have the In the cmake build, |
See also #5584 and #6333 (comment). |
drake-visualizer has two methods for finding drake resources:
For 2., it works in cmake builds but does not currently work in bazel. I think @fbudin69500 has proposed a fix and opened a PR: One thing I don't understand, this feature should be covered by drake's python tests, right here: |
The reason First, that unit test declares a dependency Second, There are several ways to put all the pieces together to make this work, but first we need to decide the full list of use cases we want to support, and second we need to add regression tests under CI that show what is (or isn't) working. |
Great. I agree. Let's isolate the requested use cases and put CI coverage on them. I think fundamental to this is the question of how we instruct users to launch the drake-visualizer. My example above was launching the app directly from So I think supporting |
The first part of your problem is that Director assumes that folder name is the same as package name -- it doesn't open the Edit: Fixed in PR #6981. (I have more direct reply to the prior post in draft form; stay tuned.) |
Assuming the --- a/tools/install_data.bzl
+++ b/tools/install_data.bzl
@@ -33,6 +33,8 @@ def install_data(
"urdf",
"xml",
"dae",
+ "vtp",
+ "vtm",
]
exclude_patterns = ["**/test/*", "**/test*"]
prod_models_include = ["**/*.{}".format(x) for x in models_extensions] Because those files were missing, Director was falling back to using (I have more direct reply to the grand-prior post in draft form; stay tuned.) Edit: Fixed in PR #6919. |
And finally, getting back to the questions ...
I certainly agree that the fully-self-launching automotive demo is not the only way, and that we should also support the use case of a long-lived visualizer process. Indeed, https://github.com/RobotLocomotion/drake/blob/master/drake/automotive/README.md#running-the-dynamics says to run the visualizer exactly as the top post in the issue -- from In an terms of making the Valkyrie visualization work easily, out of the box -- don't confuse the self-contained automotive demo approach with whether or not model files are compiled in. Assuming the prior two defects are fixed, then the following patch compiles the Valkyrie data into the visualizer, such that the commands in your top post work again: --- a/tools/BUILD
+++ b/tools/BUILD
@@ -25,18 +25,19 @@
sh_binary(
name = "drake_visualizer",
srcs = select({
"//tools:apple": ["drake_visualizer_apple.sh"],
"//conditions:default": ["drake_visualizer_linux.sh"],
}),
data = [
"//drake/bindings:pydrake",
+ "//drake/examples/valkyrie:prod_models",
"@director",
],
) In short, if you want the visualizer to have a-priori knowledge of certain packages, just list them! |
Relatedly, instead of asking users to run This mode of interaction would be more similar to what downstream users would be doing (when Drake is a library), and would transfer more smoothly to users consuming a binary release where they would necessarily be running from the install tree. |
Thanks for tracking down this bug! Fixed by RobotLocomotion/director#546 |
woohoo! Thanks for all the bug fixes @jwnimmer-tri ! (and apologies for the ones that I introduced with the name changes; my search was for examples/Valkyrie, etc which missed package://Valkyrie). |
Re: how to launch / install drake-visualizer. I don't think it's tenable to have users list all of their resources at installation time for the drake-visualizer. downstream users will have their own robot directory, with it's own resources, but will be using the precompiled visualizer provided by drake. or they may even have a runtime load of a new urdf, with its new resources. Is the plan for those cases to fall back to ROS_PACKAGE_PATH? |
I noticed this during the review and assumed it was on purpose, to keep compatibility with other pieces of the ecosystem. I thought package names were a bit of a "commons", where everyone agrees to use the same package name for the same thing? In any case, that belief was only from anecdotal evidence, so I'm happy to be overridden. |
Sure. I only meant that we should install the Drake-hosted packages by default (we already do) in a way our installed version of
I think that can happen however Director wants it to happen; I have no strong opinion. I think |
I agree that is how they are supposed to be used. But since director (and drake before it) only support ROS_PACKAGE_PATH by directory structure, and since I don't think anybody is relying on downstream use of the packages in drake master right now, i think I should probably change them (and package.xml) to match the directory structure. @avalenzu , @patmarion , @manuelli , @rdeits , @tkoolen -- any thoughts? |
I'm fine with using ROS_PACKAGE_PATH (or DRAKE_PACKAGE_PATH) to find package based on the directory structure and presence of package.xml. Some other options:
It would be easy enough to add those mechanisms to the I think if you decide to use on ROS_PACKAGE_PATH or other environment variables then you might want a consistent environment setup across users. Similar to how your source a |
Ah good question; I hadn't considered that. However, looking at it now, Drake already opens the |
I don't feel like I understand this well enough to have an opinion, sorry. But I do think that it should be possible for a user to, e.g., create a new urdf inside the examples folder and then load and visualize that urdf immediately without any compilation (e.g. by loading it in pydrake). As far as I can tell, that implies that urdf and package resolution cannot depend on having direct data dependencies declared in the build system. |
I am in a similar situation to Robin, I don't understand all the nuances here but the use case he outlined should definitely be supported. If I put my own urdf somewhere then director should be able to load it at run time in some consistent manner. Also I usually use director via a custom app, i.e. |
@jwnimmer-tri changing BUILD and install_data.bzl don't seem to fix the problem for me, but perhaps I should wait until a pull request that fixes this is submitted? |
…alization (#6981) fixed valkyrie robot simulation test to that it works in Director
To the best of my knowledge, the software is working now. What remains is to add appropriate regression testing. I have self-assigned in order to take care of that follow-up, likely just by opening new issue(s). |
Regression coverage filed under #7050. |
example:
results in the visualizer spewing, e.g.
users have known that this is an issue and have been replacing
package://
statements in urdf files with relative paths (as demonstrated in the iiwa examples). that's not sufficient. we simply must support thepackage://
logic that used in essentially every urdf/sdf file.@jwnimmer-tri pointed to #6685 as related. is that the proposed fix? this is a specific and high priority problem, so I think it warrants a separate issue to track it.
cc @siyuanfeng-tri @TristanThrush @patmarion
The text was updated successfully, but these errors were encountered: