PhysX 3.4 - Wheels seem to 'pop' at regular intervals while driving

Hi,

I’ve recently encountered an issue with vehicles as they accelerate where the wheels/suspension will ‘pop’ at regular intervals. The car will suddenly buck upward for a moment (as if going over a bump), stabilize, and repeat this every few moments at higher speeds (this can happen at lower speeds as well). Looking in the PVD, the wheels seem to get a sudden jolt regularly. I have several questions based on this:

  1. Is the suspension bi-directional? i.e. does the car impact the wheels and the problem here could actually be the suspension causing the wheels to pop?
  2. Are there any settings on the wheel or chassis that might cause such an issue?
  3. I’m only using the raycasts right now, and not doing any further steps with the wheel colliders. Would adding the wheel colliders potentially help this issue?
  4. This problem seems to have arisen after I removed the vehicle actor from the vehicles components I created, and defaulted to using previously created physx rigid body components and building the vehicle on top of that. Are there any potential update ordering issues that might be related to this?

The vehicle drives just fine, but it creates a jarring visual experience. Any insight would be greatly appreciated!

To follow up on this, it very much seems like some sort of error accumulation, because it will happen at almost any speed, and once it ‘pops’, reversing and driving back over the same area does not produce the same response. It appears that the ‘pop’ needs to build again.

  1. Yes, the suspension is bi-directional.
  2. It’s hard to know which setting is causing the issue, sorry.
  3. This is not likely to be fixed with sweeps instead of raycasts.
  4. This points to a data issue.

Can you describe the pop in a bit more detail?

A few different kinds of pop and the source of the pop spring to mind.

a. The wheel is momentarily being pushed upwards. This sounds like an issue with the raycast returning a bad normal or an unexpected contact point. Long, thin triangles might be the cause of this. PhysX would report an error if this was the case. There’s a tickbox in PVD to visualise the raycasts.

b. The wheel momentarily has a bad pose. I don’t know why this would happen but it would show up as a bad local pose for the wheel shape in PVD in the inspector view.

c. The wheel has hit the suspension bump stop. This would happen if the suspension sprung masses summed up to a value much less than the rigid body mass. Can you check the mass of the physx rigid body makes sense?

d. The wheel rotational angle accumulates up to +/- 10*Pi (or something like that) and then is pushed back in the (-Pi, Pi) range. If there’s a bug in there then you’d see only a pop around the rolling axis. To be honest, I doubt this would be noticeable in pvd so I doubt this is the issue but worth noting.

Sure! The pop is the car will shift vertically for a few frames, as if something had knocked the car from below, but the wheels remain on the ground. Visually, it looks as if the wheels stay on the ground, but the car chassis springs upward for a moment, before settling back. At high speeds, this hits a regular cadence where the car never fully settles, and it constantly oscillating up and down while driving forward.

a) Looking in PVD, it appears as though the wheels are getting a momentary push upwards. Looking at the velocity vectors, they spontaneously ‘jump’ vertically and then return to about a 45 degree forward-up direction for most travel.

b) I don’t see a bad pose, as other than the pop in pvd, the wheels don’t appear to orient in any other direction.

c) The mass of the car is 1500 kg, and the total spring strength is 35000. Spring damper is 4500.

d) What do you mean ‘see only a pop around the rolling axis’? Do you mean the wheel would move left to right, or only move up and down? Or something else? In this case, the pop is only along the vertical axis.

It really sounds like the wheel is being pushed up by a stray raycast result.

Can you check in pvd that the raycasts make sense? PVD visualises the raycasts and the hitpoints and normals. I suspect that there is a tiny triangle somewhere in your mesh and that you only occasionally hit it. Failing that, maybe something is happening at the boundary of two meshes and you are picking up an edge at the outside of the mesh.

You can also look at the data written to PxWheelQueryResult in PxVehicleUpdates(). I suspect that you’ll see a stray normal in there from time to time. That would also point to a mesh issue.

Cheers,

Gordon

Hi Gordon,

The thing that is odd in that case is that the issue isn’t replicated by going backward over the same spot. And there are definite mesh seams where it doesn’t seem to happen.

As a follow-up question - I’m not seeing the option to enable the raycast visualization in PVD? Am I missing something or perhaps on a different version? I think I’m in profile mode, so I’m checking to see if that is the core issue, but I wanted to ask here, just in case I’m missing something else!

Also, it happens to all four wheels simultaneously.

Raycast visualisation is enabled on the right hand side of the PVD screen. It’s in the “Scene Queries” option. You need to select “All”.

You will also need to send the scene queries to pvd from physx. This can be configured when in your physx initialisation code.

myScene->getScenePvdClient()->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_SCENEQUERIES, true);

It’s odd that it happens to all four wheels. Are you sure the suspension isn’t hitting the bumpstop? That could make the car bounce upwards.

Cheers,

Gordon

It might be? I don’t see extensive documentation about it in the vehicle notes:

https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/Vehicles.html#pxvehiclesuspensiondata

And it doesn’t seem like the values are off, based on your suggestions, but I will experiment further with it.

I’ve got scene queries turned on, but the vertical rays start at a point taller than the vehicle?

The rays should start above the wheel centre and end below the ground. PVD should draw the extent of the raycast in one colour and a normal coming out of the ground at the hit point in another colour.

Are any errors being reported by the sdk?

Sorry for the delayed response, I’m not seeing any direct errors. It looks like the tire forceAppPoints are shifting slightly and unexpectedly though while driving. Does that imply that the raycast is not always finding the terrain?

The tire force application points should never change. They are specified as an offset from the wheel rest pose so they move around with the body but the values themselves should never change. If these values are changing then something is writing over them.

You can inspect the result of the raycast in PxWheelQueryResult. Can you look in there and make sure that the values make sense?

Thanks for the help!

We found the issue, and it was not directly related to vehicles. We have several debugging features that were causing certain updates to be called twice, but the vehicle to only update once. Now that we’ve fixed that issue, the problem is solved. Thanks for the help, as it definitely helped eliminate possible culprits!

Glad to hear the issue is resolved.