Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
659c0ff
some minor fixes
tenbergen Sep 18, 2018
97a1d80
fixed failing build (hopefully)
tenbergen Sep 18, 2018
dc5197a
Told Travis to install libudev-dev
tenbergen Sep 18, 2018
6a90e94
trying to force libudev install before gradle building on linux
tenbergen Sep 20, 2018
e085781
trying to fix JitPack build
tenbergen Sep 20, 2018
657d000
still fighting with jitpack to build this thing
tenbergen Sep 20, 2018
ba56ecd
still fighting with jitpack to build this thing
tenbergen Sep 20, 2018
c847f11
apparently, jitpack allows adding yml configs...
tenbergen Sep 20, 2018
befd380
fixed jitpack build
tenbergen Sep 20, 2018
2795954
fixing jitpack build
tenbergen Sep 20, 2018
0d196c7
fixing jitpack build
tenbergen Sep 20, 2018
2d96587
jitpack documentation is very sparse...
tenbergen Sep 27, 2018
8caf26b
updating gradle node plugin
tenbergen Sep 27, 2018
76ffb0c
updating grade to 4.10.2
tenbergen Oct 11, 2018
116f389
updating gradle to 4.10.2
tenbergen Oct 11, 2018
01c773c
adding apt-get travis-CI style without sudo
tenbergen Oct 11, 2018
25058c4
manifested build OS
tenbergen Oct 11, 2018
64bf825
manifested build OS
tenbergen Oct 11, 2018
609291c
forcing mkdirp
tenbergen Oct 11, 2018
17120a1
unforcing mkdirp
tenbergen Oct 11, 2018
68a561b
fixing travis build
tenbergen Oct 11, 2018
d36cd07
added turn message info
tenbergen Nov 29, 2018
488e525
adding robustness to discovery, based on suggestions by Peter Muir fr…
tenbergen Feb 8, 2019
9dde2e5
adding robustness to discovery, based on suggestions by Peter Muir fr…
tenbergen Feb 8, 2019
4b7a88a
adding robustness to discovery, based on suggestions by Peter Muir fr…
tenbergen Feb 8, 2019
8b36e96
adding robustness to discovery, based on suggestions by Peter Muir fr…
tenbergen Feb 8, 2019
eb8da44
added libudev-dev to jitpack
dmyrdek Feb 8, 2019
ffd5686
jitpack doesn't like pre-build sudo directives, or so I thought.
tenbergen Feb 9, 2019
c1f7f21
Corrected ID of vehicle "Guardian" from 0x0d to 0x0c.
tenbergen Mar 31, 2019
6a110e7
Working on mac fix
dmyrdek May 6, 2019
31eb429
fixed for macOS
dmyrdek May 6, 2019
286639d
Updated README.md
dmyrdek May 8, 2019
f059ed6
cleaned up server.js and README.md
dmyrdek May 8, 2019
8dab20d
cleaned up server.js and README.md
dmyrdek May 8, 2019
e742674
Corrected ID of vehicle "Guardian" from 0x0d to 0x0c.
tenbergen Jun 17, 2019
f21488f
Merge pull request #1 from dmyrdek/master
tenbergen Aug 20, 2019
9bc4dfc
updated license and readme.
tenbergen Aug 20, 2019
67eacad
updated license and readme.
tenbergen Aug 20, 2019
2d5c56a
updated license and readme.
tenbergen Aug 20, 2019
2013c43
added AnkiCommander SSH Test Server developed by Shakhar Dasgupta (ht…
tenbergen Aug 20, 2019
7aebad1
added getter for AnkiConnector to Vehicle.java as it's needed by proj…
tenbergen Sep 22, 2019
5dc35a8
Merge remote-tracking branch 'origin/master'
tenbergen Sep 22, 2019
8b8de90
added getter for AnkiConnector to Vehicle.java as it's needed by proj…
tenbergen Sep 23, 2019
9692e15
added getter for AnkiConnector to Vehicle.java as it's needed by proj…
tenbergen Oct 7, 2019
685c6ef
fix some new issues with jitpack
tenbergen Oct 7, 2019
4730d61
fix some new issues with jitpack
tenbergen Oct 7, 2019
65c9e7d
fix some new issues with jitpack
tenbergen Oct 7, 2019
73f4b45
fix some new issues with jitpack
tenbergen Oct 7, 2019
2503c75
fix some new issues with jitpack
tenbergen Oct 7, 2019
a5ab8e8
fix some new issues with jitpack
tenbergen Oct 7, 2019
82f58ac
fix some new issues with jitpack
tenbergen Oct 7, 2019
96feed1
added test command to gradle build
tenbergen Apr 29, 2020
87f65a2
added test command to gradle build
tenbergen Apr 29, 2020
e8cabf1
added test command to gradle build
tenbergen Apr 29, 2020
7daa6ad
added test command to gradle build. removed unnecessary interfaces.
tenbergen Apr 29, 2020
f02eca2
Cleaned AnkiConnectionTest; make the cars move to the next finish line.
tenbergen May 8, 2020
b328085
improvements to test program.
tenbergen May 9, 2020
d7a6f28
improvements to test program.
tenbergen May 9, 2020
160a051
Cleaned AnkiConnectionTest; make the cars move to the next finish line.
tenbergen May 9, 2020
e487de2
increase java version to 11 for jitpack/travis
tenbergen May 9, 2020
1f7f3cf
forcing openjdk 8 for jitpack
tenbergen May 9, 2020
53eb706
increase moowork node gradle plugin version
tenbergen May 9, 2020
c5b0679
force jitpack to clean and build
tenbergen May 9, 2020
ef57e4d
force jitpack to clean, build, and npm install
tenbergen May 9, 2020
d3f1c4e
force jitpack to clean, build, and npm install
tenbergen May 9, 2020
cd6ead4
force jitpack to clean, build, and npm install
tenbergen May 9, 2020
bbd898e
removed dependency on npmInstall
tenbergen May 9, 2020
f1f4d85
force ignore exist code for jitpack installs
tenbergen May 9, 2020
a80da44
force npm install from resource
tenbergen May 9, 2020
49e319f
force npm install from resource
tenbergen May 9, 2020
600ff12
change from application to library
tenbergen May 9, 2020
0eee53f
change from application to library
tenbergen May 9, 2020
7fe7009
change from application to library
tenbergen May 9, 2020
f2c82dd
change from application to library
tenbergen May 9, 2020
4324457
increase gradle wrapper version
tenbergen May 9, 2020
b923d41
increase gradle wrapper version
tenbergen May 9, 2020
c92f840
increase gradle wrapper version
tenbergen May 9, 2020
eb421a2
increase gradle wrapper version
tenbergen May 9, 2020
9c27bbe
increase gradle wrapper version
tenbergen May 9, 2020
37f333e
increase gradle wrapper version
tenbergen May 9, 2020
b4c99fa
increase gradle wrapper version
tenbergen May 9, 2020
2ca94a4
increase gradle wrapper version
tenbergen May 9, 2020
bfd0d31
change to java library
tenbergen May 9, 2020
1413282
change to java library
tenbergen May 9, 2020
af0838e
downgrading Gradle to 4.10.2 again and fix jitpack issues.
tenbergen May 9, 2020
740dffb
Updated README.md to reflect latest changes.
tenbergen May 9, 2020
5a7ccb1
Merge pull request #1 from tenbergen/master
kchan2 May 10, 2020
71121dc
Added PowerzoneRoadpiece from Fast & Furious edition.
tenbergen May 11, 2020
fe81a1c
Improve Roadmap.java class with ability to compare Roadmaps. Added so…
tenbergen May 12, 2020
eb10bfd
Improved Roadmap and RoadmapScanner.
tenbergen May 16, 2020
c2c14a6
Added test program and demonstrator for RoadmapScanner.
tenbergen May 16, 2020
bf9a447
Added test program and demonstrator for RoadmapScanner.
tenbergen May 16, 2020
cd250b9
testing OpenJDK11 for jitpack
tenbergen May 17, 2020
995648e
testing OpenJDK11 for jitpack
tenbergen May 17, 2020
4e36b2a
reverting to OpenJDK8 for jitpack
tenbergen May 17, 2020
3cce51a
Added failsafe to test programs in case BT gateway isn't running.
tenbergen May 18, 2020
4b87726
added JumpRoadpiece and LandingRoadpiece to accommodate Overdrive Lau…
tenbergen May 18, 2020
79c44d0
changed exit code
tenbergen Jun 16, 2020
43d0dc1
source compatibility Java 1.8
tenbergen Jun 16, 2020
8c0ce93
source compatibility Java 1.8
tenbergen Jun 16, 2020
978f1ba
source compatibility Java 1.8
tenbergen Jun 16, 2020
8378598
source compatibility Java 1.8
tenbergen Jun 16, 2020
81a5bfe
source compatibility Java 1.8
tenbergen Jun 16, 2020
3328cd5
source compatibility Java 1.8
tenbergen Jun 16, 2020
da45097
source compatibility Java 1.8
tenbergen Jun 16, 2020
b9cf937
source compatibility Java 1.8
tenbergen Jun 16, 2020
effe686
Merge pull request #2 from tenbergen/master
kchan2 Jul 23, 2020
c16c13c
Included pieceIDs and reverses in RoadmapScanner
kchan2 Jul 23, 2020
a4c8efc
Improved RoadmapScanner
kchan2 Jul 28, 2020
34422d6
Merge pull request #2 from kchan2/master
tenbergen Jul 28, 2020
74e7650
Added features to keep track of road pieces in a Roadmap to RoadmapSc…
tenbergen Jul 28, 2020
dd75e54
added Cloneable marker interface to Roadmap
tenbergen Aug 3, 2020
6b9889b
added clone() to Roadmap
tenbergen Aug 3, 2020
95287bc
added getCopy() method
tenbergen Aug 3, 2020
81e9ae8
go tcp/bluetooth server
gmaldona Dec 12, 2022
d681349
Merge pull request #3 from gmaldona/master
tenbergen Feb 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# anki-connector
node_modules/**
.gradle/**
build/**
bin/**
.classpath
.project
.settings/**
.idea/
# anki-connector
node_modules/**
.gradle/**
build/**
bin/**
.classpath
.project
.settings/**
.idea/
/.nb-gradle/
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
before_install:
- sudo apt-get update
- sudo apt-get install -y libudev-dev

language: java
jdk:
- oraclejdk8
- openjdk8
Binary file added Anki Drive Programming Guide.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2016 adesso AG
Copyright (c) 2018-2019 Bastian Tenbergen, The State University of New York at Oswego

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
62 changes: 54 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Anki Drive SDK for Java

The Anki Drive SDK for Java is an implementation of the message protocols
and data parsing routines necessary for communicating with Anki Drive vehicles.
and data parsing routines necessary for communicating with Anki Drive and Overdrive vehicles. This library is an updated
version of the one found [adessoAG/anki-drive-java](https://github.com/adessoAG/anki-drive-java).

*See [anki/drive-sdk](https://github.com/anki/drive-sdk) for the official
SDK written in C.*

### Disclaimer
The authors of this software are in no way affiliated to Anki.
The authors of this software are in no way affiliated to Anki nor adesso AG.
All naming rights for Anki, Anki Drive and Anki Overdrive are property of
[Anki](http://anki.com).
[Anki](http://anki.com), initial concept and implementation of the Java version by the folks at adesso.

This is a forked repository from [adessoAG/anki-drive-java](https://github.com/adessoAG/anki-drive-java), which, sadly,
appears to be abandoned. We are maintaining this SDK to serve our [tenbergen/Automotive-CPS](https://github.com/tenbergen/Automotive-CPS) project.

## About

Expand All @@ -32,16 +36,46 @@ To build and use the SDK in your own project you will need:
To install the SDK and all required dependencies run the following commands:

```
git clone https://github.com/yeckey/anki-drive-java
git clone https://github.com/tenbergen/anki-drive-java
cd anki-drive-java
./gradlew build
```

### On MacOS

Prerequisites for macOS:
- Node.js v6.14.2 or later.
- macOS 10.7 or later

If you get a "node-pre-gyp build fail error" when running npm install run:
```
rm -rf node_modules/
npm install --build-from-resource
```

Once connected, if your cars time out follow these steps:
1. Stop the server
2. From the Mac desktop, hold down the Shift+Option keys and then click on the Bluetooth menu item to reveal the hidden Debug menu
3. Select “Reset the Bluetooth module” from the Debug menu list
4. Once finished reboot your Mac

### On Linux / Raspberry Pi

Optional Dependency node-usb will not be installed. So, run:
```
sudo apt-get install libudev-dev
```

### On Windows

Node.js server is currently not supported on Windows. However, you can run the Node.js server on a Linux device change
`edu.oswego.cs.CPSLab.AnkiConnectionTest` to connect to the IP of the Raspberry Pi instead of `localhost`.

## Usage

Start the Node.js gateway service:
```
./gradlew npm_run
sudo ./gradlew server
```

### Add the Java library
Expand All @@ -55,11 +89,11 @@ repositories {

dependencies {
// <Git commit-ish>: commit hash or tag
compile 'com.github.adessoAG:anki-drive-java:<Git commit-ish>'
compile 'com.github.tenbergen:anki-drive-java:-SNAPSHOT'
}
```

For the Maven instructions see the [JitPack.io website](https://jitpack.io/#adessoAG/anki-drive-java).
For the Maven instructions see the [JitPack.io website](https://jitpack.io/tenbergen/anki-drive-java).

### API usage

Expand All @@ -73,7 +107,19 @@ Start scanning for vehicles:
List<Vehicle> vehicles = anki.findVehicles();
```

### Test File
To try a connection, start the server and run:
```
./gradlew ankiConnectionTest
```
which will execute
```java
edu.oswego.cs.CPSLab.AnkiConnectionTest
```

## Contributing

Contributions are always welcome! Feel free to fork this repository and submit
WINDOWS SERVER WANTED!

Other contributions are welcome as well. Feel free to fork this repository and submit
a pull request.
125 changes: 87 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,87 @@
buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.moowork.gradle:gradle-node-plugin:0.13'
}
}

apply plugin: 'java'
apply plugin: 'com.moowork.node'

repositories {
jcenter()
}

dependencies {
compile 'org.reflections:reflections:0.9.10'
}

node {
version = '4.4.7'
npmVersion = '3.10.5'
distBaseUrl = 'https://nodejs.org/dist'
download = true

workDir = file("${project.buildDir}/nodejs")
nodeModulesDir = file("${project.projectDir}")
}

task fatJar(type: Jar) {
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}

processResources.dependsOn(['npmInstall'])
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}

plugins {
id "com.moowork.node" version "1.3.1"
id 'java-library'
}

apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'com.moowork.node'
group = 'com.github.tenbergen'

compileJava.options.fork = true

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

repositories {
jcenter()
}

dependencies {
//included by adessoAG/anki-drive-java, but maybe updated
compile 'org.reflections:reflections:0.9.11' //was 0.9.10
compile 'javax.xml.bind:jaxb-api:2.3.0'

//new dependencies included by BT

//dependencies for AnkiCommander (https://github.com/sha224/anki-commander)
implementation 'org.apache.sshd:sshd-core:2.2.0'
implementation 'org.jline:jline:3.10.0'
implementation 'org.slf4j:slf4j-api:1.7.26'
implementation 'org.slf4j:slf4j-simple:1.7.26'
}

node {
version = '8.12.0' //was '4.4.7'
npmVersion = '6.4.1' //was '3.10.5'
distBaseUrl = 'https://nodejs.org/dist'
download = true

workDir = file("${project.buildDir}/nodejs")
nodeModulesDir = file("${project.projectDir}")
}

task fatJar(type: Jar) {
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}

task server(type: NodeTask, dependsOn: npmInstall) {
script = file('src/main/nodejs/server.js')
ignoreExitValue = true
}

//added exec task for Anki Commander SSH test server
task ssh(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.shakhar.anki.commander.AnkiSshd'
}

//added exec task for AnkiConnection test program
task ankiConnectionTest(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'edu.oswego.cs.CPSLab.AnkiConnectionTest'
}

//added exec task for RoadmapScanner test program
task scanTrack(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'edu.oswego.cs.CPSLab.RoadmapScannerTest'
}

//processResources.dependsOn(['npmInstall']) // moved to server task because only that needs node. Fixed Jitpack issues.
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
targetJavaVersion=JavaVersion.VERSION_1_8
org.gradle.jvm.version=JavaVersion.VERSION_1_8
12 changes: 6 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Aug 25 11:24:49 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
#Thu Feb 07 12:31:46 EST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
14 changes: 14 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sudo: required
dist: trusty
addons:
apt:
packages:
- libudev-dev

before_install:
- apt-get update
- apt-get install -y libudev-dev

language: java
jdk:
- openjdk8
Loading