How should I quickly and easily achieve in a scene where all objects maintain their current position and orientation, while leaving the position of each joints at 0?
https://drive.google.com/file/d/17vmBiD ... drive_link
set joint position to 0, while keeping child-object in place
Re: set joint position to 0, while keeping child-object in place
Hello,
you have several possibilities. Easiest would probably to parse all joints in the scene, temporarily detach their children, set the joints to zero, then reattach the children.
For that, use sim.getObjectsInTree, sim.getObjectParent and sim.setObjectParent
Cheers
you have several possibilities. Easiest would probably to parse all joints in the scene, temporarily detach their children, set the joints to zero, then reattach the children.
For that, use sim.getObjectsInTree, sim.getObjectParent and sim.setObjectParent
Cheers
Re: set joint position to 0, while keeping child-object in place
The IK in the scene seems to prevent setting the joints to 0.coppelia wrote: 07 May 2025, 07:48 The IK in the scene seems to prevent setting the joints to 0.
How can I set another script to disable in one script, by the way, my version of CoppeliaSim is v4.6. I can't seem to find the user manual for the old version anymore.
I tried to use the function, but I don't know if it's correct or what value XX should be set to in order to make the script disable.Code: Select all
sim.setScriptStringParam(scriptHandle,sim.scriptintparam_enabled,XX)
How can I set another script(for example the IK script) to disable in one script, by the way, my version of CoppeliaSim is v4.6. I can't seem to find the user manual for the old version anymore.
I tried to use the function
Code: Select all
sim.setScriptStringParam(scriptHandle,sim.scriptintparam_enabled,XX)
Re: set joint position to 0, while keeping child-object in place
The user manual is also offline, in your CoppeliaSim folder.
But I highly recommend to upgrade to the latest version.
sim.scriptintparam_enabled is an int parameter as the name says. So it should be:
Cheers
But I highly recommend to upgrade to the latest version.
sim.scriptintparam_enabled is an int parameter as the name says. So it should be:
Code: Select all
sim.setScriptInt32Param(scriptHandle, sim.scriptintparam_enabled, zeroOrOne)