v-rep link to matlab with remote api

Report crashes, strange behaviour, or apparent bugs
Post Reply
rasool
Posts: 4
Joined: 18 May 2017, 18:57

v-rep link to matlab with remote api

Post 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?

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

Re: v-rep link to matlab with remote api

Post 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

rasool
Posts: 4
Joined: 18 May 2017, 18:57

Re: v-rep link to matlab with remote api

Post 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...

mimid21
Posts: 9
Joined: 05 Mar 2017, 13:48

Re: v-rep link to matlab with remote api

Post 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.


rasool
Posts: 4
Joined: 18 May 2017, 18:57

Re: v-rep link to matlab with remote api

Post 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?

rasool
Posts: 4
Joined: 18 May 2017, 18:57

Re: v-rep link to matlab with remote api

Post by rasool »

can anybody help me?? pleeaaasseeee

mimid21
Posts: 9
Joined: 05 Mar 2017, 13:48

Re: v-rep link to matlab with remote api

Post 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.

Post Reply