Hi. I am trying to turn on the physics type property to #In Physics in a python script.
I am picking up a cylinder from the ecatalog with a robot and then dropping it.
I want it to fall.
I copied the code from the bin picking example. However, when I set the Physics Type to 0 then component defaults to #kinematic.
if I change this to 1 then it goes to #Out of Physics but any other value it defaults back to #kinematic.
If I change any other physic property then contain the value I assigned.
Only the Physics Type wont change to #In Physics
patty = Container.Components
phys = patty.findBehaviour(‘PhysicsEntity’)
for x in phys.Properties:
if x.Name == ‘Physics Type’:
x.Value = 0
Well it seem that the Cylinder in products and containers does not like it if you change it to #In Physics with a python script.
I have modelled a new component cylinder and replace it as the product in my simulation.
Now the script turns on and off the physics.
Therefore code is correct, there is just something to do with the standard cylinder not allowing anything other than kinematics or out of physics to be controlled via Python.
Ok on further investigation…
it seems that the gripper release signal changes the property of the part being dropped to kinematic. Therefore if I run to the point where my robot drops the part and turn on physics the part drops off and is set to #In Physics.
If I then send a signal to release the gripper (signal 1 in robot) then the properties change back to kinematic.
Did you notice that the robots have inbuilt “release to physics” functionality in the action script.
So you just need to switch the “ReleaseToPhysics” property to “Always” or to “If target not detected” on the SignalActions property tab of any robot.
It sounds odd that some particular cylinder wouldn’t work. Do you dare to share the layout?