Panda PhysX

Return to Panda Features in Development

Postby blenderkid » Sat Jul 17, 2010 11:00 am

So I should better use ODE instead of waiting for a linux 64bit version of physx? Or is there a approximate date of such a release?

blenderkid
blenderkid
 
Posts: 85
Joined: Sat Jun 20, 2009 4:15 am
Location: Germany

Postby enn0x » Sun Jul 18, 2010 2:11 pm

If the above instructions on how to compile Panda3d + PhysX in 64bit Linux won't help you: Yes, try using ODE. For any Linux releases of PhysX: I am not aware of any release dates posted by NVIDIA.
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby morgul » Mon Jul 19, 2010 5:12 pm

blenderkid wrote:So I should better use ODE instead of waiting for a linux 64bit version of physx? Or is there a approximate date of such a release?

blenderkid


You can follow this thread, if you would like to use PhysX: http://developer.nvidia.com/forums/index.php?showtopic=3853
Christopher S. Case
Skewed Aspect
http://dev.skewedaspect.com/projects/precursors
Image
User avatar
morgul
 
Posts: 38
Joined: Sun Dec 28, 2008 1:49 pm
Location: Lubbock, TX

Postby Executor » Mon Jul 26, 2010 4:28 am

Hay enn0x,

I'm trying to release() a PhysxCapsuleController but I'm getting an Assertion right when its being called.

Any ideas why?

BTW, this same code worked with the wrapper, I recently converted to 1.7.0 with the new Physx.
User avatar
Executor
 
Posts: 73
Joined: Tue Nov 25, 2008 6:10 am
Location: South Africa

Postby enn0x » Mon Jul 26, 2010 7:07 am

I need a few more infos. First, which assertion you get, and second what you are doing with the controller and maybe the atached actor on the Python side.
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby Executor » Mon Jul 26, 2010 7:34 am

Okay, here's the message:

Assertion failed: _error_type == ET_ok at line 73 of c:\panda3d-1.7.0\panda\src\physx\physxController.cxx
Assertion failed: (_flags & F_lock_count) != 0 at line 68 of c:\panda3d-1.7.0\built\include\mutexSimpleImpl.I


The first assertion shows up and a 'Close the program' dialogue appears. When I click on Close, the second assertion comes up.

I do have a task running which uses the controller, but I've checked that it gets removed with taskMgr.remove("taskname") just before releasing the controller.

I added the following to the character sample at the end of the setup() function and still got the same assertion when trying to reset:

Code: Select all
    self.accept('r', self.reset)

  def reset(self):
    self.cleanup()
    self.setup()

  def cleanup(self):
    self.controller.release()
User avatar
Executor
 
Posts: 73
Joined: Tue Nov 25, 2008 6:10 am
Location: South Africa

Postby enn0x » Mon Jul 26, 2010 3:53 pm

Okay, here's the message:

Quote:
Assertion failed: _error_type == ET_ok at line 73 of c:\panda3d-1.7.0\panda\src\physx\physxController.cxx
Assertion failed: (_flags & F_lock_count) != 0 at line 68 of c:\panda3d-1.7.0\built\include\mutexSimpleImpl.I


This helps a lot. Line 73 of file physxController.cxx is the first line of the method PhysxController.getActor(). This means that not the release() method fires the assert, but the getActor() method.

Seems like I call getActor() after destroying the controller pointer. I try to fix this until tomorrow. Thanks for reporting.
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby enn0x » Tue Jul 27, 2010 12:25 am

Fixed in current CVS.
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby enn0x » Thu Aug 05, 2010 8:28 am

Seems like NVIDIA is finally resurrecting the Linux ports of the PhysX SDK (32bit and 64bit). Beta versions of the SDK are already available if registering for Beta testing.
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby rdb » Thu Aug 05, 2010 11:00 am

Yay! That's very good news! I'll try them on the buildbots as soon as I get time.
rdb
 
Posts: 8549
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby enn0x » Fri Aug 06, 2010 7:15 am

I have not yet registered for beta testing, but will do so next week.

NVIDIA has announced a Mac SDK too, besides the Linux 32/64bit. I don't know what "closed beta" means, but there is no download so far. Maybe the Mac SDK won't be public, like Wii and XBox.

http://supportcenteronline.com/ics/support/default.asp?deptID=1949
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby GrizzLyCRO » Mon Sep 13, 2010 6:24 am

Could you makea guide on how to cook an object from blender to nxb? or maybe egg to nxb?

