Page 1 of 1

v-rep link to matlab with remote api

Posted: 19 May 2017, 15:56
by rasool
i want to link v-rep to matlab with remote api, and i have read help , and did this step;
((
Make sure you have following files in your directory, in order to run the various examples:
1. remApi.m
2. remoteApiProto.m
3. the appropriate remote API library: "remoteApi.dll" (Windows), "remoteApi.dylib" (Mac) or "remoteApi.so" (Linux)
4. simpleTest.m (or any other example program)
))
but when I run "simpleTest.m", I see this error.
"Failed connecting to remote API server"
can you please help me?

Re: v-rep link to matlab with remote api

Posted: 20 May 2017, 05:55
by coppelia
Hello,

did you start a remote API server service on port 19999 on the V-REP side? You can also try to connect to port 19997, where you have a remote API server service running by default.

Cheers

Re: v-rep link to matlab with remote api

Posted: 21 May 2017, 07:12
by rasool
how can I start remote API server service on that port? I have read remoteApiConnections.txt but I don't know, how can I start remote API server service!!??
thx for helping...

Re: v-rep link to matlab with remote api

Posted: 21 May 2017, 08:56
by mimid21
hello,

in v_rep side you must add new non_treaded child script "add-associate child script-non_treaded, and write in the script this command "simExtRemoteApiStart(19999)".

and when you start the simulation. you must run first v_rep, then your programme in matlab.

hope i can help you here.

Re: v-rep link to matlab with remote api

Posted: 21 May 2017, 09:05
by mimid21

Re: v-rep link to matlab with remote api

Posted: 21 May 2017, 17:54
by rasool
I did all these guidances, but when I run "simpleTest.m" that exists on this path: (V-REP_PRO_EDU\programming\remoteApiBindings\matlab\matlab)
I face with this message:
"Connected to remote API server
Number of objects in the scene: 16
Mouse position x: 283"
and when I run "simpleSynchronousTest.m" on the same path as previous. I face with this message:
"Failed connecting to remote API server
Program ended"
what does this mean?
can you please help me?

Re: v-rep link to matlab with remote api

Posted: 22 May 2017, 20:36
by rasool
can anybody help me?? pleeaaasseeee

Re: v-rep link to matlab with remote api

Posted: 24 May 2017, 11:15
by mimid21
hi my friend you must be more vigilant, when you open simpletest code, you find v_rep adresse "19999" as below:
function simpleTest()

clientID=vrep.simxStart('127.0.0.1',19999,true,true,5000,5);

but it's not same in in simpleSynchronousTest code, its "19997".


function simpleSynchronousTest()

clientID=vrep.simxStart('127.0.0.1',19997,true,true,5000,5);

you must change it to connecte to "19999" your scene on v_rep.

good luck.