PileProject / drivecommand

A communication library which connects a robot (EV3, NXT, etc.) and a device (Android, PC, etc.)
Other
14 stars 4 forks source link
android bluetooth directcommand ev3 java lego mindstorms nxt robot

DriveCommand

master: Build Status

develop: Build Status

A general library written in Java which enables robots and devices to communicate with each other through the same interface.

Available robots

We currently support 3 robots:

They can communicate with any device (PC, Android, etc.) with this library.

Installation

From gradle

Please write the following codes in your build.gradle.

repositories {
    maven { url 'http://pileproject.github.io/drivecommand/' }
}

dependencies {
    compile 'com.pileproject:drivecommand:VERSION'
}

v2.3.0 is the latest version.

From jar file

After building sources (See Build), you can find drive-command.jar in build/libs.

Build

Linux & OS X:

./gradlew build

Windows:

./gradlew.bat build

Run Test and Generate Javadoc

Linux & OS X:

./gradlew test
./gradlew javadoc

Windows:

./gradlew.bat test
./gradlew.bat javadoc

Test reports will be generated in build/reports/tests (See index.html). Javadocs will be generated in build/docs/javadoc (See index.html).

Usage example

To use this library, you should prepare an implementation of ICommunicator to specify the master device (PC, Android, etc.).

As an example, we are developing drive, an Android application that controls EV3/NXT/Pile Robot and it uses BluetoothCommunicator, which is an implementation of ICommunicator, to control robots with an Android device via Blutooth.

After preparing an implementation of ICommunicator, you can make an object of an implementation of MachineBase and access to a robot. In drive, we create a machine like the following (using NxtMachine):

// preparation (create an BluetoothDevice with MAC address)
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
BluetoothDevice device = adapter.getRemoteDevice(address);

NxtMachine machine = new NxtMachine(new BluetoothCommunicator(device));

Development setup

Please fork this repository, modify it and send Pull Request.

If you want to make more machines available like Drone, you can follow the below steps.

  1. Make a folder in model folder The new folder should be named after your device like drone.

  2. Implement an implementation of MachineBase and related classes There are 3 examples (ev3, nxt, pile). They contain implementations of MachineBase and Input/Output port classes, etc.

Release History

Meta

PILE Project – @pileproject - dev@pileproject.com

Distributed under the Apache License, Version 2.0. See LICENSE for more information.

Let's discuss anything on our Mailing List!