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

[viz] Use inlined byte array for heatmap png; remove VTK as dep #307

Merged

Conversation

EricCousineau-TRI
Copy link
Collaborator

@EricCousineau-TRI EricCousineau-TRI commented Oct 27, 2023

As mentioned in #305


This change is Reviewable

Copy link
Collaborator Author

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

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

+@jwnimmer-tri Would you be up for review?
\cc @kunimatsu-tri @calderpg-tri @IanTheEngineer

Reviewable status: 0 of 7 files reviewed, all discussions resolved (waiting on @jwnimmer-tri)

Copy link
Contributor

@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.

Reviewable status: 0 of 7 files reviewed, 2 unresolved discussions (waiting on @EricCousineau-TRI)

a discussion (no related file):
The need for VTK in drake_ros is extremely minimal. The code only uses it to encode a constant RGB array into constant PNG bytes.

The simpler fix would be to put the PNG data into a constexpr char kHeapmapPng[] = ... and purge VTK entirely. Within the next release or two of Drake, we will have a PNG-to-memory writer public API, so you could revert to back using that pattern if you don't like the constexpr long-term.



.github/workflows/bazelized_drake_ros.yml line 57 at r1 (raw file):

        # but can't download the archive with bazel until we have the dependencies installed
        # so bazel_ros2_rules can inspect it.
        run: sudo apt-get install -y libconsole-bridge-dev libvtk9-dev

So this is adding the package to CI. How are users of drake-ros supposed to know that they need this package?

This PR seems only to unwind the deprecation console warning, but not actually solve the more acute problem of a build failure for users.

Copy link
Collaborator Author

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 14 files reviewed, 2 unresolved discussions (waiting on @jwnimmer-tri)

a discussion (no related file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

The need for VTK in drake_ros is extremely minimal. The code only uses it to encode a constant RGB array into constant PNG bytes.

The simpler fix would be to put the PNG data into a constexpr char kHeapmapPng[] = ... and purge VTK entirely. Within the next release or two of Drake, we will have a PNG-to-memory writer public API, so you could revert to back using that pattern if you don't like the constexpr long-term.

Done.



.github/workflows/bazelized_drake_ros.yml line 57 at r1 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

So this is adding the package to CI. How are users of drake-ros supposed to know that they need this package?

This PR seems only to unwind the deprecation console warning, but not actually solve the more acute problem of a build failure for users.

See TODO above - we can't (easily) use rosdep for this CI setup because of the current usage of tarball.
For developers, rosdep should handle it, as mentioned here:

# Install required dependencies.
rosdep install --from-paths src -ryi

This is referenced by CONTRIBUTING.md.

(Moot now though)

@EricCousineau-TRI EricCousineau-TRI changed the title [drake_ros] Vendor in VTK 9 depdendency [viz] Use inlined byte array for heatmap png; remove VTK as dep Oct 27, 2023
Copy link
Contributor

@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.

:lgtm: it's so good.

Reviewed 14 of 14 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @EricCousineau-TRI)


drake_ros/viz/BUILD.bazel line 28 at r2 (raw file):

    hdrs = glob(
        ["*.h"],
        exclude = ["heamtap_png.raw.h"],

BTW If you make the *.inc change, this particular edit could disappear.


drake_ros/viz/contact_markers_system.cc line 91 at r2 (raw file):

std::vector<uint8_t> GenerateHeatmapPng() {
  return
#include "./heatmap_png.raw.h"

BTW In my experience, a more typical extension for this file would be *.inc as in #include "./heatmap_png.inc".

https://drake.mit.edu/styleguide/cppguide.html#Self_contained_Headers

Copy link
Collaborator Author

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

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

Reviewable status: 9 of 14 files reviewed, all discussions resolved (waiting on @jwnimmer-tri)


drake_ros/viz/BUILD.bazel line 28 at r2 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

BTW If you make the *.inc change, this particular edit could disappear.

Done, thanks!


drake_ros/viz/contact_markers_system.cc line 91 at r2 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

BTW In my experience, a more typical extension for this file would be *.inc as in #include "./heatmap_png.inc".

https://drake.mit.edu/styleguide/cppguide.html#Self_contained_Headers

Done

Copy link
Contributor

@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.

Reviewed 5 of 5 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @EricCousineau-TRI)

@EricCousineau-TRI
Copy link
Collaborator Author

CI failure not immediately clear, but assuming it's once again "out of disk space". Merging.

@EricCousineau-TRI EricCousineau-TRI merged commit dc2f2e4 into RobotLocomotion:main Oct 29, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants