How to control the RG2 gripper through the python client?

Typically: "How do I... ", "How can I... " questions
Post Reply
Hacher
Posts: 40
Joined: 28 Nov 2024, 02:00

How to control the RG2 gripper through the python client?

Post by Hacher »

I have tried use the function sim.setJointPosition to control the close and open of the gripper, but it didn't work.And I also tried to use "sim.setIntProperty(sim.handle_scene, 'signal.RG2_open', 1)" to control it accroding to the coed of the RG2 script, but it still didn't work.
coppelia
Site Admin
Posts: 10804
Joined: 14 Dec 2012, 00:25

Re: How to control the RG2 gripper through the python client?

Post by coppelia »

Hello,

drag and drop the RG2 model into the scene, then run the simulation. Then type:

Code: Select all

sim.setIntProperty(sim.handle_scene, 'signal.RG2_open', 1)
Does that open the gripper? Then do:

Code: Select all

sim.setIntProperty(sim.handle_scene, 'signal.RG2_open', 0)
Does that close the gripper? This works here.
When you say it doesn't work, what does it mean exactly? is there any error message?

Cheers
Post Reply