Page 1 of 1

Enable and disable the dynamics of a link

Posted: 08 Jun 2021, 07:59
by hassan.farag
Hello there,

our scene is just one joint between 2 links (the child is dynamic). We managed to change the joint mode successfully from torque to passive mode and returned the joint position to zero using passive mode and disable the dynamics of the attached link. We have now this joint in passive mode and would like to enable the dynamics of the child link again to return the joint to torque mode (we used resetDynamicObject but did not work). How to do this? Thanks in advance. Noting that : we checked related posts and did not find any relevant answer.

our code

Code: Select all

 	
 		sim.setModelProperty(link_handles[1],sim.modelproperty_not_dynamic)
                print(sim.getModelProperty(link_handles[1]))
                sim.setJointMode(joint_handles[i],sim.jointmode_passive,0)
                sim.setJointPosition(joint_handles[i], 0)
                sim.setJointMode(joint_handles[i],sim.jointmode_force,0)
                sim.resetDynamicObject(sim_handle_all)
                print(sim.getModelProperty(link_handles[1]))

Re: Enable and disable the dynamics of a link

Posted: 08 Jun 2021, 08:40
by fferri
I believe the way to set a shape static/dynamic is setting the sim.shapeintparam_static parameter (with sim.setObjectInt32Parameter/sim.setObjectInt32Param).

You still need to call sim.resetDynamicObject afterwards, where needed.