Skip to content

Receiving real time data in Matlab

zepinto edited this page Dec 1, 2014 · 13 revisions

IMCJava is a Java library than can be used by any Java application (Android included) to receive and send IMC messages. Moreover, you can also import this Java library in Matlab to receive real-time data and control vehicles that are connected to the same network.

Importing the IMCJava library in Matlab

From Matlab you can add the library libimc.jar to Matlab by entering the following command:

javaaddpath('/path/to/libimc.jar')

Also, you should be interested in importing packages required for sending and receiving messages:

import pt.lsts.imc.*
import pt.lsts.imc.net.*

Using IMCProtocol to interact with a network of vehicles

You can now start using IMC from Matlab by creating an instance of an IMCProtocol java object:

imc = IMCProtocol()

This will result in the creation of a new IMC node in the network that will discover other systems and connect to them. In order to list connected systems, you can type:

imc.systems()
Clone this wiki locally