Skip to content
Snippets Groups Projects
Select Git revision
  • 5424c7786facccfbe74014f2e5aa5d915bb7f5a0
  • master default protected
  • dev_2022
  • patch-1
  • develop
  • 50-use-ubuntus-libhidapi
  • issue-highLevelDispatch
  • issue-highLevelDesign
  • issue-motorStartBug
  • issue-commandLayerDesign
  • v1.0
  • v0.4-rc.13
  • v0.4-rc.12
  • v0.4-rc.11
  • v0.4-rc.10
  • v0.4-rc.9
  • v0.3-rc.8
  • v0.3-rc.7
  • v0.3-rc.6
  • v0.3-rc.5
  • v0.3-rc.4
  • v0.3-rc.3
  • v0.3-rc.2
  • v0.3-rc.1
  • v0.3-rc
  • v0.2
  • v0.1.1
  • v0.1
28 results

ev3-toolbox-matlab

  • Open with
  • Download source code
  • Your workspaces

      A workspace is a virtual sandbox environment for your code in GitLab.

      No agents available to create workspaces. Please consult Workspaces documentation for troubleshooting.

  • Tim Stadtmann's avatar
    Tim Stadtmann authored
    5424c778
    History

    "Lego Mindstorms EV3" MATLAB Toolbox

    Hello, fellow LEGO constructors and MATLAB programmers, welcome to the RWTH - Mindstorms EV3 Toolbox for MATLAB! This toolbox was designed to abstract and simplify controlling LEGO MINDSTORMS EV3 robots using MATLAB. Via Bluetooth or USB you can read sensor values or control your robots’ motors in an intuitive way. You can choose whether to strictly follow the EV3's firmware specification by sending commands directly, or operate on a higher level, using a complete virtualized EV3, including Motor and Sensor classes.

    This toolbox is being developed at the RWTH Aachen, Germany, and it is the follow-up of the RWTH MATLAB NXT Toolbox.

    To get started, take a look at the installation instructions and examples.

    Prerequisites

    If you use Windows, you will need to have the Instrument Control Toolbox installed for USB to work properly.

    This toolbox has been developed and tested on MATLAB 2014a/2016a, on Windows 7/10 and Ubuntu 14.04/16.04. If you encounter problems using other configurations, feel free to contact us.

    The EV3's firmware version needs to be updated to 1.09, bugs and unsuspected behaviour has been encountered when using older versions.

    Installation

    In most cases, you will only need to download the toolbox and add it's path to your MATLAB search path. ('Set path' -> 'Add with subfolders')

    You can skip the next part and proceed to the first example to test if everything works fine.

    If you use a Linux system and connecting via Bluetooth does not work, you can try to manually install the HIDAPI, an API for communication with HID devices, which this toolbox uses for Bluetooth connection on Linux - a prebuilt version is delivered with the toolbox. HIDAPI can be installed using the official repositories of your distribution or built on your own.

    Examples

    Before you can try out the following example, you will need to have your EV3 connected to your PC via Bluetooth or USB. If you use a Linux system and want to try out Bluetooth, we suggest you use the 'btconnect'-script you find in 'Tools'. It is a command line script which should facilitate pairing with the brick. The syntax is 'btconnect brickName' (you can read the name your EV3 at the top of its display - it should be EV3 by default).

    % This example expects a motor at port A and a (random) sensor at port 1
    b = EV3();
    b.connect('usb'); % OR: b.connect('bt');
    ma = b.motorA;
    ma.setProperties('power', 50, 'limitValue', 720);
    ma.start();
    % fun
    ma.waitFor();
    disp(b.sensor1.value);
    b.beep();
    b.disconnect();

    You can find more info on the toolbox functions/classes either by using help functionname/classname and doc functionname/classname, or in the generated PDF/HTML documentation (in docs).

    Contribution

    TODO

    Building the documentation