From: Jonathan V T. <to...@ph...> - 2005-03-05 14:05:09
|
Chris, I had been having problems with passing None to the j.attach call in Windows. I am still having these problems, but found that if I test for None and instead pass ode.environment, the program functions as expected. I guess I should submit a bug report, but hopefully if anyone else is having this problem, they can find this post in the archives. -Vincent On Thu, 3 Mar 2005, Chris Bainbridge wrote: > On Wed, 2 Mar 2005 23:35:28 -0500 (EST), Jonathan V Toups > <to...@ph...> wrote: > > > > j.attach(geom1.getBody(),geom2.getBody()); > > > > Causes a nasty error. This is because if one of the Geom objects is an > > immovable object, getBody returns None. This behaviour is puzzling, since > > in Linux, I am clearly getting a body, perhaps where I shouldn't be. > > Are you sure? The behaviour under linux and windows should be > identical... it's the same code. getBody should return None. > > > So the question is, how do you handle adding contact joints to > > objects which do not have bodies? Or, how do you make an object with a > > body permanantly fixed in space? Or, am I doing something totally > > ridiculous? > > You can't add joints to geoms. You can only use joint constraints on > ODE bodies. You can fix a body in space by creating a fixedjoint with > the environment (pass 0 as the body arg). However, this is generally > advised against since it adds unnecessary constraints. The usual way > to get what your trying to do is to place the geom somewhere, and then > calculate contact joints. The contact joint should be attached to the > static environment. afaik, calling getBody should return None, and > your contact joint is created with that and a real body, so your code > should already work! > |