GPS model with Matlab

Typically: "How do I... ", "How can I... " questions
MohamedHassan
Posts: 2
Joined: 30 Nov 2016, 13:39

GPS model with Matlab

Postby MohamedHassan » 12 Aug 2017, 14:55

hi,
When I connect Matlab with Vrep and my scene has "GPS" model which is a component in V-REP, I get this msg "undefined function or variable 'GPS' " and when I do same steps with python , it works well
how can I define the model in matlab ?
thanks in advance

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

Re: GPS model with Matlab

Postby coppelia » 12 Aug 2017, 17:41

Hello,

I am not sure what you want to achieve exactly. Do you want to be able to read the values from the GPS model, in Python?
Then you should slightly modify the script attached to the GPS model and add a script function. Then you should call the script function from the Python remote API client via simxCallScriptFunction. You can find an example on how to call simxCallScriptFunction in programming/remoteApiBindings/pathon/python/complexCommandText.py

Cheers

MohamedHassan
Posts: 2
Joined: 30 Nov 2016, 13:39

Re: GPS model with Matlab

Postby MohamedHassan » 12 Aug 2017, 22:57

I don't want to write the code in python, I was examine the model and I tried it with python to check if it will work or not and it work
but I want to code with Matlab, and when I run the code of the connection it tell me: ""undefined function or variable 'GPS' "

my code with the error here in this screen shoot:
http://imgur.com/ubS9w2T
Image

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

Re: GPS model with Matlab

Postby coppelia » 16 Aug 2017, 07:54

Your Matlab code doesn't seem to use the GPS variable at all, at least not in the code section you are showing us. You must be doing something else wrong on the Matlab side.

Cheers


Return to “General questions”

Who is online

Users browsing this forum: No registered users and 29 guests