Disable dynamic engine for motion planning

Typically: "How do I... ", "How can I... " questions
Post Reply
neostek
Posts: 21
Joined: 15 Feb 2013, 10:26

Disable dynamic engine for motion planning

Post by neostek »

Hello guys,

I would like to ask a question about the dynamic engine. Sometimes, in robotics, it is nice to run only kinematic simulation. A reason for that, as example, is in motion planning.
When you are planning a path, it is like the entire world "freeze" and the computation are made on this scene. If, as simple example, a sphere rolls for gravity, the entire method should fail.

Then, my question is if I can disable the physics engine. For the best of my knowledge about V-rep, I see many ways (possible or not possible)

1) Disable the physics engine (This is the best solution but I did not find how to do it)
2) Performing the collision checking without running the situation. Here my question is if the joint values are settable from some kind of script and the collision checking can be enable also without pressing the "play" button of the simulation. In other words, I would like to run the entire simulation without "running" it (so I have not the physics engine running. But I think this can not be done.
3) This is a workaround. I would like to know if it is possible to create all static objects then play the simulation. In this way, the robot is not subjected to dynamic effect. I'm not sure if I can move it from script and if the collision checking can be enabled for these kind of objects.

Any other solution to my problem is really welcome and I think it is common for each people that would like to run (probabilistic) motion planning algorithm.

Thanks in advance for any reply,

Neostek

neostek
Posts: 21
Joined: 15 Feb 2013, 10:26

Re: Disable dynamic engine for motion planning

Post by neostek »

I answer to the question by myself and I write here the solution for others that wants to know the same. It is really simple. Just go to
calculation module panel (f(x) symbol)-> dynamics -> uncheck dynamics enabled

Best regards,

neostek

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

Re: Disable dynamic engine for motion planning

Post by coppelia »

Hello Neostek,

Indeed, you have many possibilities for that:

1) As you mentioned, you can simply disable the engine via the dialogs. Via a program, you can also do it with following command: simSetBooleanParameter(sim_boolparam_dynamics_handling_enabled,false).

2) If simulation is not running, then your scripts are not executed (except for some add-on scripts). You can however execute various commands from a plugin. The plugin can call collision checking functions, set joint positions, move objects around, etc.

3) You can also temporarily disable dynamic models. In that case, you can double-click the model icon in the scene hierarchy (it looks like a small black ball). Then you can override object properties in that model (e.g. "Model is static" or "Model is not respondable"). Programmatically you can also do it via following API function: simSetModelProperty

Cheers

neostek
Posts: 21
Joined: 15 Feb 2013, 10:26

Re: Disable dynamic engine for motion planning

Post by neostek »

Thank you for your responce. I think the best option is the second one since when the robot finishes to plan, it has to run the algorithm it found. In this new step, I need dynamics. So it is what I was looking for. Thank you again,

Neostek

tor
Posts: 21
Joined: 18 Oct 2015, 11:56

Re: Disable dynamic engine for motion planning

Post by tor »

Dear Coppelia and Neostek and All:

Is there a way _programmatically_ to re-enable the dynamic models after we disable it via simSetModelProperty(myHandle, sim_modelproperty_not_dynamic) during simulation?
I am working on _online_ motion planning, in which the planning phase (kinematics only) is interleaved with execution phase (needs dynamics).
Some work around is to maintain two separate models in a scene, but that will indeed complicate the code.
So, I am expecting: simSetModelProperty(myHandle, sim_modelproperty_dynamic), is there any function like that?
Please help. Thank you.

Regards,
tor

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

Re: Disable dynamic engine for motion planning

Post by coppelia »

Hello Tor,

yes. You have to remember that the properties that you set/get via simSetModelProperty/simGetModelProperty are bit-coded.

So if at a later point you want to make your model dynamic again (after setting the sim_modelproperty_not_dynamic flag), you need to clear that flag again:

Code: Select all

local p=simGetModelProperty(objectHandle)
p=simBoolOr32(p,sim_modelproperty_not_dynamic)-sim_modelproperty_not_dynamic
simSetModelProperty(objectHandle,p)
Cheers

Post Reply