Page 1 of 1

Gripper control

Posted: 14 Jan 2016, 18:20
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!

Re: Gripper control

Posted: 15 Jan 2016, 10:05
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

Re: Gripper control

Posted: 17 Feb 2016, 14:57
by poli
ok but I can't find the Connection Address and Connection Port required in the simxStart function..

Re: Gripper control

Posted: 19 Feb 2016, 19:27
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