Oh nevermind, just found it.

it is in cook.py in samples
User avatar
GrizzLyCRO
 
Posts: 301
Joined: Tue Dec 16, 2008 4:03 pm
Location: Croatia

Postby enn0x » Tue Sep 14, 2010 1:25 am

Please pay attention to this line:
Code: Select all
for geomNP in modelNP.findAllMatches('**/+GeomNode'):

This means the script searches for ALL geom nodes, and feed them to one single triangle mesh. Depending on what your egg files look like this might be a bad idea. You might want to split it up into smaller chunks, or filter the geom nodes (geometry tagged as collision geom withing the egg file e.g.).
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby GrizzLyCRO » Tue Sep 14, 2010 6:09 am

Oh, thank you for info, i have some other things that i do not know how to handle, i have read most of this thread and not quite sure how to go about this..

1.A I want collision solids to follow bones(joints).
Mostly it would be tubes-spheres for character, eventually box (for weapons).
As far as i could gather this has to be done manually(panda task), would cython help with that?
With panda's internal collision system this is done automatically, just parent collision sollid to bone, and offset it as needed.
1.B Could you write some basic sample on how to do it?

2. Ragdolls, i would like character to be doll after he dies, and fall on ground a bit more realistically. From what i could tell, i have to release all animations, and that is not problem(i hope), but is there way to constrain joint's movement(angle mostly)?

3. Are you still interested in writing manual? I think more people would use physx if it has something about it in manual, it would look more official.
User avatar
GrizzLyCRO
 
Posts: 301
Joined: Tue Dec 16, 2008 4:03 pm
Location: Croatia

Postby enn0x » Tue Sep 14, 2010 1:51 pm

1.A
In your case it is not the physics engine which controls the movement of the objects, but the animations.
This is what I would try: create one PhysxActor for each bone, and give it a shape, for example a capsule or box. Make the actor kinematic. Each frame read the bone transform and set this transform on the kinematic actor. PhysxActor::moveGlobalPos/Mat/Hpr would be the right methods for setting the transforms. You might have to disable collisions between the "bone" actors.

1.B
No, sorry, see 3.

2.
Ragdoll is the inverse situation. Here not the animation/bone controls the physics object, but the physics object controls the bones. You will have to completely reorganize the way your player is setup. Perhaps it is best to discard it and setup a new object.
I suggest having one actor per bone again, but this time not kinematic but dynamic, and the bone NP has to be attached to the dynamic (physx) actor. I think you have to expose the (panda actor) joints in order to be able to control then individually. Finally you have to connect the (physx) actors with (physx) joints. PhysxSphericalJoint should work. It also might be good to set limits on how far the joints can swing or twist (setSwingLimit, setTwistLimitLow/High, setSwingSpring, setTwistSpring).

3.
Writing tutorials or manuals requires lots of time, and time is something I don't have currently. I have been working on a Bullet module similar to the PhysX module for the last few month, my wife is giving birth to our first child in less than two weeks, and I am trying to get together the right concepts for the next level of physics modules for Panda3D (more tight integration, smaller codebase, more easy to use, but also less freedom because of the smaller API). But I should stop lamenting and do some work again...
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby GrizzLyCRO » Tue Sep 14, 2010 1:58 pm

Thank you, and congratulations on baby :). Have a lots of fun with him/her!
User avatar
GrizzLyCRO
 
Posts: 301
Joined: Tue Dec 16, 2008 4:03 pm
Location: Croatia

Building with 64-bit PhysX

Postby whitelynx » Fri Oct 01, 2010 8:48 am

enn0x wrote:I have not yet registered for beta testing, but will do so next week.

NVIDIA has announced a Mac SDK too, besides the Linux 32/64bit. I don't know what "closed beta" means, but there is no download so far. Maybe the Mac SDK won't be public, like Wii and XBox.

http://supportcenteronline.com/ics/support/default.asp?deptID=1949


Morgul got into the beta, and we have all the beta SDK downloads; I'll PM you links. If anyone else in the thread wants to help out debugging this, PM me and I'll send you links as well.

Here's the instructions I've written for building Panda with support for 64-bit PhysX:

Code: Select all
= Panda3D + PhysX on 64-bit Linux =


== Building ==

