Skip to content

AutoDRIVE-Ecosystem/AutoDRIVE-MathWorks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 

Repository files navigation

AutoDRIVE       MathWorks

A comprehensive toolbox containing modular APIs and turnkey demos for autonomous driving using AutoDRIVE Ecosystem and MathWorks tool suite.

GitHub MATLAB File Exchange

MATLAB API

This section describes the MATLAB API for AutoDRIVE, which can be used to develop modular as well as end-to-end autonomous driving algorithms.

SETUP

  1. Install the Java library:
    • Place the WebSocket-1.0.0.jar file on the static Java class path in MATLAB by editing the javaclasspath.txt file (create the file if it does not exist). Run the following in MATLAB Command Window:

      edit(fullfile(prefdir,'javaclasspath.txt'))

      For example, if the location of the jar file is C:\AutoDRIVE-MathWorks\autodrive_matlab_api\lib\target\WebSocket-1.0.0.jar, then open the static class path file with the above command and add the full path to it. Make sure that there are no other lines with a WebSocket-* entry. You can refer to MATLAB's Documentation for more information on the static Java class path.

      After having done this, restart MATLAB and check that the path was read by MATLAB properly by running the javaclasspath command. The newly added path should appear at the bottom of the list, before the DYNAMIC JAVA PATH entries. Note that seeing the entry here does not mean that MATLAB necessarily found the jar file properly. You must make sure that the actual jar file is indeed available at this location.

    • [OPTIONAL] To build the jar file yourself, it is recommended to use Apache Maven (tested with version 3.8.1) with Java Development Kit (tested with version 8u411). Maven will automatically take care of downloading the Java-WebSocket library and neatly package everything into a single file (an "uber jar") based on the pom.xml. Once the mvn command is on your path, simply cd to the lib directory and execute the mvn package command.

  2. Add the autodrive_matlab_api directory to MATLAB path by right-clicking on it from MATLAB's file explorer and selecting Add to PathSelected Folders and Subfolders.

USAGE

  1. Execute AutoDRIVE MATLAB API:

    autodrive = example_{vehicle}(4567)

    Replace {vehicle} by one of the available objects:

  2. Terminate AutoDRIVE MATLAB API:

    autodrive.stop
    delete(autodrive)
    clear autodrive

About

A comprehensive toolbox containing modular APIs and turnkey demos for autonomous driving using AutoDRIVE Ecosystem and MathWorks tool suite

Topics

Resources

Stars

Watchers

Forks