Problems with pydy-viz

26 views
Skip to first unread message

James Crist

unread,
Mar 10, 2015, 6:40:26 PM3/10/15
to Jason Moore, py...@googlegroups.com
I'm giving a guest lecture tomorrow on using Python for dynamics and robotics applications. Trying out the Viz stuff for the first time, and I can't get it to work. The docs for it are virtually non-existant (unfortunately), and I'm not sure if there's something I'm doing wrong. Here's the deal:

1. scene.display_ipython() runs the scene, but I think I'm looking from a poor orientation. I see a single point moving around. As best as I can figure, the original orientation is on the Z axis, looking down. I tried redefining the camera, but now I see nothing.

2. I seem to remember from last summer that the viewpoint was movable with a click-and-drag? That's not working for me now, I can only click the buttons, and nothing else.

3. The parameter boxes are really narrow vertically, but the text in them is big (and thus unreadable). I've attached a screenshot. (boxes.png)

4. Looking in firebug, i'm seeing javascript errors. I have no idea what I'm looking for though, so I can't really debug... Here's the two error messages that I was able to see (there may be more):

- Sizzle is not defined
- target.is is not a function

5. After closing the scene, my ipython session still runs, but the web page is unresponsive. I have to close that tab, and reopen the notebook. The python session is still running, so I can continue from where I left off, but this doesn't seem right.

Based on the above, I'm pretty sure the issue is missing javascript libraries? However, with the default camera I at least see a ball moving around (but not all of the joints, due to a perspective issue?). So things are partially working.

Can anyone help me debug this quickly? I'm giving this presentation tomorrow, and would really like to show off the visualizer.

- Jim
pydy_talk_demo.ipynb
boxes.png

Jason Moore

unread,
Mar 10, 2015, 6:49:56 PM3/10/15
to James Crist, py...@googlegroups.com
I would recommend using the last release of PyDy instead of master. Tarun left master in a somewhat broken state with the GSoC pr merges. There could be more than you want to tackle.

Jason Moore

unread,
Mar 10, 2015, 6:52:34 PM3/10/15
to James Crist, py...@googlegroups.com
Also master likely only works with Ipython >= 3.0.

Jason Moore

unread,
Mar 10, 2015, 7:08:52 PM3/10/15
to James Crist, py...@googlegroups.com
I looks like it is getting further for me with IPython 3.0. I'll post my changes soon. But there are some new errors associated with IPython's changes in 3.0. I'm not sure how deep they go.

I tried to make these issues clear when Tarun was merging his GSoC last year, but this is a classic case of not being attentive to keeping the head of master in a working state. Part of it was that Tarun's work required a dev version of IPython...

James Crist

unread,
Mar 10, 2015, 7:37:31 PM3/10/15
to Jason Moore, py...@googlegroups.com
I just tried it with IPython 3.0, and got an error on the call to display_ipython:

AttributeError: 'ContainerWidget' object has no attribute 'set_css'

I just need this to work for tomorrow afternoon. Is there a branch/tag/commit that I should be working from? With IPython 2.something?

Jason Moore

unread,
Mar 10, 2015, 7:39:35 PM3/10/15
to py...@googlegroups.com
I changed all of those and things run but the mouse controls for the 3d window do not work for me.

I'm not sure what is going on there. That is a JS issue.

Jason Moore

unread,
Mar 10, 2015, 7:43:53 PM3/10/15
to py...@googlegroups.com
The view controls work if you use scene.display(), but they are not working in the notebook. This must be some other change in ipython 3 since Tarun was using it.

Jason Moore

unread,
Mar 10, 2015, 7:48:58 PM3/10/15
to py...@googlegroups.com
I take that back. Anytime you load a scene json file, the view controls seem to freeze.

James Crist

unread,
Mar 10, 2015, 7:50:33 PM3/10/15
to py...@googlegroups.com
Could you send me a diff/push to github those fixes? I can use `scene.display()` tomorrow for the presentation, I just want to show the visualizer.

When I tried scene.display() earlier, I had to open the webpage, and type in the json file manually. Is this normal? Or is this also something that was broken?

