Skip to content

Commit

Permalink
junk, conflict fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qfettes committed Oct 18, 2016
2 parents 86f3025 + 4e99e16 commit 52954c1
Show file tree
Hide file tree
Showing 39 changed files with 562 additions and 494 deletions.
4 changes: 2 additions & 2 deletions RoboApp/.idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions RoboApp/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions RoboApp/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions RoboApp/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion RoboApp/app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-vision/9.4.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<<<<<<< HEAD
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
=======
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
>>>>>>> 4e99e1659c80c74b2c94d670d3690aff9a11f5eb
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
Expand Down Expand Up @@ -144,6 +150,5 @@
<orderEntry type="library" exported="" name="opencv" level="project" />
<orderEntry type="module" module-name="openCVLibrary300" exported="" />
<orderEntry type="module" module-name="appFaceTracker" exported="" />
<orderEntry type="library" exported="" name="android-android-24" level="project" />
</component>
</module>
26 changes: 22 additions & 4 deletions RoboApp/app/src/main/java/com/robodoot/dr/RoboApp/CatEmotion.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.robodoot.dr.RoboApp;

import android.util.Log;
import android.widget.ImageView;
import com.robodoot.dr.facetracktest.R;

import org.opencv.ml.EM;

import java.util.ArrayList;
import java.util.Random;
import java.util.Timer;
Expand All @@ -12,6 +15,7 @@
* Created by stopn_000 on 11/16/2015.
*/
public class CatEmotion {

public enum EMOTION {HAPPY, HAPPY_TONGUE, HAPPIER, HEARTS, ANNOYED, SAD, SADDER, CONCERNED, CRYING, DISGUSTED, HEARTS_TONGUE, KAWAII_EYES_CLOSED, KAWAII_EYES_OPEN, LOOK_RIGHT, LOOK_LEFT, YAWNING}
private EMOTION state;
private int scale;
Expand Down Expand Up @@ -74,14 +78,20 @@ public void reCalcFace() {

// Here we prevent a mood greater than or less than 120.
if(scale>120)scale=120;
if(scale<-120)scale=-120;
if(scale < -180)scale= -180;

context.runOnUiThread(new Runnable() {
@Override
public void run() {

if (default_display) {
if (scale <= -100) {
String test = Integer.toString(scale);
if (scale <= -166) {
state = EMOTION.DISGUSTED;
} else if (scale <= -133) {
state = EMOTION.CRYING;
} else if (scale <= -100) {
Log.w("Sadder","I am sad");
state = EMOTION.SADDER;
} else if (scale <= -66) {
state = EMOTION.SAD;
Expand Down Expand Up @@ -125,6 +135,7 @@ public void run() {
pic.setImageResource(R.drawable.face_concerned);
break;
case CRYING:
Log.w("Crying", "yeah buddy");
pic.setImageResource(R.drawable.face_crying);
break;
case DISGUSTED:
Expand Down Expand Up @@ -390,7 +401,7 @@ public void addHappiness(int toAdd)
{
happiness+=toAdd;
if(happiness>120)happiness=120;
if(happiness<-120)happiness=-120;
if(happiness<-120)happiness=-10;

}

Expand Down Expand Up @@ -421,5 +432,12 @@ public void loveMeCat(){
scale+=120;
reCalcFace();
}

public void cryingAt(){
scale = -166;
reCalcFace();
}
public void distgustedAt(){
scale = -180;
reCalcFace();
}
}
42 changes: 40 additions & 2 deletions RoboApp/app/src/main/java/com/robodoot/dr/RoboApp/FdActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public class FdActivity extends Activity implements GestureDetector.OnGestureLis
private ArrayList<String> result;
private static final String good = "good";
private static final String bad = "bad";
private static final String cry = "cry";
private static final String disgust = "stupid cat";

private GestureDetector gDetector;
public enum CHAR {U, D, L, R}
Expand Down Expand Up @@ -173,6 +175,8 @@ public enum Directions {UP, DOWN, LEFT, RIGHT, CENTER}
// private variables for accelerometer declatation
private SensorManager senSensorManager;
private Sensor senAccelerometer;
private long lastUpdate = 0;
private float last_x, last_y, last_z;


// Function to open menu activity
Expand Down Expand Up @@ -375,8 +379,29 @@ public void onClick(View v){

// for logging accelerometer data
@Override
public void onSensorChanged(SensorEvent event){

public void onSensorChanged(SensorEvent sensorEvent){
Sensor mySensor = sensorEvent.sensor;
if (mySensor.getType() == Sensor.TYPE_ACCELEROMETER){
float x = sensorEvent.values[0];
float y = sensorEvent.values[1];
float z = sensorEvent.values[2];

long curTime = System.currentTimeMillis();
if ((curTime - lastUpdate) > 100){
long diffTime = (curTime - lastUpdate);
lastUpdate = curTime;

String xs = Float.toString(sensorEvent.values[0]);
String ys = Float.toString(sensorEvent.values[1]);
String zs = Float.toString(sensorEvent.values[2]);

Log.w("Accelerometer", "(" + xs + ", " + ys + ", " + zs + ")");

last_x = x;
last_y = y;
last_z = z;
}
}
}

// for logging accelerometer data
Expand Down Expand Up @@ -708,6 +733,15 @@ else if (result.contains("bad")) {
//Make the cat mad.
kitty.frownedAt();
}
else if (result.contains("cry")){
//Make the cat cry
Log.w("Cryingwah", "This is happening");
kitty.cryingAt();
}
else if (result.contains("stupid cat")){
//Make cat disgusted
kitty.distgustedAt();
}
else if (result.contains("left")) {
//Make the cat head move left
virtualCat.turnHeadLeft();
Expand Down Expand Up @@ -748,6 +782,10 @@ else if (result.contains("menu")) {
else if (result.contains("love")) {
kitty.loveMeCat();
}
else if (result.contains("find") && result.contains("me")){
Intent intent = new Intent("com.google.android.gms.samples.vision.face.facetracker.FaceTrackerActivity");
startActivity(intent);
}
else {
Context context = getApplicationContext();
CharSequence commandNotFound = "Command not found!";
Expand Down
1 change: 0 additions & 1 deletion RoboApp/appFaceTracker/appFaceTracker.iml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,5 @@
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-vision-9.4.0" level="project" />
<orderEntry type="library" exported="" name="design-24.2.1" level="project" />
<orderEntry type="library" exported="" name="android-android-24" level="project" />
</component>
</module>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is auto-generated. DO NOT MODIFY.
* Original file: C:\\linux_files\\RoboApp\\RoboApp\\openCVLibrary300\\src\\main\\aidl\\org\\opencv\\engine\\OpenCVEngineInterface.aidl
* Original file: E:\\Alex Vild\\Documents\\School\\4560\\master\\RoboApp\\RoboApp\\openCVLibrary300\\src\\main\\aidl\\org\\opencv\\engine\\OpenCVEngineInterface.aidl
*/
package org.opencv.engine;
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is auto-generated. DO NOT MODIFY.
* Original file: C:\\linux_files\\RoboApp\\RoboApp\\openCVLibrary300\\src\\main\\aidl\\org\\opencv\\engine\\OpenCVEngineInterface.aidl
* Original file: E:\\Alex Vild\\Documents\\School\\4560\\master\\RoboApp\\RoboApp\\openCVLibrary300\\src\\main\\aidl\\org\\opencv\\engine\\OpenCVEngineInterface.aidl
*/
package org.opencv.engine;
/**
Expand Down
Loading

0 comments on commit 52954c1

Please sign in to comment.