To build Panda3D with PhysX support on 64-bit Linux, first you need to install the latest 64-bit Linux PhysX SDK. (currently only available through NVidia's beta tester program)


Next, apply the accompanying panda3d-physx-linux64.patch to the Panda3D source tree:

   patch -p 1 < ../panda3d-physx-linux64.patch   


Build using makepanda, setting one specific CFLAG externally:

   CFLAGS='-DNX64' makepanda/makepanda.py


Finally, install Panda3D:

   sudo python makepanda/installpanda.py



== Testing ==

You can then check to make sure the Panda3D PhysX library exists:

   ls /usr/local/lib64/panda3d/libpandaphysx.so


Then, run one of the PhysX samples to test it:

   ppython panda3d-physx-samples/01_Basics.py


And here's the accompanying patch:
Code: Select all
diff -r -u panda3d-cvs-original/makepanda/makepandacore.py panda3d-cvs/makepanda/makepandacore.py
--- panda3d-cvs-original/makepanda/makepandacore.py   2010-09-02 05:55:03.000000000 -0500
+++ panda3d-cvs/makepanda/makepandacore.py   2010-09-15 00:35:34.767806577 -0500
@@ -1478,7 +1478,7 @@
                 if folder.endswith("NVIDIA PhysX SDK\\%s\\SDKs\" % key):
                     SDK["PHYSX"] = folder
                     SDK["PHYSXVERSION"] = ver
-        elif (sys.platform.startswith("linux") and platform.architecture()[0] != "64bit"):
+        elif (sys.platform.startswith("linux")):
             incpath = "/usr/include/PhysX/%s/SDKs" % key
             libpath = "/usr/lib/PhysX/%s" % key
             if (os.path.isdir(incpath) and os.path.isdir(libpath)):


So far, I've gotten everything to the point where it builds and the normal samples all work, but I consistently get a segfault when running the PhysX samples:
Code: Select all
(gdb) r
Starting program: /usr/bin/ppython 01_Basics.py
[Thread debugging using libthread_db enabled]
DirectStart: Starting the game.
Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
[New Thread 0x7fffd9f50710 (LWP 9556)]
[New Thread 0x7fffd974f710 (LWP 9557)]
[New Thread 0x7fffd8f4e710 (LWP 9558)]
[Thread 0x7fffd974f710 (LWP 9557) exited]
[Thread 0x7fffd8f4e710 (LWP 9558) exited]
[New Thread 0x7fffd8f4e710 (LWP 9567)]
[New Thread 0x7fffd974f710 (LWP 9569)]
a[True]= 1
b[True] 1
c[True]= 1
d[True]= 1
e[True]= 1

Program received signal SIGSEGV, Segmentation fault.
0x00007fffd3a66267 in ?? () from /usr/lib/PhysX/v2.8.3/libPhysXCore.so
(gdb) bt full
#0  0x00007fffd3a66267 in ?? () from /usr/lib/PhysX/v2.8.3/libPhysXCore.so
No symbol table info available.
#1  0x00007fffd831d0d7 in PhysxScene::fetch_results() () from /usr/local/lib64/panda3d/libpandaphysx.so
No symbol table info available.
#2  0x00007fffd835a869 in Dtool_PhysxScene_fetch_results_1196(_object*, _object*, _object*) () from /usr/local/lib64/panda3d/libpandaphysx.so
No symbol table info available.
#3  0x00007ffff7b15bbf in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#4  0x00007ffff7b17570 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#5  0x00007ffff7aaa9cf in function_call () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#6  0x00007ffff7a83893 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#7  0x00007ffff7a9644f in instancemethod_call () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#8  0x00007ffff7a83893 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#9  0x00007ffff42fce3d in Thread::call_python_func(_object*, _object*) () from /usr/local/lib64/panda3d/libpanda.so
No symbol table info available.
#10 0x00007ffff4324b80 in PythonTask::do_python_task() () from /usr/local/lib64/panda3d/libpanda.so
No symbol table info available.
#11 0x00007ffff4319c8a in AsyncTask::unlock_and_do_task() () from /usr/local/lib64/panda3d/libpanda.so
No symbol table info available.
#12 0x00007ffff4326aa3 in AsyncTaskChain::service_one_task(AsyncTaskChain::AsyncTaskChainThread*) () from /usr/local/lib64/panda3d/libpanda.so
No symbol table info available.
#13 0x00007ffff432780d in AsyncTaskChain::do_poll() () from /usr/local/lib64/panda3d/libpanda.so
No symbol table info available.
#14 0x00007ffff4327989 in AsyncTaskManager::poll() () from /usr/local/lib64/panda3d/libpanda.so
No symbol table info available.
#15 0x00007ffff433a219 in Dtool_AsyncTaskManager_poll_121(_object*, _object*, _object*) () from /usr/local/lib64/panda3d/libpanda.so
No symbol table info available.
#16 0x00007ffff7b15bbf in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#17 0x00007ffff7b16140 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#18 0x00007ffff7b17570 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#19 0x00007ffff7b15af5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#20 0x00007ffff7b16140 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#21 0x00007ffff7b17570 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#22 0x00007ffff7b17642 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#23 0x00007ffff7b3187c in run_mod () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#24 0x00007ffff7b31950 in PyRun_FileExFlags () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#25 0x00007ffff7b32dfc in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#26 0x00007ffff7b3f25d in Py_Main () from /usr/lib/libpython2.6.so.1.0
No symbol table info available.
#27 0x00007ffff74e5c4d in __libc_start_main () from /lib/libc.so.6
No symbol table info available.
#28 0x0000000000400609 in _start ()
No symbol table info available.
(gdb)


Any ideas?
David H. Bronke
Vice President of Project Development
G33X Nexus Entertainment
Skewed Aspect
User avatar
whitelynx
 
Posts: 54
Joined: Wed Dec 31, 2008 2:56 pm
Location: Lubbock, TX

Postby rdb » Fri Oct 01, 2010 11:33 am

I managed to compile this using ppremake on my own machine, and committed the required changes to CVS. It's supposed to compile out of the box on makepanda now, but I haven't tested.

I can confirm that I get the same crash on 64-bits Linux, while the demos that were shipped with the SDK (even the cloth one) work fine.
rdb
 
Posts: 8549
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby enn0x » Fri Oct 01, 2010 6:58 pm

Until I have a two virtual linux machines (32bit, 64bit) up and running: can you check if NX64 got defined?
I don't know for sure if it should be set on 64bit linux or not.
What you could do is to set it explicitly to NX32 and see if the segfault is gone, then set it explicitly to NX64. Setting is done in physx_includes.h.
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby rdb » Sat Oct 02, 2010 1:26 am

Yeah, I added code to do that in physx_includes.h.

You could try and see if the 32-bits Linux beta of 2.8.3 also shows the same problem- it may not be a problem with 64-bits, but just with this version.
rdb
 
Posts: 8549
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby whitelynx » Sat Oct 02, 2010 5:40 pm

enn0x wrote:Until I have a two virtual linux machines (32bit, 64bit) up and running: can you check if NX64 got defined?
I don't know for sure if it should be set on 64bit linux or not.
What you could do is to set it explicitly to NX32 and see if the segfault is gone, then set it explicitly to NX64. Setting is done in physx_includes.h.


Actually, it won't even build unless NX64 is defined, because of a problem with data types.
David H. Bronke
Vice President of Project Development
G33X Nexus Entertainment
Skewed Aspect
User avatar
whitelynx
 
Posts: 54
Joined: Wed Dec 31, 2008 2:56 pm
Location: Lubbock, TX

Linux Configuration

Postby angelcaf » Wed Oct 06, 2010 2:10 pm

Hi enn0x,
I'm trying to launch panda Physx samples on Kubuntu GNU/Linux but it doesn't work.
I'm using the latest Panda3d stable version for Ubuntu and Physx 2.8.1.
Could you post me some information regarding the correct configuration on linux?
Thanks in advance
angelcaf
 
Posts: 5
Joined: Wed Oct 06, 2010 2:05 pm

Postby enn0x » Wed Oct 06, 2010 5:41 pm

Sorry, Linux is not my strong side. I am currently in the process of setting up virtual Ubuntu Karmic machines (32/64bit) for testing, but it will take time.

By the way: "it doesn't work" it too prune to allow any help at all.
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby angelcaf » Thu Oct 07, 2010 4:58 am

enn0x wrote:Sorry, Linux is not my strong side. I am currently in the process of setting up virtual Ubuntu Karmic machines (32/64bit) for testing, but it will take time.

By the way: "it doesn't work" it too prune to allow any help at all.


Yes you are right, so here some details:

1. Panda Version: 1.7.0
2. Python Version: 2.6.5
3. OS: Kubuntu Lucid (10.04)
4. Physx system software: 2.8.1

I'm trying to launch the Panda3d/Physx samples and I get the following error:


Code: Select all
Traceback (most recent call last):
  File ".../01_Basics.py", line 12, in <module>
    from panda3d.physx import PhysxManager
  File "/usr/share/panda3d/direct/ffi/panda3d.py", line 145, in __getattr__
    mod = self.__manager__.libimport(self.__library__)
  File "/usr/share/panda3d/direct/ffi/panda3d.py", line 122, in libimport
    raise ImportError, message
ImportError: DLL loader cannot find libpandaphysx.
angelcaf
 
Posts: 5
Joined: Wed Oct 06, 2010 2:05 pm

Postby enn0x » Fri Oct 08, 2010 7:27 am

Ok, seems like importing libpandaphysx fails, for whatever reason. Can you check a few things:

1.) Is the PhysX runtime installed correctly and are the PhysX samples that come with the PhysX SDK working? I am asking because there is no "PhysX system software" for Linux, only for Windows. Also I think you have to call ldconfig manually after installing the .deb packages. Can ypu please tell us what .deb packages you exactly installed?

2.) Do the Panda3D binaries you installed contain libpandaphysx? If so, please make sure it is there and tell us the full path of this file. I am asking bacause I think the default Panda3D binaries are not compiled with PhysX support.
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby angelcaf » Fri Oct 08, 2010 8:08 am

