Skip to content

Controlling vehicles with Matlab

zepinto edited this page Dec 1, 2014 · 4 revisions

IMCJava also provides a simplified API that allows Matlab scripts to connect to vehicles in the same network and command them via waypoints.

Adding IMCJava to Matlab

In order to be able to access this API, you should add IMCJava support in Matlab:

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

You should also import the package pt.lsts.imc.control:

import pt.lsts.imc.control.*

Now, you can connect to a vehicle named 'lauv-xtreme-2' by using the following expression:

myVehicle = ControlLink.acquire('lauv-xtreme-2', 30000)

Where, 30000 is the amount of time (in milliseconds) to wait for the vehicle to become visible.

Clone this wiki locally