RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.35k stars 1.27k forks source link

MeshcatPointCloudVisualizer in meldis #18333

Closed jwnimmer-tri closed 1 year ago

jwnimmer-tri commented 2 years ago

For backwards compatibility with show_point_cloud from drake_visualizer, we should have meldis listen for point-cloud LCM messages and display them.

We already have a class MeshcatPointCloudVisualizer to publish point clouds into Meshcat. We just need to wire it up.

jwnimmer-tri commented 2 years ago

\CC @siyuanfeng-tri @EricCousineau-TRI FYI

zachfang commented 1 year ago

I will start looking into this as the next Drake Adoption task.

zachfang commented 1 year ago

From reading through different components, this is my understanding of how to resolve this issue.

We already have MeshcatPointCloudVisualizer for the regular Meshcat visualization and the LeafSystem PointCloudToLcm to convert Pointcloud to LCM messages when using Meldis.

meldis listen for point-cloud LCM messages and display them.

The only code change needed is in _meldis.py to subscribe to the type of LCM message and the handler function for displaying, plus unit testing.

jwnimmer-tri commented 1 year ago

Yes, in short the only new function we need is to convert a lcmt_point_cloud message into a pydrake PointCloud object.

Then to visualize that point cloud object in Meshcat, we can either use a MeshcatPointCloudVisualizer or possibly just call into Meshcat->SetObject(path, cloud) directly.