Skip to content
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

[render_vtk] Add gflag for show_window #20143

Merged

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Sep 7, 2023

It's nice to be able to debug show_window without rebuilding. This came up during #19945.

+@SeanCurtis-TRI for both reviews, please.


This change is Reviewable

@jwnimmer-tri jwnimmer-tri added priority: backlog status: single reviewer ok https://drake.mit.edu/reviewable.html release notes: none This pull request should not be mentioned in the release notes labels Sep 7, 2023
Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been contemplating doing this for a while. :LGTM: for what it is.

However, as I spend a fair amount of time in this code, I'll tell you a couple of other things I frequently toggle when I toggle this:

  1. I tend to put a sleep statement so that the image stays open for a while. I'd recommend a flag with some default value that only is engaged if a show_foo is true but allow the user to tweak it to suit their workflow.
  2. I frequently find that I only want to show the rgb image and not the label image. So, I frequently create a custom label_camera which is distinct from the color_camera in that show_window is hard-coded to false. (I can also imagine simply making them distinct flags show_rgb and show_label.)

Both of those impact the Render() method. If that was a bit garbled, I can push a commit and you can decide what you think. Let me know.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Second thought...I'd do the same thing in the internal_render_engine_gl_test.cc for parity.)

Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: CI. I believe if you rebase this PR, the CI failure will go away.

Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)

@jwnimmer-tri
Copy link
Collaborator Author

I've added the render_gl flag as well.

Thanks for the info on sleeping, but I'm not going to do it in this PR. At minimum, the user could set a breakpoint on what they want and the window would stay open. Also maybe_pause_for_user.h seems more appropriate than sleeping.

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. maybe_pause_for_user.h is probably a better solution.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)

@jwnimmer-tri
Copy link
Collaborator Author

Looks like the change actually did cause the unit test to be more fussy on macOS arm64. I'll add that test case to the skip-list as well.

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That test is removed from the list in master. I don't think this PR is based on the most recent master.

Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is to say, I thought it was. I have a branch that has it and I think I had my wires crossed.

Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)

@jwnimmer-tri
Copy link
Collaborator Author

jwnimmer-tri commented Sep 7, 2023

Jenkins always merges PRs up to the tip of master before running any builds.

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.. Dur.

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: labeled "do not merge" (waiting on @jwnimmer-tri)

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now it's the MultiLights test.

Reviewable status: labeled "do not merge" (waiting on @jwnimmer-tri)

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This is probably making your argument that they should all be excluded by default and tests have to be explicitly included.)

Reviewable status: labeled "do not merge" (waiting on @jwnimmer-tri)

It's nice to be able to debug show_window without rebuilding.

Adjust the vtk unit test rule for macOS tests to opt-in instead of opt-out.
While pushing this commit through CI, we saw even more spurious failures.
Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I've swapped it to opt-in now.

-(status: do not merge)

Reviewable status: labeled "do not merge" (waiting on @jwnimmer-tri)

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)

@SeanCurtis-TRI SeanCurtis-TRI merged commit 7669bdf into RobotLocomotion:master Sep 8, 2023
1 check passed
@jwnimmer-tri jwnimmer-tri deleted the vtk-test-show-window branch September 8, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: backlog release notes: none This pull request should not be mentioned in the release notes status: single reviewer ok https://drake.mit.edu/reviewable.html
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants