Break the force sensor

Typically: "How do I... ", "How can I... " questions
Post Reply
gplminhduc147
Posts: 4
Joined: 25 May 2024, 01:58

Break the force sensor

Post by gplminhduc147 »

Hello. I'm working on a project, and this project uses the old version of CoppeliaSim.

The customize script to break the force sensor is "sim.breakForceSensor(inData.handle)"
However, the sim.breakForceSensor is deprecated, and the Regular API Function webpage suggest using sim.setObjectParent instead.

I don't know how to switch from breakForceSensor into setObjectParent. So, I will be very grateful if you guide me in using it. If possible, please provide me with an example. Thanks a lot!!!

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

Re: Break the force sensor

Post by coppelia »

Hello,

in order to mimic a similar behaviour, simply set the parent object of the force/torque sensor to world, i.e.:

Code: Select all

sim.setObjectParent(forceSensor, sim.handle_world)
Cheers

Post Reply