Enable and disable the dynamics of a link

Typically: "How do I... ", "How can I... " questions
Post Reply
hassan.farag
Posts: 8
Joined: 01 Sep 2020, 07:27

Enable and disable the dynamics of a link

Post 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]))

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Enable and disable the dynamics of a link

Post 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.

Post Reply