-
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
Supporting zeromq for drake-visualizer #586
Comments
I think
(note, this class was only in spartan, but I just merged a PR to add it to director/master) The tricky part with threads in Director is that the Qt C++ event loop has control, not the Python runtime. The python thread starts but has limited opportunities to get scheduled, so your thread will be sluggish. The other problem is that interacting with C++ objects (like the vtk visualization window) is best done exclusively from the main python thread. The Sample (written for python3):
|
This is perfect, thanks! I'll try it out today. |
Cool, it works! I'm getting some warnings when I try to actually create geometry from the taskrunner thread, though:
Is that to be expected, given what you mentioned about interacting with vtk from the python main thread? The geometry does show up correctly, despite the warnings. My implementation is here: https://github.com/RobotLocomotion/director/compare/master...rdeits:treeviewer-zmq?expand=1 |
Wow, this is already amazing. Using ZeroMQ with MsgPack + |
You could ignore the warnings, but i think they are correctly identifying potential issues where your thread is interacting with objects owned by the main thread. You thread and the main thread aren't running concurrently due to the way Python schedules things, but it could still be a problem. If you want to avoid issues like this, a good strategy is to use your thread just for zeromq blocking IO, but do all the message processing on the main thread. The
|
btw, i fixed the cdash issue for director's travis-ci, so now travis-ci passes and uploads binaries to bintray again. if you need binaries with https://bintray.com/patmarion/director/director/0.1.0-266-g071a233#files |
Got it, thanks! |
Ok, I've nearly got it all working properly. One issue I noticed is that sending a large number of draw commands bogs down and eventually crashes the whole Director app. I've traced it down to the fact that Removing the call to |
I am not able to repeat this issue, but I think I must have some issues with the implementation of callOnMain(), it's implemented in a more complicated way than it should be (using another class I wrote called I am going to recommend that you implement it without using In that pattern, there are no timers starting and stopping, just one timer that is started once. |
can you try this diff:
if you are building from source, don't forget to run make again after modifying the python source |
Thanks! Both of your suggestions fixed the issue. I think I like the pattern from #586 (comment) a bit better, so I'll probably go with that. |
I'm still using
drake-visualizer
(in RemoteTreeViewer mode) as my visualizer daily, and it's great, but I'm finding more and more that I'm running into issues trying to visualize meshes or pointclouds that are too large for LCM. We could try to fix LCM to enable message chunking, but since the tree viewer is already using its own message encoding, it's really not getting any benefit from LCM at all. @patmarion I know we talked about using ZMQ in the past, and I think being able to use tcp or ipc would probably resolve the issues I'm having with LCM+udp. As I recall, the issue was needing to spawn a new event loop to handle the ZMQ requests, since thethreading
python module doesn't work in Director. Is that still the case?How would I go about making this happen?
The text was updated successfully, but these errors were encountered: