When using MakeHardwareStation(meshcat, hardware=True) , _MakeHardwareStationInterface(meshcat) completely ignores its meschat. However, a strong use-case when running real robot hardware is to run Meshcat and visualize robot positions.
It seems that a (partial) solution was previously implemented, but was commented out.
Solution
Philosophy: When the user passes a meshcat instance when running on real hardware, we assume that the user wants to visualize robot positions using this instance. In this case, the relevant systems are added to the station and wired appropriately (see below). When meshcat=None, these are not added.
[x] Un-commented the partial solution. The partial solution adds a SceneGraph, MultibodyPositionToGeometryPose and runs ApplyVisualizationConfig(). However, MultibodyPositionToGeometryPose is not wired.
[x] Wired output positions from IiwaStatusReceiver and/or SchunkWsgStatusReceiver to the MultibodyPositionToGeometryPose. This allows the user to successfully visualize the plant in Meshcat.
[x] Added a test to check that MakeHardwareStation(hardware=True) works with and without meshcat.
System diagrams
The following system diagrams were generated from manipulation/test/test_hardware_station_interface.py:
Problem
Slack thread: https://drakedevelopers.slack.com/archives/C2CK4CWE7/p1720146312718089
When using
MakeHardwareStation(meshcat, hardware=True)
,_MakeHardwareStationInterface(meshcat)
completely ignores its meschat. However, a strong use-case when running real robot hardware is to run Meshcat and visualize robot positions.It seems that a (partial) solution was previously implemented, but was commented out.
Solution
Philosophy: When the user passes a meshcat instance when running on real hardware, we assume that the user wants to visualize robot positions using this instance. In this case, the relevant systems are added to the station and wired appropriately (see below). When
meshcat=None
, these are not added.SceneGraph
,MultibodyPositionToGeometryPose
and runsApplyVisualizationConfig()
. However,MultibodyPositionToGeometryPose
is not wired.IiwaStatusReceiver
and/orSchunkWsgStatusReceiver
to theMultibodyPositionToGeometryPose
. This allows the user to successfully visualize the plant in Meshcat.MakeHardwareStation(hardware=True)
works with and without meshcat.System diagrams
The following system diagrams were generated from
manipulation/test/test_hardware_station_interface.py
:This change is