tags:

views:

486

answers:

3

Ive spent a couple of good weeks on this, and welcome any suggestion or helps relating to issues with Kinematic actors and joints with physx.

First, I will start with the setup. I have one physx kinematic actor suspended in the air and a rope connected to this kinematic actor. The rope is comprised of other actors all connected to its neighbor via a sphere joint.

The sphere joints are all configured correctly, with have no limit on its degree of freedom. The setup procedures set that each actor connect via the sphere joint ignores collision with every other actor in the scene, this includes the kinematic actor.

When the simulation starts up, the rope is completely stable when connected to the kinematic actor. Moving the kinematic actor around for example forward and back at 1mps gives the desired result and the rope is stable.

Now when starting to move the kinematic actor at speeds greater than 15 to 25 meters per second, problems start occurring on the rope. Sudden jumps on the actors of the rope can be seen. Just there is a sudden update being applied to one of the rope segments. And the whole thing goes hurdling forward.

I have done many different attempts, the list include.
* Set the iteration solver count from 4 to 60
* Distribute the weight evenly across the actors
* Use suggestion on to set the inertia to higher values
* Set the update rate to 200hz.

The only thing that has helped the situation has been changing the time step from fix time steps to dynamic time steps. Though this is not desirable because it makes the simulation un deterministic.

Though, the alternative solution has been is not to use the kinematic actor as a parent for the rope. Instead to use just a normal dynamic actor that is constantly re-positioned at the exact same location over and over again. This way, even reaching speeds from 0 to 100mps the rope stays stable, and the simulation works perfectly fine.

I would like to use the kinematic actor instead but have not found a solution to solve the rope from sudden jitters when reaching higher speeds. The main reason being, even though repositioning the dynamic actor works, the rope segments still pull on it.

A: 

I am also having similiar problems as you described and had found that the the spherical joints are sensitive to mass and the solver counts which I could not find a solution for. I also was wanting to increase and decrease the length of the rope during the simulation, which I could not find a suitable solution using a chain of spherical joints. In the end I decided to go with a single distance joint connecting kinimatic actor and a dynamic actor, which I found more stable and as well able to easily increase and decrease the length of the distance joint.

One problem that I am wondering if you are having and if so have you found a solution to is as follows:

I am trying to simulate a crane that is supporting a payload on a cable. The crane is attached to a ship that is moving in time at constant velocity. I am then moving the position of the tip of the crane and would like the attached payload to respond correctly, but it appears to always lag behind the tip like a balloon being hung outside the window of a moving car. The higher the velocity the more horizontal the payload becomes.

In PhysX I have a Kinematic Actor (the tip of the crane) connected to a Dynamic actor (the load) using a distance joint. I am calculating the position of the Kinematic actor at each time step so that it has a constant velocity and then move the Kinematic using the moveGlobalPose command. When I plot the position of the connected payload through time it never reaches a position directly beneath the moving tip as one would expected. It is like wind resistance is keeping it back. If I supported a weight inside a moving vehicle it should be directly underneath the support point. I would expect that the support weight would have some motion when the vehicle goes from a stop position to reaching constant velocity, but the load should eventually rest underneath the suspension point. I am thinking that the problem is related to the fact that when you move a Kinematic Actor with the moveGlobalPose command the velocities of the actor is reset to zero, thus every move potentially applies an initial acceleration causing the attached joint to never reach a constant velocity.

Any input on this would be great

Dave

Dave
Hi Dave. To answer your question I think your right about the Kinematic actors and the velocity. Though I have experimented with it and just concluded if you wish to do any moving correct simulation of joints and objects you will need to convert all the actors to Dynamic actors to remove these problems.The next thing for stability for Sphere joints is to double check if your Inertia is being set correct and mass. The Inertia is based on vertex weight not convex component weight. This can trip you up with unstable simulation.
Chad
Next: When creating joints you have to be very very careful. In essence when you create a joint you make a transaction, that transaction is not completed until physx creates the joint. Because of that, you need to freeze the position and orientation of the actors until the physx completes 1 simulation step.
Chad
To get heavy loads on our side to be lifted by ANY joint you need to change the mass and inertia of the object during run-time. Physx recommends that weight be evenly distributed accross the joint connects for example. 10,10,10,10 not 100,10,10,100.
Chad
A: 

Hi Chad,

For the problem of Kinematic Actors and the velocity, have you tried using Character Controllers, which according to the PhysX documentation is usefull if the user wishes to have some control over the dynamic actor being controlled, whill still having the dynamic actor participate properly in the simulation. I thought that if I were to use a characterController for the tip of the crane and have the joint attached to the controllers dynamic actor that it may have a chance of working. Any thought about this??

Thanks in advance Dave

Dave
had no idea about Character Controllers. Will give that a go tonight and see what what the results are like.
Chad
Hi Dave, I read the documentation and here is the sniplet.The NxCharacter library creates a hidden kinematic actor for each controlled character. This sometimes causes confusion for a number of reasons, such as the total number of actors in the scene is not as expected, or unknown actors from scene collision queries may be received, etc.
Chad
Thank you for bringing up the characterController, although the biggest problem is behind the scene it does use a Kinematic Actor. So the original problem exist. Though its not a big deal, I found it very easy to convert out boat/helicopter/tank simulation system from our internal physics simulation to physx. Then creating joints between actors gives extra functionality like weight, pulling. Though joint instability needs to be constantly checked and if the velocity of actors become to large we delete the actors from the scene.
Chad
A: 

Hi Chad,

I tried using the CharacterController instead of the Kinematic actor for my problem, but I still get the same result. The actor attached to the embeded CharacterControler though the distance joint sill does not reach a position directly underneath the CharacterControler when moving it along a straight path by specifing a new location at each timestep, which would equate to moving it with constant velocity and 0 acceleration.

In your cable model using a kinematic actor, do you move the kinematic actor and if so have you experienced the same problem in that the rope does not aline it self directly under the kinematic actor after the initial acceleration?

Any other insite would be appriciated

Cheers Dave

Dave
Hi Dave, the main result is to get things correctly working you will need to use a dynamic actor and move the dynamic actors with the joints. I will post a link to a discussion similar to what you want to do.
Chad
http://developer.nvidia.com/forums/index.php?showtopic=2420
Chad
http://developer.nvidia.com/forums/index.php?showtopic=2707
Chad
I hope the above help for you to resolve your situation. Though my main view point is that you will need to remove the kinetic actor and go with dynamic actor and just re-position the dynamic actor constantly.
Chad