How to connect/use Remote API C++ with V-REP

Typically: "How do I... ", "How can I... " questions
Post Reply
andreiman
Posts: 3
Joined: 21 Mar 2016, 14:35

How to connect/use Remote API C++ with V-REP

Post by andreiman » 21 Mar 2016, 15:37

Hello,

Can anyone tell me what are the all steps to connect remote API C++ with VREP?
I looked in BubbleRob example but I didn't understand how can I do this.

All help is appreciated.

Thanks a lot!
Andrei

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

Re: How to connect/use Remote API C++ with V-REP

Post by coppelia » 21 Mar 2016, 16:12

Hello Andrei,

you will have to use the remote API, using the C/C++ binding. There are several examples. Take for instance the remote API client that controlls the purple robot in the demo scene controlTypeExamples.ttt: the source code is located in programming/bubbleRobClient.

The only thing you need to take care of on the server side (i.e. V-REP side) is to launch a remote API server service on a specific port. You do this with simExtRemoteApiStart. You do not need that step if you connect to the default remote API server service that runs on port 19997, from the time V-REP is launched. Remember that for one remote API client, you need exactly one remote API server service, meaning that you can't have two clients connect at the same time to a server service on the same port.

Once you have prepared a server service (and that server service is running), then on the client side you can connect to it via simxStart, then use all the available remote API functions. Once you are done with the connection, call simxFinish. Not all regular API functions are directly supported from a remote API client. In those cases, use simxCallScriptFunction, which is a generic function that you can entirely customize on the V-REP side, via scripting.

Cheers

andreiman
Posts: 3
Joined: 21 Mar 2016, 14:35

Re: How to connect/use Remote API C++ with V-REP

Post by andreiman » 25 Mar 2016, 20:25

Thank you!

cmayer777
Posts: 4
Joined: 02 Sep 2014, 04:01

Re: How to connect/use Remote API C++ with V-REP

Post by cmayer777 » 06 Dec 2018, 10:01

After installing the free EDU version on windows, I do not see the programming/bubbleRobClient example for connection using an external C++ program. Is this not supported in the free EDU version?

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

Re: How to connect/use Remote API C++ with V-REP

Post by coppelia » 06 Dec 2018, 11:23

Hello,

you can find that project in this repository, other projects are in the Coppelia Robotics repository.

Cheers

cmayer777
Posts: 4
Joined: 02 Sep 2014, 04:01

Re: How to connect/use Remote API C++ with V-REP

Post by cmayer777 » 06 Dec 2018, 14:36

Thank you!
Such a fast response - you people are awesome!

Post Reply