Giter Club home page Giter Club logo

is-matlab-old's Introduction

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:[email protected]: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

is-matlab-old's People

Contributors

rodolfo-picoreti avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.