A general library written in Java which enables robots and devices to communicate with each other through the same interface.
We currently support 3 robots:
They can communicate with any device (PC, Android, etc.) with this library.
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.
After building sources (See Build),
you can find drive-command.jar
in build/libs
.
Linux & OS X:
./gradlew build
Windows:
./gradlew.bat build
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).
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));
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 model
folder
The new folder should be named after your device like drone
.
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.
LineSensor
to LightSensor
timeout
from write/readapplyStatus()
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!