Jason Moore

unread,
Mar 10, 2015, 7:57:02 PM3/10/15
to py...@googlegroups.com
scene.display() shouldn't require typing in the json file manually. I don't think it used to do that.

--
You received this message because you are subscribed to the Google Groups "PyDy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydy+uns...@googlegroups.com.
To post to this group, send email to py...@googlegroups.com.
Visit this group at http://groups.google.com/group/pydy.
For more options, visit https://groups.google.com/d/optout.

Jason Moore

unread,
Mar 10, 2015, 8:03:24 PM3/10/15
to py...@googlegroups.com
The easiest way to get this working could be to look at which date Tarun submitted his final GSoC PR's, then checkout an IPython development commit near that date. It should work then.

TARUN GABA

unread,
Mar 11, 2015, 12:18:03 AM3/11/15
to py...@googlegroups.com

seems that ipython changes have started breaking off code. I will look into it today. Jim, how much time do we have before your presentation?
I would really want to get it working before that.

James Crist

unread,
Mar 11, 2015, 1:39:24 AM3/11/15
to py...@googlegroups.com
Presentation is 13 hours from now (1:30 Central time). If you can figure out how to fix the master branch to work with IPython 3.0 (or 2.4), that would be great. It's midnight here, when I wake up tomorrow I'll start debugging, but if we can't figure anything out soon, I'll try to find whatever IPython dev-state you had working with the current master. I just need to get a demo to work.

- Jim

You received this message because you are subscribed to a topic in the Google Groups "PyDy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pydy/xtd0u7OaSZY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pydy+uns...@googlegroups.com.

Sahil Shekhawat

unread,
Mar 11, 2015, 1:53:04 AM3/11/15
to py...@googlegroups.com

Can I help?

Jason Moore

unread,
Mar 11, 2015, 1:57:53 AM3/11/15
to py...@googlegroups.com
Yes, anyone can help. A start of a fix is here: https://github.com/pydy/pydy/pull/143 and an issue with more info here: https://github.com/pydy/pydy/issues/142.

Sahil Shekhawat

unread,
Mar 11, 2015, 2:20:54 AM3/11/15
to py...@googlegroups.com

I am working on it,  will raise a PR soon

James Crist

unread,
Mar 11, 2015, 11:02:03 AM3/11/15
to py...@googlegroups.com

Using IPython commit 4581d8b93c42014c0c232ac5de169dad053ea809, from Aug 12 2014, everything looks great *except* the visualization is empty. I cannot scroll around either, so I can't tell if it's an orientation problem or a visualization problem. I've attached a screenshot.

@Tarun: what browsers did you test this with? I'm using Firefox.

- Jim
Selection_002.png

James Crist

unread,
Mar 11, 2015, 11:34:59 AM3/11/15
to py...@googlegroups.com
Ok, that was me just being silly, and forgetting to add the frames. Now I see my shapes, but from above. I also cannot rotate the camera. If I can just get the camera to look from a good angle initially, everything will be fine. The docs on this are sparse at best, any help?

TARUN GABA

unread,
Mar 11, 2015, 12:10:43 PM3/11/15
to py...@googlegroups.com
The camera position is by default corresponding to the origin and inertial reference frame of the system. You can override the default camera by creating a new PerspectiveCamera, and giving it as a keyword arg to Scene. If you could provide the code snippets for the relevant portion, it would be really helpful.

Also I am available on gitter for some time now., so that we can fix it realtime. :)

James Crist

unread,
Mar 11, 2015, 12:22:58 PM3/11/15
to py...@googlegroups.com
Current notebook attached. If you don't have python control installed, just run up to the first sys.integrate call, then skip to the viz stuff.
old_talk.ipynb

Jason Moore

unread,
Mar 11, 2015, 2:10:51 PM3/11/15
to py...@googlegroups.com
Jim,

I did some fixes here: http://nbviewer.ipython.org/gist/moorepants/aab1a1c6b49f51718a90 yesterday. Including removing the dependency on python-control.
Reply all
Reply to author
Forward
0 new messages