Skip to content

Commit

Permalink
[geometry] Establishes Meshcat in C++ (step 2)
Browse files Browse the repository at this point in the history
Adds test coverage, and therefore moves Meshcat out of dev.

Per discussion with jwnimmer-tri, the strategy here is to provide a reasonable coverage of the c++ code (CI runs most all of the code and verifies it doesn't segfault).

I explored more elaborate testing mechanisms (documented in #13038) using nodejs.  This could add value downstream, but adding nodejs support to bazel might be a big upfront (and even maintenance) cost for relatively small gain.  As jwnimmer-tri points out, we don't provide that level of coverage for DrakeVisualizer.
  • Loading branch information
RussTedrake committed Aug 19, 2021
1 parent f3067b1 commit cbfcc30
Show file tree
Hide file tree
Showing 13 changed files with 464 additions and 249 deletions.
45 changes: 45 additions & 0 deletions geometry/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

load(
"@drake//tools/skylark:drake_cc.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"drake_py_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])
Expand All @@ -30,6 +35,7 @@ drake_cc_package_library(
":geometry_version",
":internal_frame",
":internal_geometry",
":meshcat",
":proximity_engine",
":proximity_properties",
":rgba",
Expand Down Expand Up @@ -336,6 +342,45 @@ drake_cc_library(
],
)

drake_cc_library(
name = "meshcat",
srcs = ["meshcat.cc"],
hdrs = ["meshcat.h"],
data = [
"//doc:favicon",
"@meshcat//:dist/index.html",
"@meshcat//:dist/main.min.js",
],
deps = [
"//common:essential",
"//common:find_resource",
"//common:unused",
"@msgpack",
"@uwebsockets",
],
)

drake_cc_binary(
name = "meshcat_manual_test",
testonly = True,
srcs = ["test/meshcat_manual_test.cc"],
visibility = ["//visibility:private"],
deps = [":meshcat"],
)

drake_py_binary(
name = "meshcat_websocket_client",
testonly = True,
srcs = ["test/meshcat_websocket_client.py"],
visibility = ["//visibility:private"],
)

drake_cc_googletest(
name = "meshcat_test",
data = [":meshcat_websocket_client"],
deps = [":meshcat"],
)

# -----------------------------------------------------

filegroup(
Expand Down
36 changes: 0 additions & 36 deletions geometry/dev/BUILD.bazel

This file was deleted.

178 changes: 0 additions & 178 deletions geometry/dev/meshcat.cc

This file was deleted.

32 changes: 0 additions & 32 deletions geometry/dev/meshcat_demo.cc

This file was deleted.

Loading

0 comments on commit cbfcc30

Please sign in to comment.