DriveCommand
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 buildWindows:
./gradlew.bat buildRun Test and Generate Javadoc
Linux & OS X:
./gradlew test
./gradlew javadocWindows:
./gradlew.bat test
./gradlew.bat javadocTest 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.
-
Make a folder in
modelfolder The new folder should be named after your device likedrone. -
Implement an implementation of
MachineBaseand related classes There are 3 examples (ev3, nxt, pile). They contain implementations ofMachineBaseand Input/Output port classes, etc.
Release History
- 2.3.0
- CHANGE: Rename
LineSensortoLightSensor
- CHANGE: Rename
- 2.2.0
- CHANGE: Clean up JavaDocs
- 2.1.1
- CHANGE: Remove
timeoutfrom write/read - ADD: Add more tests
- CHANGE: Remove
- 2.1.0
- CHANGE: Update test libraries
- 2.0.1
- CHANGE: Remove
applyStatus()
- CHANGE: Remove
- 2.0.0
- CHANGE: Refactor codes roughly
- Release: The first proper release
- 1.0.0
- First: Import our old library from bitbucket
Meta
PILE Project – @pileproject - [email protected]
Distributed under the Apache License, Version 2.0. See LICENSE for more information.
Let's discuss anything on our Mailing List!
