OpenSim Mantis Tracker
| Anonymous | Login | Signup for a new account | 2010-07-31 17:37 PDT |
| Main | My View | View Issues | Change Log | Roadmap | Summary | Docs | My Account |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0002874 | [opensim] [REGION] Physics Engines | feature | N/A | 2008-12-19 03:23 | 2009-01-25 18:23 | ||||
| Reporter | nlin | View Status | public | ||||||
| Assigned To | Teravus | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | |||||||
| Summary | 0002874: NINJA Physics - patch to allow joints for OpenSim | ||||||||
| Description |
After receiving expressions of interest from a recent mailing list discussion about physical joints for OpenSim ( http://lists.berlios.de/pipermail/opensim-dev/2008-November/003633.html [^] ), I've continued work in this area and have a patch I'd like to submit for consideration. I refer to the patch as NINJA Physics: Networked INteractive Jointed Assemblies. The NINJA Physics patch enhances the ODE physics in OpenSim with joints: movable linkages between prims. This will allow wheeled vehicles, ragdolls, and mechanical/robotic assemblies to be interactively built within the standard viewer and controllable through scripting. This kind of physics is not currently available in OpenSim or Second Life. More documentation about this patch is available at http://opensimulator.org/index.php?title=NINJA_Physics. [^] Demo data in OAR format is available at http://forge.opensimulator.org/gf/download/frsrelease/142/304/demo-playground.tgz. [^] A demonstration of the idea can be seen here: http://jp.youtube.com/watch?v=nirTXPO-opE [^] This patch illustrates the basic architecture and functionality, but there is still much work to be done. I hope that with community interest and support we can make this into a robust new feature. |
||||||||
| Additional Information | |||||||||
| Tags | No tags attached. | ||||||||
| Git Revision | |||||||||
| SVN Revision | 7781 | ||||||||
| Run Mode | Standalone (1 Region) | ||||||||
| Physics Engine | ODE | ||||||||
| Environment | .NET / Windows32 | ||||||||
| Mono Version | None | ||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
Relationships |
||||||
|
||||||
Notes |
|
|
(0008094) RalfHaifisch (reporter) 2008-12-19 03:30 |
my goodness... this video is awesome... will dig into the oar later... i can think of many usecases this would be very helpfull, even for RL related projects congrats Ralf |
|
(0008097) RalfHaifisch (reporter) 2008-12-19 05:07 |
did patch, compile (no errors, warnings as usual) binary at: https://cid-7f9aad1b28ad84e2.skydrive.live.com/browse.aspx/%c3%96ffentlich [^] but can´t load the demo-data: 14:06:51 - [Console]: Command [load-oar demo-playground.tgz] failed with excepti on System.Exception: Unable to create file input stream for demo-playground.tgz: System.UriFormatException: Ungültiger URI: Das URI-Format konnte nicht bestimmt werden. 14:06:51 - bei OpenSim.Region.Environment.Modules.World.Archiver.ArchiveReadR equest.GetStream(String path) in c:\Documents and Settings\Administrator\Desktop \download\opensim-SVN\OpenSim\Region\Environment\Modules\World\Archiver\ArchiveR eadRequest.cs:Zeile 325. bei OpenSim.Region.Environment.Modules.World.Archiver.ArchiveReadRequest.Dear chiveRegion() in c:\Documents and Settings\Administrator\Desktop\download\opensi m-SVN\OpenSim\Region\Environment\Modules\World\Archiver\ArchiveReadRequest.cs:Ze ile 72. bei OpenSim.Region.Environment.Modules.World.Archiver.ArchiveReadRequest..cto r(Scene scene, String loadPath) in c:\Documents and Settings\Administrator\Deskt op\download\opensim-SVN\OpenSim\Region\Environment\Modules\World\Archiver\Archiv eReadRequest.cs:Zeile 67. bei OpenSim.Region.Environment.Modules.World.Archiver.ArchiverModule.Dearchiv eRegion(String loadPath) in c:\Documents and Settings\Administrator\Desktop\down load\opensim-SVN\OpenSim\Region\Environment\Modules\World\Archiver\ArchiverModul e.cs:Zeile 80. bei OpenSim.Region.Environment.Scenes.Scene.LoadPrimsFromArchive(String fileP ath) in c:\Documents and Settings\Administrator\Desktop\download\opensim-SVN\Ope nSim\Region\Environment\Scenes\Scene.cs:Zeile 2004. bei OpenSim.Region.Environment.Scenes.SceneManager.LoadArchiveToCurrentScene( String filename) in c:\Documents and Settings\Administrator\Desktop\download\ope nsim-SVN\OpenSim\Region\Environment\Scenes\SceneManager.cs:Zeile 240. bei OpenSim.OpenSim.LoadOar(String[] cmdparams) in c:\Documents and Settings\ Administrator\Desktop\download\opensim-SVN\OpenSim\Region\Application\OpenSim.cs :Zeile 972. bei OpenSim.OpenSim.RunCmd(String command, String[] cmdparams) in c:\Document s and Settings\Administrator\Desktop\download\opensim-SVN\OpenSim\Region\Applica tion\OpenSim.cs:Zeile 286. bei OpenSim.Framework.Console.ConsoleBase.RunCmd(String Cmd, String[] cmdpara ms) in c:\Documents and Settings\Administrator\Desktop\download\opensim-SVN\Open Sim\Framework\Console\ConsoleBase.cs:Zeile 368. bei OpenSim.Framework.Console.ConsoleBase.RunCommand(String cmdline) in c:\Do cuments and Settings\Administrator\Desktop\download\opensim-SVN\OpenSim\Framewor k\Console\ConsoleBase.cs:Zeile 404. |
|
(0008099) nlin (developer) 2008-12-19 05:20 |
Hm, that's odd. Did you copy the .tgz file into your bin/ directory? The other possibility is that the .tgz file got corrupted when I uploaded it to GForge SVN. If that's the case I can re-upload it (it will be at least Monday before I get a chance though). |
|
(0008100) RalfHaifisch (reporter) 2008-12-19 05:26 |
well.. i have no bin, but it´s in the directory with the content of bin - so that should work. may download however is titled "scmsvn.tgz" i even tried to unpack this (because on windows... just a try) and rename to demo-playground.tgz but the download itsself is strange, it seems to recalculate the filesize... You have Email at gmail, maybe just mail a copy and i´ll try this... |
|
(0008101) RalfHaifisch (reporter) 2008-12-19 05:38 |
ok... tried all things i can think of... download with firefox fails totaly... IE brings a scmsvn.tgz of 119KB. wether i use the direct link or go into SVN at forge.. so the file is broken or forge breaks it... :-/ |
|
(0008102) nlin (developer) 2008-12-19 06:37 |
I re-uploaded the data file to GForge as a file release instead of SVN. Could you try downloading the file demo-playground.tgz from http://forge.opensimulator.org/gf/project/ninjaphysics/frs/?action=index [^] and see if that works? |
|
(0008103) RalfHaifisch (reporter) 2008-12-19 06:45 |
works like a charm now - see File NINJA.jpg start playing now... |
|
(0008105) RalfHaifisch (reporter) 2008-12-19 07:13 |
after import i now get messages like: 16:06:21 - [ARCHIVER]: Restored 94 scene objects to the scene 16:06:21 - [ARCHIVER]: Successfully loaded archive 16:06:21 - [ARCHIVER]: Starting scripts Region (root) # : 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint-swing 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint-swing 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint-swing 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint-swing 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint-swing 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint-swing 16:06:21 - [NINJA]: WARNING - joint removal failed, joint balljoint2 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint4 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint2 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint3 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint1 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint12 16:06:21 - [NINJA]: WARNING - joint removal failed, joint hingejoint-pend2 16:06:21 - [XEngine]: Loaded script 2torso.New Script 16:06:21 - [XEngine]: Loaded script torso.New Script 16:06:22 - [XEngine]: Loaded script head.New Script 16:06:22 - [XEngine]: Loaded script 2head.New Script and after sitting on the swing i am suffering from nausea... *lol* forgett voice and combat systems... this is realy fun ! btw - it seems it realy sucks a lot of CPU, but the swining avatar with a highest graphic of the windlight viewer is just impressive... will try to put a region on osgrid asap |
|
(0008106) RalfHaifisch (reporter) 2008-12-19 07:25 |
got regular messages now, like: 16:16:35 - [NINJA]: removing from pending 16:16:35 - [NINJA]: adding to active 16:16:35 - [NINJA]: done 16:16:35 - [NINJA]: finalizing succesfully procsssed joint balljoint6 parms 2tor so 2llegtop 16:16:35 - [NINJA]: removing from pending 16:16:35 - [NINJA]: adding to active 16:16:35 - [NINJA]: done 16:16:35 - [NINJA]: finalizing succesfully procsssed joint balljoint5 parms 2tor so 2rlegtop 16:16:35 - [NINJA]: removing from pending 16:16:35 - [NINJA]: adding to active 16:16:35 - [NINJA]: done 16:16:35 - [NINJA]: finalizing succesfully procsssed joint hingejoint7 parms 2rl egtop 2rlegbot 16:16:35 - [NINJA]: removing from pending 16:16:35 - [NINJA]: adding to active 16:16:35 - [NINJA]: done 16:16:35 - [NINJA]: finalizing succesfully procsssed joint hingejoint8 parms 2ll egtop 2llegbot 16:16:35 - [NINJA]: removing from pending 16:16:35 - [NINJA]: adding to active 16:16:35 - [NINJA]: done where can i get a driver license ? i have no clue how to drive the vehicle ?? the falp does not work - ends in high speed messages like: 16:20:58 - [NINJA]: prim name flap2 exists but is not (yet) physical; deferring joint creation. 16:20:58 - [NINJA]: joint could not yet be created; still pending 16:20:58 - [NINJA]: taint: 1 pending joints 16:20:58 - [NINJA]: taint: time to create joint with parms: flap1 flap2 16:20:58 - [NINJA]: looking for prim name: flap1 16:20:58 - [NINJA]: found for prim name: flap1 16:20:58 - [NINJA]: looking for prim name: flap2 16:20:58 - [NINJA]: found for prim name: flap2 16:20:58 - [NINJA]: prim name flap2 exists but is not (yet) physical; deferring joint creation. 16:20:58 - [NINJA]: joint could not yet be created; still pending 16:20:58 - [NINJA]: taint: 1 pending joints 16:20:58 - [NINJA]: taint: time to create joint with parms: flap1 flap2 16:20:58 - [NINJA]: looking for prim name: flap1 16:20:58 - [NINJA]: found for prim name: flap1 16:20:58 - [NINJA]: looking for prim name: flap2 16:20:58 - [NINJA]: found for prim name: flap2 16:20:58 - [NINJA]: prim name flap2 exists but is not (yet) physical; deferring joint creation. 16:20:58 - [NINJA]: joint could not yet be created; still pending 16:20:58 - [NINJA]: a body connected to a joint was moved, but the joint doesn't exist yet! this will lead to joint error. joint was: hingejoint-hanger2 parms:f lap1 flap2 the robots them to be deaf... in wich part should be the script for the command ? however - this is impressive... and if i get the robots and the vehicle to work, i have a game for the weekend... |
|
(0008113) nlin (developer) 2008-12-19 08:01 |
I definitely need to tone down the debugging messages. I think if you set your log level higher most of the messages will be suppressed. (I can't recall how to do this; it may be OpenSim.exe.config.) The joint removal warnings are due to explicit separate requests for removal of a body and removal of its joints. Removal of a body causes automatic removal of its connected joints; then the original separate request to delete the joint fails because the joint is already gone. Not sure what's going on with the flap; continuous messages on the console indicate a joint that can't be created due to wrong parameters. This purposely outputs tons of messages to call attention to the fact that there's a joint specification error. This warning also should be toned down or configurable. If you deactivate the joint in question it should stop complaining. For the vehicle, you sit on it then click/drag the chassis. Not elegant, but it works. A script could probably allow better control by grabbing the key controls and using llSetForce or llImpulse. I haven't had a chance to try this myself yet, but I see no reason it shouldn't work. Finally, the ragdoll's torso and head should be listening for chat commands on channel 0. Try looking at those prims and see if the scripts are there and running. I would love to hear reports about how this works on OSGrid. I've only done local testing so far, so it will be interesting indeed to see how good/bad the joints look when Internet lag enters the equation. A far-in-the-future solution to lag is to simulate joints not only on the server but also in the viewer. Be aware that in an open environment like OSGrid you definitely will get tons of joint error messages on the console as people make mistakes when experimenting with joints. But multi-user testing in an open Internet environment is definitely needed. Thanks for your feedback and I look forward to more! |
|
(0008114) RalfHaifisch (reporter) 2008-12-19 09:00 |
region in osgrid up i did take a small Linux testbos - first to see if there is any impact WITHOUT NINJA-Objects on it. search for Sharkland in the map, easy to see wich region. region came up with no trouble upload the oar with the demos, correted terrain for load reasons did leave the swing and dolls , works... need to shutdown for a backup... restart.. oehm - i remeber, restart is not good --> Testregion is up --> how can i get Objects to reez in osgrid to put them after each update ? (load oar does skip my objects and terrain, so no real option) question: when will the NINJA´s stay after shutdown/start ? so far, first few hours - no big bang and function as intended |
|
(0008115) nlin (developer) 2008-12-19 09:22 |
The best suggestion I have for now to rerez the jointed assemblies (NINJAs) is: 1. Mark all prims and joints in a NINJA. 2. If the NINJA is active (physical), turn it off (non-physical). 3. Ctrl-L to link all objects together. 4. Take the linked object into your inventory. To re-rez: 1. Rez the linked object from inventory. 2. Ctrl-Shift-L to unlink. (If you don't do this, I imagine serious errors will occur because I'm not yet handling linksets at all in the joints code.) 3. Select all prims/joints in the NINJA. 4. Turn physics on. Note that you can't (or shouldn't) rez the same NINJA twice because this will result in name collisions. Also the linking would be unnecessary if OpenSim supported coalesced objects in inventory, but it doesn't yet. Also about region persistence: if you turn off all NINJAs before region shutdown, things should persist properly as non-physical prims. Then on region startup manually activate everything again. Although this works, it does lead to gradual accumulation of joint error; see the wiki for more details. |
|
(0008116) Teravus (administrator) 2008-12-19 09:26 |
Seems interesting. Will investigate after work today. |
|
(0008138) RalfHaifisch (reporter) 2008-12-19 17:56 |
Hi nlin, did as mentioned... did load the playground linked and took objects did load my region prepared prims with pic´s and objects for testing problem: after unlinking everythings ok after making physical, they are just physical - so everything falls apart and down on the ground.. everything round just rolls away... does not make any difference wether from the objects content oder directly from inventory (the original i took) |
|
(0008139) Teravus (administrator) 2008-12-19 18:14 edited on: 2008-12-19 18:26 |
Okay, after investigation.. a few things prevent it from being committed to SVN. There's no copyright statement at the top of added files. There needs to be. In ODEPrim.cs, the throttle system is commented out (even when NINJA physics is disabled). This is bad... very bad actually. The result of this is massive CPU increase and massive bandwidth increase. That's ODEPrim.cs line 2487 with the patch. Does it really have to reach into SceneGraph? We'd like to keep physics as disconnected from the rest of the simulator as possible. in Scene, we shouldn't be referencing a setting in the ODEPhysicsSettings of OpenSim.ini. We should only reference that section of OpenSim.ini from within OdePlugin (inside the constructor of ODEScene). I highly suggest limiting this to the following assemblies. OpenSim.Region.Scenes.SceneObjectPart, OpenSim.Region.Physics.Manager. OpenSim.Region.Physics.OdePlugin. Maybe Scene also for hooks to the PhysicsScene.. and SceneObjectGroup to pass the 'changes' to SceneObjectPart. but that should really be it. |
|
(0008142) nlin (developer) 2008-12-19 19:40 |
Hi Teravus, Great, thanks for the detailed feedback. I'll work to address your comments (it will be next week before I'm back in front of my development workstation); I may have some questions. Regarding OpenSim.ini, I think we may need 2 options. The first option, which is what is in the patch now, would be in the general [Startup] section to control whether the SceneObjectPart will recognize a joint specification in the name field and translate "turn-on-Physical" requests into joint creation requests against the abstract PhysicsScene. This setting is independent of the underlying concrete physics scene, because it affects how the SceneObjectPart reacts to "turn-on-Physical" requests. The second option would be an ODE-specific setting that controls whether OdePhysicsScene will execute the new joint code pathways or not. (Currently the OdePhysicsScene joint code pathways are always active, but if the first option is set to false then no joints ever get recognized by the SceneObjectPart, so no joint requests ever get sent to ODE, so all joint data structures are empty and the code pathways execute but do nothing because there are no joints). In the future, other physics engines could also turn on/off the joints feature of each specific physics engine. So, 2 options: one for controlling SceneObjectPart behavior, one for controlling execution of OdePhysicsScene joint code pathways. What do you think? Stay tuned for more... |
|
(0008143) Teravus (administrator) 2008-12-19 19:46 |
How about a method in PhysicsScene to query if there's joint support? That would be something that would work. It would reduce the necessary configuration down to one option, and would limit the items I specified above. |
|
(0008144) nlin (developer) 2008-12-19 19:48 |
RalfHaifisch - I'll look into the link/inventory/re-rezzing problem next week. NINJA Physics relies heavily on prim names to know what parts to connect together with joints. It's possible that the naming of prims is somehow not getting properly updated when rezzing linksets from inventory. One thing you can try is after rezzing and unlinking the NINJA, to check and/or manually re-type-in the prim names for each prim/joint. This is just a guess though. |
|
(0008145) nlin (developer) 2008-12-19 19:55 |
Teravus, About OpenSim.ini - right, the SceneObjectPart will ask if the PhysicsScene supports joints. If it does (because it's turned on in ODEPhysicsSettings), then the joint naming convention is respected; if it doesn't, the joint naming convention is ignored. |
|
(0008149) RalfHaifisch (reporter) 2008-12-20 03:00 |
@nlin - i will check the names, and if thats not the solution try to figure out if i can find something else. for now i can say: i did get a 7781SVN and put the patches on , compile was done on VPS Server 2003 64bit witch studio 2008 on .Net3.5 first standalone test was done on Vista 64bit the pilot in osgrid runs un SuSe 1.03 32bit the region stability and other functions does not seem to be influenced by the patches |
|
(0008161) RalfHaifisch (reporter) 2008-12-20 05:02 |
@nlin - did check the names... also, made the region fully clear of any prim and started over - no luck so far. will continue to report |
|
(0008248) RalfHaifisch (reporter) 2008-12-21 07:37 |
@nlin got no luck with reezing... will no wait for your test interesting part, see the pic Ninja-reezerror-swing. the joints don´t fall down, while everything else does |
|
(0008295) nlin (developer) 2008-12-21 18:51 |
RalfHaifisch: about the link/take/rez/unlink/activate procedure - it seems to work for me as expected. I can re-rez a NINJA from inventory with this procedure. I'll continue to investigate. About the joints not falling down, this is because joint prims are set to "Phantom" automatically whenever they are turned "Physical". This is not, I think, strictly necessary; it's mostly for UI consistency so you don't get the confusing situation of having an apparently "Physical" joint prim that you can walk through. Can you set the joints to be Physical but not Phantom? And if you do this, do the joint prims fall down? If so, this means that they are not getting recognized as joints by the server, but are instead being created as normal prims. Does the region console output any messages about joints when you toggle the joint prims to be Physical? |
|
(0008448) nlin (developer) 2008-12-25 22:54 |
I've updated the patch according to the comments above by Teravus, and merged it with against r7872 of the SVN codebase. The new patch file to apply is ninja-v2-allparts.patch. The demo data in OAR format is the same as before. Please have a look at the newest patch and let me know what you think. Specifically, the following changes and improvements have been made to address the comments mentioned above. 1. Copyright statements have been added to the new files. 2. The throttle in OdePrim has been re-instated. Additionally, rotational motion is now taken into account when deciding if throttling should be applied or not; rotational motion exceeding an epsilon threshold causes an update. This allows for instance rotating fan blades to properly update even when no translational motion is present. This change is in effect even when NINJA physics is off, because I think in general rotational motion should always be considered when deciding whether to throttle or not. 3. The patch no longer modifies code in SceneGraph (though a few comments relating to joints are added). 4. The OpenSim.ini setting for NINJA physics joints has been moved to the [ODEPhysicsSettings] section. The OpenSim.ini option is only directly queried by OdePlugin. The SceneObjectPart queries the abstract PhysicsScene to ask if it supports the NINJA-style joint naming convention; if so, properly-named prims, when turned physical, cause joint requests to be passed to the abstract PhysicsScene. 5. The patch is now limited to the assemblies mentioned: OpenSim.Region.Scenes.SceneObjectPart, OpenSim.Region.Physics.Manager, OpenSim.Region.Physics.OdePlugin, and Scene. In addition, the following improvements have been made. a. Codepaths for the new joints code are not executed unless NINJA physics is turned on in OpenSim.ini. Therefore, this patch should cause no noticeable effects when NINJA physics is turned off. Specifically, if NINJA physics is turned off, then the following code paths become inactive. Inactive code paths in Scene.cs: * Codepath for adding joint callbacks to the PhysicsScene is not executed. Therefore joint callbacks are not called. * Codepath for deleting joints along with a SceneObject (DeleteSceneObject) is not executed because IsJoint() returns false. Inactive code paths in SceneObjectPart.cs: * IsJoint() always returns false. * Codepaths for issuing joint creation/deletion requests are not executed since IsJoint() always false. * New code path: there is code to update PhysActor.SOPName and PhysActor.SOPDescription fields. Inactive code paths in OdePlugin.cs * Joint creation and deletion routines are not called because the SceneObjectPart refuses to recognize joints. * Codepath for removal of joints is not executed in RemovePrimThreadLocked. * Codepath for handling incoming joint creation/deletion requests is not executed. * Codepath for checking/creating pending joints is not executed. * Codepath for invoking joint callbacks is not executed. b. Error display has been greatly improved. In case a joint (or joints) cannot be created for some reason, the error is indicated in-world with an icon drawn directly on top of the corresponding joint object(s). This error display uses the same error reporting mechanism used by script error messages. This makes it very easy to identify any joints with errors and fix them (e.g. by correcting mistyped part names). No joint-related output goes into the logfile. Please let me know any comments or feedback. Thanks! |
|
(0008449) RalfHaifisch (reporter) 2008-12-25 23:58 |
Binary for other interested is at https://cid-7f9aad1b28ad84e2.skydrive.live.com/browse.aspx/%c3%96ffentlich [^] Sharkland Linux NINJA Shark is updated |
|
(0008450) RalfHaifisch (reporter) 2008-12-26 02:30 |
Heho, the former problems with the objects dropping down in parts is gone. everything looks fine. http://video.google.com/videoplay?docid=-1419364493373489348 [^] i have placed the objects "everyone copy" , so everybody can try cheers, Ralf |
|
(0008453) Teravus (administrator) 2008-12-26 04:59 |
Applied in trunk, thanks! |
|
(0008523) svn (developer) 2008-12-28 08:30 |
teravus committed related code in r7881 * More NINJA Joint physics fixes from nlin. fixes mantis 0002874 see more at - http://opensimulator.org/cgi-bin/viewvc.cgi?view=rev&revision=7881 [^] |
| Mantis 1.1.1[^] Copyright © 2000 - 2008 Mantis Group |