enn0x wrote:1.) Is the PhysX runtime installed correctly and are the PhysX samples that come with the PhysX SDK working? I am asking because there is no "PhysX system software" for Linux, only for Windows. Also I think you have to call ldconfig manually after installing the .deb packages. Can ypu please tell us what .deb packages you exactly installed?

Yes I installed a set of .deb packages downloaded from this url:
http://developer.download.nvidia.com/PhysX/2.8.1/PhysX_2.8.1_SDK_CoreLinux_deb.tar.gz
and followed the instructions until the creation of the 3 symbolic links.
All demo are working properly, by the way I didn't called ldconfig after installing the .deb packages. Which command should I use exactly?

enn0x wrote:2.) Do the Panda3D binaries you installed contain libpandaphysx? If so, please make sure it is there and tell us the full path of this file. I am asking bacause I think the default Panda3D binaries are not compiled with PhysX support.


This might be a problem because there isn't a libpandaphysx file, instead I've found these two files in the Panda3d libraries folder:
Code: Select all
/usr/lib/panda3d/libpandaphysics.so
/usr/lib/panda3d/libpandaphysics.so.1.7.0
angelcaf
 
Posts: 5
Joined: Wed Oct 06, 2010 2:05 pm

Postby enn0x » Fri Oct 08, 2010 11:22 am

