From: <al...@ci...> - 2010-03-28 16:32:48
|
Hello, I found the problem, see the attached file. Somewhere in the code, there is a line: # create a list to store any ODE bodies which are not part of the ragdoll (this # is needed to avoid Python garbage collecting these bodies) bodies = [] A similar code snippet is needed for geoms, too. That's why I added the following: geoms = [] And after creating every geom, I have added it to that list. That solved the problem. "bodies" and "geoms" are not used anywhere in the code. They just say to Python's garbage collector: I'm using these objects, do not delete them. When there are no more references to a body or a geom, PyODE removes those objects from ODE simulation automatically. That happened into your code: bodies were still present in simulation (that's why the doll was falling), but all the geoms (floors and capsules) were deleted. Is the ragdoll example the one from http://monsterden.net/software/ragdoll-pyode-tutorial ? I think it would be nice to include it in the PyODE examples folder. Alex > Hello Alex, > > Thanks for your note and recommendations. I have answed them one by one, > next to your questions: > > Kadir > > 2010/3/27 <al...@ci...> > >> Hello, >> >> First thing you should check: >> Do the examples from C:\Python26\pyode-examples run correctly? >> >> >>> Tutorial 1 runs OK, with the same numerical output >>>> Tutorial 2 runs OK with same double pendulum swinging >>>> Tutorial 3 runs with the same problem I had with new installation of > PyODE. Boxes falling down, penetrating the floor (plane). > > >> tutorial3.py has an example with a GeomPlane some falling boxes and >> spheres. >> Does it run correctly? >> > >>>> Tutorial 3 runs with the same problem I had with new installation of > PyODE. Boxes falling down, penetrating the floor (plane). > > >> I have just tested it with a fresh install of Python 2.6, PyOpenGL 3.0.1 >> and >> PyODE-snapshot-2010-03-22.win32-py2.6.exe. >> It worked from the first try. >> >> Which version of ODE do you use on Python 2.5? It seems that different ODE >> versions behave slightly differently >> with the same scene description. >> >> >>>> I believe PyODE 1.2.0, which was installed using > PyODE-1.2.0.win32-py2.5.exe. > > >> Do you use PyODE directly from your program or do you have some higher >> level >> library, like cgkit? >> In the second case, please check that it uses the same stepping method >> (step or >> quickStep) in both Py25 and 26. >> >> >>>> I use it directly. I use Vpython for visualisation. > > >> Can you send me a small test program, with the floor and one body, which >> works >> in Py25 and not in 26? >> > >>>>> I am attaching one famous RagDoll I have been using with PyODE. It is > supposed to fall and lie down on the floor. > Although I know nothing about robotics, I am trying to get this RagDoll up > and walking. > > I have visited your robot site. I have downloaded the windows version of > your robot and ran it on my laptop. I liked it very much. I tried to > implement a similar kinematic robot arm earlier, I had some coordination > problems, then I was planning to migrate it to ODE as a dynamic arm. I use > VPython for visualization, not OpenGL since VPython is very easy to use. > >> >> I am also using PyODE in a simulation which involves bodies sitting, and >> sometimes falling, on the ground. >> When the gravity, body mass or vertical speed were too high, they could >> break >> the floor and fall down. >> So you may start debugging with reducing the gravity value. >> >> >>> I set g = -0.81, same behaviour, slow-motion. > > It looks like a collision detection problem but where? Any double Precision > / SÝngle Precision issue? > > >> However, the simulation runs exactly the same in Py25 and 26, with exactly >> the >> same code. I do not use >> PyODE directly, but all the rendering and simulation is done using cgkit. >> I'm >> using boxes and trimeshes, >> and sometimes spheres for debugging. >> >> The program in which I use PyODE is a robot arm simulator, still in early >> stages >> of development, available here: >> http://github.com/alexdu/robot-sandbox . For now, it only runs on Windows >> out of >> the box (unzip and run). >> >> > Hi again, >> > >> > I have installed Python 2.6.4 and tried to install PyODE on top. I have >> > downloaded the >> > PyODE-snapshot-2010-03-22.win32-py2.6.exe< >> http://sourceforge.net/projects/pyode/files/pyode/snapshot-2010-03-22/PyODE-snapshot-2010-03-22.win32-py2.6.exe/download >> >from >> > the sourceforge and somehow got it working :)) >> > >> > But now funny things are happening. It looks like the GeomPlane is not >> > functioning correctly, so that everything falls down forever. My "floor" >> has >> > gone. The same exact code works OK in Python25, in 2.6, the rest seems OK >> > for the moment (At least gravity is there, joints are working, bodies are >> > working OK), but the floor is gone!? >> > >> > Is it a collision detection problem, although for the remaining parts it >> > seems to work ok. Bodies are mostly CappedCylinders (plus some spheres). >> > >> >>From Idle, I can see ode.GeomPlane is in there, but somehow it is not >> > working OK. >> > >> > I will check with some other programs, or simple geometries. >> > >> > Thnaks for your work and support. >> > >> > Kadir >> > >> > 2010/3/23 Ethan Glasser-Camp <gl...@cs...> >> > >> >> al...@ci... wrote: >> >> > I have tried to create a binary Win32 installer for latest PyODE >> >> snapshot. >> >> > I am sure Kadir and others will find it useful. >> >> >> >> This is awesome, thanks! >> >> >> >> I have uploaded this, as well as tarballs taken from today's git, to the >> >> files section of the sourceforge project: >> >> >> >> https://sourceforge.net/projects/pyode/files/ >> >> >> >> I've elected to use a snapshot-ymd system, since at present the project >> >> doesn't have "features" that are added in any regular fashion. >> >> >> >> I also updated the project website with the git URL and links to the >> >> most current files. >> >> >> >> > Since I'm a beginner in creating Python packages, I have two small >> >> issues: >> >> > >> >> > 1. The installer copies "ode.dll" to c:\python25. Is this a problem? >> >> > I believe it should be copied into "site-packages" instead, but I did >> not >> >> know >> >> > how to >> >> > specify this in setup.py. >> >> >> >> No idea here, sorry.. >> >> >> >> > 2. The examples are copied into c:\python25\pyode-examples. Is there a >> >> better >> >> > choice? >> >> >> >> I wouldn't include them at all, frankly. >> >> >> >> > 3. When installing the binary package to a fresh Python directory, >> >> tutorials 1 >> >> > and 3 >> >> > work fine; the others need pygame and maybe cgkit. Is there a way to >> >> specify >> >> > these dependencies in the binary installer? >> >> >> >> I think it's fine to leave these out -- not all people who use ODE are >> >> going to want to use it with Pygame. >> >> >> >> > I have added examples and ode.dll as "data_files" in setup.py. I would >> >> also like to >> >> > see the setup.py which created the releases from >> >> pyode.sourceforge.net(1.2.0). >> >> >> >> I would guess that the setup.py in the source tree is the one they used, >> >> but I have no idea. >> >> >> >> Ethan >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> Download Intel® Parallel Studio Eval >> >> Try the new software tools for yourself. Speed compiling, find bugs >> >> proactively, and fine-tune applications for parallel performance. >> >> See why Intel Parallel Studio got high marks during beta. >> >> http://p.sf.net/sfu/intel-sw-dev >> >> _______________________________________________ >> >> Pyode-user mailing list >> >> Pyo...@li... >> >> https://lists.sourceforge.net/lists/listinfo/pyode-user >> >> >> > >> >> > |