Skip to content

Commit

Permalink
wip: these are why we need to gc-ify DrakeLcmInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoyner-tri committed Nov 8, 2024
1 parent cf9d5a0 commit c65d58d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions bindings/pydrake/geometry/test/visualizers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def by_hand(builder, scene_graph, params):
visualizer.query_object_input_port())

def auto_connect_to_system(builder, scene_graph, params):
# XXX lcm annotations??
mut.DrakeVisualizer_[T].AddToBuilder(builder=builder,
scene_graph=scene_graph,
lcm=lcm, params=params)
Expand Down
2 changes: 1 addition & 1 deletion bindings/pydrake/lcm_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PYBIND11_MODULE(lcm, m) {
{
using Class = DrakeLcmInterface;
constexpr auto& cls_doc = doc.DrakeLcmInterface;
py::class_<Class>(m, "DrakeLcmInterface", py::dynamic_attr(), cls_doc.doc)
py::class_<Class>(m, "DrakeLcmInterface", cls_doc.doc)
.def("get_lcm_url", &DrakeLcmInterface::get_lcm_url,
cls_doc.get_lcm_url.doc)
.def(
Expand Down
1 change: 1 addition & 0 deletions bindings/pydrake/multibody/test/plant_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3095,6 +3095,7 @@ def test_connect_contact_results(self):
[{}, {"publish_period": None}, {"publish_period": 1.0/32}]):
kwargs = collections.ChainMap(*optional_args)
with self.subTest(num_optional_args=len(kwargs), **kwargs):
# XXX lcm annotations??
publisher = ConnectContactResultsToDrakeVisualizer(
builder=builder, plant=plant, scene_graph=scene_graph,
**kwargs)
Expand Down
1 change: 1 addition & 0 deletions bindings/pydrake/systems/test/sensors_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def test_camera_config(self):
plant, scene_graph = AddMultibodyPlantSceneGraph(builder, 0.0)
system_count = len(builder.GetSystems())
lcm = DrakeLcm()
# XXX lcm annotations??
mut.ApplyCameraConfig(config=config, plant=plant, builder=builder,
scene_graph=scene_graph, lcm=lcm)
# Systems have been added.
Expand Down
5 changes: 5 additions & 0 deletions bindings/pydrake/visualization/test/meldis_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def _make_diagram(self, *, resource, visualizer_params, lcm):
parser = Parser(plant=plant)
parser.AddModels(url=f"package://{resource}")
plant.Finalize()
# XXX lcm annotations??
DrakeVisualizer.AddToBuilder(builder=builder, scene_graph=scene_graph,
params=visualizer_params, lcm=lcm)
diagram = builder.Build()
Expand Down Expand Up @@ -458,6 +459,7 @@ def test_viewer_applet_alpha_slider(self):
</sdf>
""", "sdf")
plant.Finalize()
# XXX lcm annotations??
DrakeVisualizer.AddToBuilder(builder=builder, scene_graph=scene_graph,
params=DrakeVisualizerParams(), lcm=lcm)
diagram = builder.Build()
Expand Down Expand Up @@ -516,6 +518,7 @@ def test_viewer_applet_in_memory_mesh(self):
scene_graph.AssignRole(plant.get_source_id(), g_id,
IllustrationProperties())
lcm = dut._lcm
# XXX lcm annotations??
DrakeVisualizer.AddToBuilder(builder=builder, scene_graph=scene_graph,
params=DrakeVisualizerParams(), lcm=lcm)
plant.Finalize()
Expand Down Expand Up @@ -589,6 +592,7 @@ def test_contact_applet_point_pair(self):
name="sphere2_x", frame_on_parent=plant.world_body().body_frame(),
frame_on_child=body2.body_frame(), axis=[1, 0, 0]))
plant.Finalize()
# XXX lcm annotations??
ConnectContactResultsToDrakeVisualizer(
builder=builder, plant=plant, scene_graph=scene_graph, lcm=lcm)
diagram = builder.Build()
Expand Down Expand Up @@ -632,6 +636,7 @@ def test_contact_applet_hydroelastic(self):
name="body2", frame_on_parent=plant.world_body().body_frame(),
frame_on_child=body2.body_frame(), axis=[1, 0, 0]))
plant.Finalize()
# XXX lcm annotations??
ConnectContactResultsToDrakeVisualizer(
builder=builder, plant=plant, scene_graph=scene_graph, lcm=lcm)
diagram = builder.Build()
Expand Down

0 comments on commit c65d58d

Please sign in to comment.