Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kd345312/RoboApp
Browse files Browse the repository at this point in the history
  • Loading branch information
qfettes committed Apr 19, 2017
2 parents b9ae132 + e889265 commit 294c0c9
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 5 deletions.
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ While connected to the cat, the cat will turn its "head" to center the biggest,
in its camera view. Note: this is currently set to work with the front camera of a phone shooting
a 1024x768 image at 30fps. These values can be modified in createCameraSource() in fdActivity.java.

RoboCat can respond to voice commands through the [PocketSphinx API](https://github.com/cmusphinx/pocketsphinx). Additional info regarding the installation and use of this API can be found in /doc/pocketsphinx-voice-recognition.
RoboCat can respond to voice commands through the [PocketSphinx API](https://github.com/cmusphinx/pocketsphinx). Additional info regarding the installation and use of this API can be found in /doc/pocketsphinx-voice-recognition. PocketSphinx recognizes voices from a file in 'app/assets/commands.gram'. If you want to add voice commands you must add the key words to this file or the cat wont recognize the words you are saying.

Also currently available in the app are activities which allow terminal contact with the pololu, for log purposes, and to manually send values to the servos (The servos are what allow the bobcat to maneuver through the environment).
Also currently available in the app are activities which allow terminal contact with the pololu, for log purposes, and to manually send values to the servos (The servos are what allow the bobcat to maneuver through the environment). Similar commands are also found in 'CatEmotion.java' and 'FdActivity'.

Robocat is also able to switch from face tracking mode to color tracking mode, by a simple button press on the main UI. The color to track and sensitivity can be changed by going to robocat's menu and selecting color tracking settings. Robocat creates a 3x3 grid and examines each subsection to determine which area has the most of the specified color, and then turns its "head" towards that area.

## Installation and Running the Application
To build and run this application, you should do the following:
1. `git clone` the master branch of this repo.
1. `git clone` the master branch of this repo. The repo can be found under kd345312/RoboApp
2. Download the latest version of [Android Studio](https://developer.android.com/studio/index.html)
3. Open Android studio, and open an existing project
4. Open `RoboApp/RoboApp` inside Android Studio. Make sure the app you open in android studio is **not** just simply the RoboApp directory you just cloned, but rather the RoboApp project file within this application, as otherwise the app will not run. RoboApp the repo is composed of several different android applications that are injected into the main RoboApp app, located at RoboApp/RoboApp.
Expand Down Expand Up @@ -67,3 +67,28 @@ We require access to these permissions within the application:
`Microphone` Pocketsphinx is used within this application to provide always on voice listening. We do not log or store the data that is heard, we just take the commands as strings and use them in our code.

`Storage` Storing data such as accelerometer data or voice commands to the phone for debugging purposes.

## Known Issues
The Arduino board is not yet connected physically to the body of RoboCat.
The Arduino is recognized as a device by the app, and the Arduino receives the servo commands from the app when connected, but it does not write to the Serial1 port(pololu) to move the servos.

The distance data can be written to the phone if a broadcastreceiver is correctly implemented.

Active listening through PocketSphinx has been merged into the master branch, however it only works with certain Android devices. Known working devices (Galaxy s5 and Google Pixel).

The front camera on older Android phones only captures images at 15 fps, so RoboCat can’t follow faces if the user is moving too fast.
FIXED: Updated to track faces at 30 fps and it works much better now with faster moving users.

Color tracking is still a standalone app and needs to be merged into the master branch, and also needs to receive input from a video feed (currently only captures input from still pictures).
FIXED: Color Tracking is merged into master branch and now tracks color via video feed.

Google removed RoboApp from the Android App Store due to a security vulnerability related to a new version of SSL that was released while we were developing.
FIXED: the security vulnerability issue was resolved and the app is now actively available on the google play store.

8,000 static analysis errors (mostly .xml errors and errors with the battery app). We are ignoring the spelling errors

![alt tag](https://raw.githubusercontent.com/kd345312/RoboApp/catFrown.png)

![alt tag](https://raw.githubusercontent.com/kd345312/RoboApp/colors.png)

![alt tag](https://raw.githubusercontent.com/kd345312/RoboApp/readme.png)
2 changes: 2 additions & 0 deletions RoboApp/app/src/main/assets/sync/commands.gram
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ grammar commands;
deactivate |
rufus |
vision |
high |
five |
cry ;

public <digits> = <digit>+;
2 changes: 1 addition & 1 deletion RoboApp/app/src/main/assets/sync/commands.gram.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e91d36209e10da107c6a2a5536d038e1
c933cbd3f9706ba6db2cad78ff38e0e4
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,13 @@ else if (result.contains("stand")){
.build());
virtualCat.stand();
}
else if (result.contains("high five")){
mTracker.send(new HitBuilders.EventBuilder()
.setCategory("Command")
.setAction("high five")
.build());
virtualCat.highFive();
}
else if (result.contains("right")) {
//Make the cat head move right
mTracker.send(new HitBuilders.EventBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,21 @@ public void stand(){
new standTask().execute();
}

private class highFiveTask extends AsyncTask<Void, Void, Void> {
protected Void doInBackground(Void... v) {
int[] a56 = {170, 12, 31, 3, 1, 104, 42, 104, 50, 104, 62};
maestro.explicitSend(getBytes(a56));
int [] a57 = {170, 12, 31, 3, 16, 104, 42, 104, 50, 104, 62};
maestro.explicitSend(getBytes(a57));
int[] a58 = {170, 12, 31, 3, 1, 104, 42, 104, 50, 104, 62};
maestro.explicitSend(getBytes(a58));
return null;
}
}

public void highfive() {
new highFiveTask().execute();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public void turnHeadRight() {
public void turnHeadUp() {
Log.i(TAG, "mock cat turning head up.");
}

@Override
public void highFive() { Log.i(TAG, "mock cat highfiving");}
/*@Override
public void lookToward(Point relPos) {}*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,6 @@ public void lookAwayFrom(Point relPos) {
public void resetHead() {
p.home();
}

public void highFive() { p.highfive();}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public void AddBatteryListener(CatBatteryListener listener) {

public abstract void turnHeadDown();

public abstract void highFive();

// -- OPENCVRMV
// public abstract void lookToward(Point relPos);

Expand Down
Binary file added catFrown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added colors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 294c0c9

Please sign in to comment.