RFC: TreeViewer ZeroMQ interface#593
Conversation
8c76f1a to
3a378cc
Compare
| import zmq | ||
| HAVE_ZMQ = True | ||
| except ImportError: | ||
| HAVE_MSGPACK_ZMQ = False |
|
very cool. I am fine with adding zeromq as an optional dependency, no problem. I can't have it as a required dependency, but I don't think you are proposing that. I am fine with adding the pip install zmq command to the You can add the pip install command for ubuntu and mac in this file (or apt/brew, whatever you think makes the most sense): https://github.com/RobotLocomotion/director/blob/master/distro/travis/install_deps.sh |
|
let me know how you'd like to proceed on this PR. are you planning any more changes before code review? i think with the dependencies installed this could pass the travis-ci tests. |
|
I think this is in pretty good shape, but I got myself sidetracked trying to support textures and then ended up writing a whole new viewer in Three.js so I can have fancy 3D models in my Jupyter notebooks. I'll update the deps on Travis and let you know when it's ready. |
82a2de5 to
8fadd5d
Compare
|
Okay, CI is passing and I'm reasonably convinced that this is a positive change, regardless of what develops with the new Three.js visualizer. |
Fixes #586
This is a first draft of a ZeroMQ interface for the RemoteTreeViewer in
drake-visualizer. The advantages of the new interface are:The new ZeroMQ interface is so much better than the LCM protocol was that I'm probably going to deprecate the LCM Tree Viewer entirely. That will mean that the Tree Viewer can be run just from the default Director build (assuming users have the ZeroMQ and MsgPack Python libraries installed). That also frees DrakeVisualizer.jl from needing to build or supply LCM, which will make my life easier.
The major downside is that I'm introducing two new dependencies: ZeroMQ and MsgPack. Both dependencies are runtime-only (they just need to be importable from python, and only if you're trying to use the new interface) and both are available from
aptandbrew, so I'm not terribly concerned, but I'm still always wary of creating new dependencies in a project. The ZeroMQ dependency is going to be hard to get around, but MsgPack is actually pretty lightweight so we have some options:pip-installedmsgpackpython librarypip-installedumsgpackpython library, which has the advantage of being pure-pythonumsgpack(which is a single 1000 line Python file and MIT-licensed) inside Director (what I'm doing now)@patmarion any opinions? I'm personally leaning towards option (3), since it means only one external dependency (zeromq). ProtoBuf has a lot of potential, since the
.protofile would nicely document the interface, but I've found it surprisingly annoying to actually work with.@gizatt if you have any thoughts about things you'd like to see in the interface, I'd be happy to make changes.
Also cc @tkoolen and @dehann since this will (at least indirectly) affect you. DrakeVisualizer.jl should continue to "just work" for the most part, but with benefits to reliability and performance, especially when rendering meshes.
Internal Changes
I also made some internal changes while I was working on this:
mainwindowappdrake-visualizerto not steal focus when launching (I often launch it while running other code and end up typing into the visualizer window when it steals focus)TODOs:
drake-visualizerapp remotely, and they all use different protocols, dependencies, and flags. That seems like far too many. I'm planning on only using the new TreeViewer ZMQ protocol, and I've talked to @gizatt about upgrading Spartan to use that too. Drake still uses the DrakeVisualizer LCM protocol, and there's no active plan to change that. But I think we can easily get rid of TreeViewer LCM at the very least.