-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: TreeViewer ZeroMQ interface #593
base: master
Are you sure you want to change the base?
Conversation
8c76f1a
to
3a378cc
Compare
src/python/director/treeviewer.py
Outdated
import zmq | ||
HAVE_ZMQ = True | ||
except ImportError: | ||
HAVE_MSGPACK_ZMQ = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be HAVE_ZMQ
?
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
apt
andbrew
, 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
-installedmsgpack
python librarypip
-installedumsgpack
python 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
.proto
file 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:
mainwindowapp
drake-visualizer
to 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-visualizer
app 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.