From: Paul K. <pki...@in...> - 2005-08-03 09:45:37
|
Hi I've been using PyODE and run up against some issues. 1) Initially I was using version 0.35 - which was running fine in the python environment I'm using (which is part of a 3d app - which has a Python22 interface). However I needed Trimeshes, so moved to version 1.1, which does not work in the python environment, due to the environment not defining True and False. Is there a way I can define True and False before calling the ode methods? I tried setting ode.True = 1 in my python app, however that didn't work. 2) The obvious solution to 1) is to recompile PyODE, changing the True/Falses to 1/0's. However, when I recompile, it is compiling within including the ODE library (ie. It is requiring the ODE.DLL be present in the python\lib\site-packages directory. Also, the resulting pyd doesn't work correctly. For example, recompiling PyODE0.35 results in my Y cords being given as a result of body.getPosition. And recompiling 1.1 results in collision detection failing. So, can anyone give me a hint as to how to recompile PyODE to include the ODE.LIB in the pyd (ie. So it doesn't need to call ODE.DLL). 3) I have some static objects in my scene. To keep them in place, I am attaching those objects to ode.environment with a FixedJoint. The objects are rotated (prior to the SetFixed call), however after a call to world.step, body.setRotation returns an identity matrix (so the are "un-rotating"). Thanks for any help you may be able to give. |
From: Paul K. <pki...@in...> - 2005-08-04 06:49:33
|
OK, some notes for Windows users wanting to recompile PyODE. You will need a C compiler installed on your system. I use VC6. 1) Download ODE source. If you are using MSVC, open the ODE workspace, and in the Project Settings for ODE, change "Use run-time library" to Multithreaded (from Multithreaded DLL). Also with MSVC, copy the appropriate config from the the _configs directory into the include\ode directory (and rename that file to config.h). Compile. 2) Install Pyrex (I'm using version 0.9.3). I installed it under the same main directory as ODE and PyODE. 3) Unzip the PyODE into a directory. Edit the setup.py file in that directory and point ODE_BASE to you ODE directory (ie."..\ODE-0.5") 4) Because for some reason Python .py file will not run from a DOS cmd line on my system, I also changed the "cmd = " line in setup.py to: cmd = "\"\Program Files\Python22\python\" ..\pyrex-0.9.3\pyrexc.py -o ode.c -I. -Isrc src/ode.pyx" 5) Now go to DOS, and get to the PyODE directory. Type: "\program files\python22\python" setup.py install Interestingly, the recompiled pyd (PyODE1.1 and 1.0) crashes after about 30 collisions on my system (under a non-standard python installation). It works fine running on Python22 or Python23. So there is some bug tripping up my non-standard python install that is getting through the standard version. The recompiled 0.35 works fine on my non-standard python install. So I've ported across the trimesh code from 1.1 into 0.35. |
From: Chris M. <ch...@mc...> - 2005-08-04 08:52:45
|
On Thu, Aug 04, 2005 at 04:19:02PM +0930, Paul Kinnane wrote: > OK, some notes for Windows users wanting to recompile PyODE. You will > need a C compiler installed on your system. Heheheh. :) Chris. ------------------- ch...@mc... http://mccormick.cx |
From: Matthias B. <ba...@ir...> - 2005-08-04 14:27:38
|
Paul Kinnane wrote: > 1) Download ODE source. If you are using MSVC, open the ODE > workspace, and in the Project Settings for ODE, change “Use run-time > library” to Multithreaded (from Multithreaded DLL). Also with MSVC, > copy the appropriate config from the the _configs directory into the > include\ode directory (and rename that file to config.h). Compile. Or alternatively, download one of the the ODE binaries. That's what's used in the official PyODE Windows binaries. :) > 4) Because for some reason Python .py file will not run from a DOS > cmd line on my system, I also changed the “cmd = “ line in setup.py to: > cmd = "\"\Program Files\Python22\python\" > ..\pyrex-0.9.3\pyrexc.py -o ode.c -I. -Isrc src/ode.pyx" The Python installer doesn't modify the PATH variable, so you have to do that yourself (I recommend to add both paths, the Python root and the Scripts directory). Then the above shouldn't be necessary anymore. You might also want to add the .py suffix to the PATHEXT environment variable so that you can invoke Python scripts without the .py extension. - Matthias - |
From: Paul K. <pki...@in...> - 2011-05-17 11:42:03
|
Hi I have been a very long time user of PyODE, using an ODE.PYD version compiled against Win32 Python 2.2 and 2.4. Unfortunately I now need to recompile (some 7 years later) for Python 2.4 64 bit and Python 2.7 32 and 64 bit. I am having trouble compiling for both version of python. For python 2.4 64 bit, it seems I need an old version of Visual Studio - long longer available. Does anyone know a workaround for this? I'm also struggling to compile PyODE for Python 2.7 using Vis Studio 2008. I compile ODE in Vis Studio ok, but then the pyode build gives link errors such as: (dReal) LIBCMT.lib(crtheap.obj) : error LNK2005: __malloc_crt already defined in MSVCRT. lib(MSVCR90.dll) LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.l ib(MSVCR90.dll) LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT. lib(MSVCR90.dll) LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSV CR90.dll) LIBCMT.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRT.lib(MS VCR90.dll) LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib( cinitexe.obj) LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib( cinitexe.obj) LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib( cinitexe.obj) LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib( cinitexe.obj) LIBCMT.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already defined in MS VCRT.lib(MSVCR90.dll) LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MS VCRT.lib(MSVCR90.dll) LIBCMT.lib(tidtable.obj) : error LNK2005: __encoded_null already defined in MSVC RT.lib(MSVCR90.dll) LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MS VCRT.lib(MSVCR90.dll) LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRT.lib(MS VCR90.dll) LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRT.lib(MSVC R90.dll) Creating library build\temp.win32-2.7\Release\ode.lib and object build\temp.w in32-2.7\Release\ode.exp LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; us e /NODEFAULTLIB:library LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; us e /NODEFAULTLIB:library LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main reference d in function ___tmainCRTStartup build\lib.win32-2.7\ode.pyd : fatal error LNK1120: 1 unresolved externals error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 Does anyone have any advice pls? Thanks in advance. Paul |
From: Matthias B. <ba...@ir...> - 2005-08-04 14:07:22
|
Paul Kinnane wrote: > 1) Initially I was using version 0.35 – which was running fine in the > python environment I’m using (which is part of a 3d app – which has a > Python22 interface). However I needed Trimeshes, so moved to version > 1.1, which does not work in the python environment, due to the > environment not defining True and False. Is there a way I can define > True and False before calling the ode methods? I tried setting ode.True > = 1 in my python app, however that didn’t work. Please try the following: ode.__builtins__.True = 1 ode.__builtins__.False = 0 > 2) The obvious solution to 1) is to recompile PyODE, changing the > True/Falses to 1/0’s. However, when I recompile, it is compiling within > including the ODE library (ie. It is requiring the ODE.DLL be present in > the python\lib\site-packages directory. You have to link against the static ODE lib. If you're using the ODE binaries then you have make sure to use one of the zip files that don't have the "-dll-" in their name. If you're compiling it yourself you have to make sure to compile a static library and link against this one instead of the import library for the dll. > Also, the resulting pyd doesn’t > work correctly. For example, recompiling PyODE0.35 results in my Y > cords being given as a result of body.getPosition. I'm not sure if I understand what you mean here.... has it something to do with mixing up the single and double version of ODE? > 3) I have some static objects in my scene. To keep them in place, I am > attaching those objects to ode.environment with a FixedJoint. The > objects are rotated (prior to the SetFixed call), however after a call > to world.step, body.setRotation returns an identity matrix (so the are > “un-rotating”). When did you attach the joints? It seems to work over here: from ode import * w = World() b = Body(w) # Set some rotation other than the identity... b.setRotation([0,-1,0, 1,0,0, 0,0,1]) print b.getRotation() # Attach the body to the environment... j = FixedJoint(w) j.attach(b, None) j.setFixed() # Do some simulation steps... for i in range(100): w.step(0.04) # See if the orientation has changed... print b.getRotation() For me, this program prints the same orientation twice. Cheers, - Matthias - |
From: Paul K. <pki...@in...> - 2005-08-04 23:06:23
|
Thanks Matthias > ode.__builtins__.True = 1 > ode.__builtins__.False = 0 Defining ode.__builtins__.True and ode.__builtins__.False worked! Thanks. However....the simulation stops/crashes when there is a collision. My recompiled version 0.35 doesn't have this problem. To clarify, version 1.0 and 1.1 of PyODE do NOT crash on a standard Phython22 or 23 environment when there is a collision detected. However it does crash on the non-standard python22 implementation that the 3d app uses. A recompiled PyODE0.35 works fine under the non-standard 3d app python environment. The crash is happening in call to contactgroup.empty() after a collision has been detected. It even happens with the code from tutorial3 (when I run that python script in my 3d app). Given the code for contactgroup.empty() and for destroying joint is identical between PyODE 0.35 and 1.1, I'm at a loss to explain it! The only area I can see that is significantly different is the joint.attach() method. > You have to link against the static ODE lib. If you're using the ODE > binaries then you have make sure to use one of the zip files that don't > have the "-dll-" in their name. Of course - you are right - I downloaded the DLL version by mistake. > I'm not sure if I understand what you mean here.... has it something to > do with mixing up the single and double version of ODE? I've since fixed this problem. It was due to having ode.pyd calling the ode.dll rather than linking in the ode library. > When did you attach the joints? > It seems to work over here: Thanks. I got around the problem by simply not having bodies attached to the geom. Paul -----Original Message----- From: pyo...@li... [mailto:pyo...@li...] On Behalf Of Matthias Baas Sent: Thursday, 4 August 2005 11:38 PM To: pyo...@li... Subject: Re: [Pyode-user] Compiling PyODE Paul Kinnane wrote: > 1) Initially I was using version 0.35 - which was running fine in the > python environment I'm using (which is part of a 3d app - which has a > Python22 interface). However I needed Trimeshes, so moved to version > 1.1, which does not work in the python environment, due to the > environment not defining True and False. Is there a way I can define > True and False before calling the ode methods? I tried setting ode.True > = 1 in my python app, however that didn't work. Please try the following: ode.__builtins__.True = 1 ode.__builtins__.False = 0 > 2) The obvious solution to 1) is to recompile PyODE, changing the > True/Falses to 1/0's. However, when I recompile, it is compiling within > including the ODE library (ie. It is requiring the ODE.DLL be present in > the python\lib\site-packages directory. You have to link against the static ODE lib. If you're using the ODE binaries then you have make sure to use one of the zip files that don't have the "-dll-" in their name. If you're compiling it yourself you have to make sure to compile a static library and link against this one instead of the import library for the dll. > Also, the resulting pyd doesn't > work correctly. For example, recompiling PyODE0.35 results in my Y > cords being given as a result of body.getPosition. I'm not sure if I understand what you mean here.... has it something to do with mixing up the single and double version of ODE? > 3) I have some static objects in my scene. To keep them in place, I am > attaching those objects to ode.environment with a FixedJoint. The > objects are rotated (prior to the SetFixed call), however after a call > to world.step, body.setRotation returns an identity matrix (so the are > "un-rotating"). When did you attach the joints? It seems to work over here: from ode import * w = World() b = Body(w) # Set some rotation other than the identity... b.setRotation([0,-1,0, 1,0,0, 0,0,1]) print b.getRotation() # Attach the body to the environment... j = FixedJoint(w) j.attach(b, None) j.setFixed() # Do some simulation steps... for i in range(100): w.step(0.04) # See if the orientation has changed... print b.getRotation() For me, this program prints the same orientation twice. Cheers, - Matthias - ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Pyode-user mailing list Pyo...@li... https://lists.sourceforge.net/lists/listinfo/pyode-user |