#1
|
|||
|
|||
Interface between Matlab and Vizard
Hello,
I am new to Vizard and have some experience with MATLAB. I want to create an interface between MATLAB and Vizard. I went through a few forums which state that I can create such an interface using PyMat. Can someone elaborate on this? Also, can I use TCP/IP or UDP to achieve this? Any kind of help is greatly appreciated. Thanks and Regards, Shweta. |
#2
|
|||
|
|||
You could try using Vizard's networking support to communicate with Matlab over UDP. There's sample code that shows how to send and receive raw byte data in Vizard.
Last edited by Jeff; 06-01-2014 at 10:27 PM. |
#3
|
|||
|
|||
Thank you for the reply.
However I am unable to create a proper serialization between matlab and vizard. Could someone please elaborate a bit more on this? Thanks |
#4
|
|||
|
|||
Vizard can receive raw byte network packets via UDP. If matlab can send the data via UDP then you should be able to get it in Vizard.
First you need to establish a connection with the machine running MatLab. You can either specify the machine name or IP address: Code:
myNetwork = viz.addNetwork('machineName') Code:
def onNetwork(e): if isinstance(e,viz.RawNetworkEvent): print e.raw_data viz.callback(viz.NETWORK_EVENT,onNetwork) Code:
viz.net.addPort(4960) |
#5
|
|||
|
|||
Hello Jeff,
Thanks for all the help. I really appreciate it. A small query, udp has worked fine but is there any other way to communicate between MATLAB and Vizard? Kind Regards, Shweta. |
#6
|
|||
|
|||
There are add-on packages for Python available to interface with matlab. I have not installed or tested any of these myself but hope to do so in the future. Vizard 4 uses Python 2.7 so the add-on must be compatible with 2.7. Here a few libraries you can look into:
Pymatbridge - http://arokem.github.io/python-matlab-bridge/ mlabwrap - http://mlabwrap.sourceforge.net/ pymatlab - https://pypi.python.org/pypi/pymatlab Can you describe the kind of data you're looking to send over and why the networking method is not meeting your needs? |
#7
|
|||
|
|||
Hello Jeff,
This method does meet my needs. Only problem is that I was told by one of my colleagues that UDP may be unsafe. My main task is to send a transform matrix from MATLAB to Vizard to change the viewpoint (I will mostly use setPosition(); Euler and scaling for this) Using UDP I could display some text in Vizard through MATLAB. So I am currently working on establishing a server client relation between MATLAB and Vizard where MATLAB sends the transformation matrix with 6 DOF and on receiving this Vizard sends some acknowledgement to MATLAB and one more after executing the transformation after which MATLAB sends the next command and this continues till the process is terminated either through MATLAB or on receiving a stop status from Vizard. I shall go through the links suggested by you. Thanks once again. Kind Regards, Shweta. |
#8
|
|||
|
|||
Hello,
I have another query which is not related to the interface between MATLAB and Vizard. I need to create a cloud of triangles. I was thinking of using viz.TRIANGLES for this purpose. My question is, is there a way to select the size of the triangles and their location? For location can I use random? I would really appreciate if someone can elaborate a bit on this. Thanks and Regards, Shweta. |
#9
|
|||
|
|||
Please create a new thread for questions that are not related to the thread topic.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Vizard with Tobii eye trackers | Powell | Vizard | 1 | 02-28-2014 05:25 AM |
Iinterface between MATLAB and Vizard | suraj | Vizard | 7 | 07-17-2012 09:02 AM |
MATLAB and vizard | xingtzu | Vizard | 1 | 01-15-2008 10:25 AM |
Matlab and Vizard | brystewa | Vizard | 1 | 09-18-2006 03:11 PM |
MATLAB and Vizard | eagleman | Vizard | 4 | 06-10-2005 11:42 AM |