RobotLocomotion / drake

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

[meshcat] Port StartMeshcat to Drake #16099

Closed RussTedrake closed 2 years ago

RussTedrake commented 3 years ago

@rpoyner-tri ... you probably recall the PR where you didn't want Meshcat in C++ to be able to advertise unconfirmed URLs. My work-around at that time was the StartMeshcat python method in manipulation:

https://github.com/RussTedrake/manipulation/blob/b6d32c075dd78d268580b098378ccdb008640ec0/manipulation/meshcat_cpp_utils.py#L27

As we start to encourage the use of Drake+Meshcat on deepnote/colab, this is missing functionality; not a good reason to add a dependency on the entire manipulation repo.

Do you have any objections to moving this (python-only) method to Drake? I believe it instantiates your previous recommendation, but want to confirm before I open the PR.

rpoyner-tri commented 3 years ago

Looks ok to me -- right abstraction level, and doesn't require any new dependencies that I can detect. I'm not sure where it should live, but no doubt @EricCousineau-TRI and @jwnimmer-tri will have ideas.

jwnimmer-tri commented 3 years ago

The goal would be to avoid depending on IPython from a core module like pydrake.geometry. Maybe something like from pydrake.geometry.jupyter import StartMeshcat?

EricCousineau-TRI commented 3 years ago

No objections here!

W.r.t. layout, pydrake.geometry.jupyter sounds good to parallel other cases (pydrake.common.jupyter). Two observations, though:

jwnimmer-tri commented 3 years ago

IPython should be present by default, given that we depend on meshcat-python?

We will soon be deprecating our dependency on meshcat-python.

RussTedrake commented 2 years ago

N.B. -- in #16273, I've removed any reference to IPython. In fact, it's not even specific to Jupyter; it could be run from a Deepnote terminal in a python script.