All demo are working properly, by the way I didn't called ldconfig after installing the .deb packages. Which command should I use exactly?

If the PhysX demos run fine there is no need to call ldconfig yourself.

This might be a problem because there isn't a libpandaphysx file, instead I've found these two files in the Panda3d libraries folder:
/usr/lib/panda3d/libpandaphysics.so
/usr/lib/panda3d/libpandaphysics.so.1.7.0

These libs are Panda3D's built-in physics system. They are not related to ODE or PhysX. So you have installed Panda3D binaries without PhysX support. You have to compile Panda3D yourself (using --use-physx option for makepanda), or maybe ask rdb if he knows a download for Panda3D binaries with PhysX support.
enn0x
 
Posts: 1266
Joined: Wed Nov 08, 2006 1:39 am
Location: Germany, Munich

Postby angelcaf » Fri Oct 08, 2010 11:29 am

or maybe ask rdb if he knows a download for Panda3D binaries with PhysX support.


All right, it seems that I am close to the solution, however who is rdb? how can I contact him?
angelcaf
 
Posts: 5
Joined: Wed Oct 06, 2010 2:05 pm

Postby rdb » Fri Oct 08, 2010 12:40 pm

Hello. :-)

I believe the buildbot build ships with PhysX support, but it's currently only available for Ubuntu Karmic, sorry— I'm afraid you'll have to compile Panda3D yourself.
rdb
 
Posts: 8549
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby angelcaf » Fri Oct 08, 2010 4:02 pm

rdb wrote:Hello. :-)

I believe the buildbot build ships with PhysX support, but it's currently only available for Ubuntu Karmic, sorry— I'm afraid you'll have to compile Panda3D yourself.


Hi!! :wink:
that's not a problem! could you give me some instructions about this matter. Should I compile it with a specific flag for physx, as enn0x wrote me?...or the "--everything" flag is enough?

PS: I'll post all the steps once I'll have the samples working on linux.
angelcaf
 
Posts: 5
Joined: Wed Oct 06, 2010 2:05 pm

PreviousNext

Return to Panda Features in Development

Who is online

Users browsing this forum: No registered users and 0 guests