Gripper control

Requests or suggestions for new features
Post Reply
poli
Posts: 9
Joined: 13 Jan 2016, 15:27

Gripper control

Post by poli »

Hello everyone,
I'm working on a university project but i'm stuck on a point. I'm trying to control a gripper (in particular ROBOTIQ_85) in order to close and open it with an external command. To be more specific, I'm using a phantom omni haptic device to control the movements of virtual forceps on v-rep. This physical device is equipped with two hardware buttons, one of them acting like a clutch so once pressed it allows to effectively move the object. So far everything seems ok. Problems come when trying to assign to the second button the task to open and close the gripper. I can't find any function able to do this. I have a cpp code that streams 1 and 0 if the second button is pressed or not, respectively. Does a function that reads the data from the terminal than puts them into a variable to close and open the gripper, exist?
Thanks for your suppport!

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

Re: Gripper control

Post by coppelia »

Hello,

have a look at the child script attached to the gripper model: in there, variable closing is controlling the opening/closing of the gripper.
You could send that variable over via an integer signal for instance: on the client side (if you use the remote API), use simxSetIntegerSignal, on the server side (i.e. V-REP), inside of that child script use simGetIntegerSignal.

Cheers

poli
Posts: 9
Joined: 13 Jan 2016, 15:27

Re: Gripper control

Post by poli »

ok but I can't find the Connection Address and Connection Port required in the simxStart function..

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

Re: Gripper control

Post by coppelia »

Well, that will depend on where the server (i.e. V-REP) is located. If V-REP is located on the same computer as your client, then use 127.0.0.1 (i.e. localhost) for the IP, and 19997 for the port. You could also use a different port, but in that case, you will have to start a server service yourself on the V-REP side.

Make sure you look at the various examples located in programming/remoteApiBindings/.

Cheers

Post Reply