Skip to content
This repository has been archived by the owner on Dec 16, 2017. It is now read-only.

labvisio/is-matlab-old

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

is

Easy to use IoT messaging middleware matlab implementation.

Dependencies

The messaging layer is implemented using the the amqp 0.9.1 protocol, requiring a broker to work. We recommend using RabbitMQ.

The broker can be easily instantiated with Docker with the following command:

docker run -d -m 512M -p 15672:15672 -p 5672:5672 picoreti/rabbitmq:latest

To install docker run:

curl -sSL https://get.docker.com/ | sh

Using the library

This is not a native matlab implementation of the library, instead we use the java implementation inside of matlab. Therefore the jar file needs to be imported in order to use the library. This can be achieved by running:

javaaddpath(PATH_TO_JAR);
javaaddpath('./is.jar');

Messages and Serialization

Currently messages are serialized/deserialized according to the MessagePack binary format. The org.msgpack.core.MessagePack package can be used to serialized/deserialized messages. Examples.

Subscribe Example

%  Creates a connection to the broker running on localhost at port 5672, 
% with credentials guest:guest (username:password respectively).
connection = com.labviros.is.Connection('amqp://guest:guest@192.168.1.110:5672');

%  Subscribe to the topic 'ptgrey.0.frame' from the 'data' exchange returning a queue
% that we can use to consume the messages.
queue = connection.subscribe('data', 'ptgrey.0.frame'); 

% Wait forever waiting a message from 'ptgrey.0.frame'
message = queue.take();

% Here we need to unpack the message in order to use it. We know that this topic returns 
% a message of type CompressedImage, so:

compressedImage = com.labviros.is.msgs.camera.CompressedImage(message); % But dont use this for this type in particular

% CompressedImage is basically a binary buffer of an image in a certain format: png, etc.
% We would like to have it as a matlab matrix. Therefore a helper is provided:

image = imunpack(message); % Unpack message to image matrix

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages