NVIDIA-Omniverse / PhysX

NVIDIA PhysX SDK
BSD 3-Clause "New" or "Revised" License
2.5k stars 347 forks source link

D6 Joint doesn't report drive force #286

Open kermado opened 2 months ago

kermado commented 2 months ago

It looks like the drive force isn't reported for some joints. In particular, the D6 joint doesn't report the drive force/torque. Force reporting is only enabled for locked axes. I can't see any way to enable drive force reporting without modifying the source code.

Would it be possible to add a flag to PxD6JointDriveFlag or similar? This could then be used to set the Px1DConstraintFlag::eOUTPUT_FORCE in ConstraintHelper::addDrive().

vreutskyy commented 2 months ago

Hi @kermado Thanks for the reporting this issue. We'll check it.

preist-nvidia commented 2 months ago

@kermado - can you use an articulation instead? We do have https://nvidia-omniverse.github.io/PhysX/physx/5.4.0/docs/Articulations.html#link-incoming-joint-force

And if you project this onto the DOF, you'll get the drive force (plus friction/limits if they are active).

kermado commented 2 months ago

@preist-nvidia I can in most cases, but sometimes we have cycles that need to be broken and we still need to measure forces/torques for those joints. At the moment, I have made the changes described, which allows me to get these values out.

preist-nvidia commented 2 months ago

Understood - would you mind creating a PR with your changes and we can look at the code and consider integrating it?

msauter-nvidia commented 1 month ago

Hi @kermado, Would like to double check something: for your purpose, it would be enough to just have the drive forces added to the joint/PxConstraint forces, right? You do not need to separate the drive forces from the other forces (limits etc.), correct?

msauter-nvidia commented 4 weeks ago

Update: support for adding the drive forces is planned to go into release 5.5.0-106.2. Look for PxD6JointDriveFlag::eOUTPUT_FORCE