Simulation Settings through External Script

Typically: "How do I... ", "How can I... " questions
Post Reply
Jolene
Posts: 3
Joined: 26 Jun 2024, 10:59

Simulation Settings through External Script

Post by Jolene »

Hello, is there a way to modify the Sim settings from kinematic to dynamic mode? I am first trying to evaluate the joint angles on the robot for collision, and then going to model the trajectory etc, but I have to change the settings through the UI. (I can do this with the jointMode but the Simulation settings is still dynamic and my robot falls apart during simulation) Would like to be able to modify it with my external code (python). Thank you again!

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Simulation Settings through External Script

Post by coppelia »

Hello,

best is probably to modify those settings via sim.setModelProperty. You can of course also traget individual objects via sim.setObjectInt32Param(shapeHandle, sim.shapeintparam_static, value), sim.setJointMode or similar.

However, if you often need to switch back and forth, even better would be to have to similar models: one kinematic, or dynamic.

Cheers

Jolene
Posts: 3
Joined: 26 Jun 2024, 10:59

Re: Simulation Settings through External Script

Post by Jolene »

Hello, thanks for the reply. Actually I didn't mean the model properties, but the actual simulation settings where the dynamics enabled option is checked or unchecked (where the gravity vector input is). Thank you once again this forum is very helpful!

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Simulation Settings through External Script

Post by coppelia »

Hello,

try with:

Code: Select all

sim.setBoolParam(sim.boolparam_dynamics_handling_enabled, false)
Cheers

Post Reply