Skip to content

Commit e2422c9

Browse files
committed
Initial commit. Mean, median and low-pass filter exist as averaging filters. Orientation IMU fusions exist in the Complimentary and Kalman varieties. A LowPassFilter can utilize any of these filters to estimate linear acceleration.
0 parents  commit e2422c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2227
-0
lines changed

.gitignore

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Built application files
2+
*.apk
3+
*.ap_
4+
5+
# Files for the ART/Dalvik VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# Generated files
12+
bin/
13+
gen/
14+
out/
15+
16+
# Gradle files
17+
.gradle/
18+
build/
19+
gradle.properties
20+
21+
# Local configuration file (sdk path, etc)
22+
local.properties
23+
24+
# Proguard folder generated by Eclipse
25+
proguard/
26+
27+
# Log Files
28+
*.log
29+
30+
# Android Studio Navigation editor temp files
31+
.navigation/
32+
33+
# Android Studio captures folder
34+
captures/
35+
36+
# Intellij
37+
*.iml
38+
.idea/workspace.xml
39+
.idea/tasks.xml
40+
.idea/gradle.xml
41+
.idea/dictionaries
42+
.idea/libraries
43+
44+
# External native build folder generated in Android Studio 2.2 and later
45+
.externalNativeBuild
46+
47+
# Google Services (e.g. APIs or Firebase)
48+
google-services.json
49+
50+
# Freeline
51+
freeline.py
52+
freeline/
53+
freeline_project_description.json
54+
.idea/
55+

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 26
5+
buildToolsVersion "26.0.0"
6+
defaultConfig {
7+
applicationId "com.kircherelectronics.fsensor"
8+
minSdkVersion 15
9+
targetSdkVersion 26
10+
versionCode 1
11+
versionName "1.0"
12+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25+
exclude group: 'com.android.support', module: 'support-annotations'
26+
})
27+
compile 'com.android.support:appcompat-v7:26.+'
28+
testCompile 'junit:junit:4.12'
29+
}

app/proguard-rules.pro

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/kaleb/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
18+
19+
# Uncomment this to preserve the line number information for
20+
# debugging stack traces.
21+
#-keepattributes SourceFile,LineNumberTable
22+
23+
# If you keep the line number information, uncomment this to
24+
# hide the original source file name.
25+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.kircherelectronics.fsensor;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumentation test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.kircherelectronics.fsensor", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
3+
package="com.kircherelectronics.fsensor">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
13+
</application>
14+
15+
</manifest>
3.34 KB
Loading
Loading
2.15 KB
Loading
Loading
4.73 KB
Loading
Loading
7.54 KB
Loading
Loading
10.2 KB
Loading
Loading

app/src/main/res/values/colors.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="colorPrimary">#3F51B5</color>
4+
<color name="colorPrimaryDark">#303F9F</color>
5+
<color name="colorAccent">#FF4081</color>
6+
</resources>

app/src/main/res/values/strings.xml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">FSensor</string>
3+
</resources>

app/src/main/res/values/styles.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5+
<!-- Customize your theme here. -->
6+
<item name="colorPrimary">@color/colorPrimary</item>
7+
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
8+
<item name="colorAccent">@color/colorAccent</item>
9+
</style>
10+
11+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.kircherelectronics.fsensor;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.*;
6+
7+
/**
8+
* Example local unit test, which will execute on the development machine (host).
9+
*
10+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
11+
*/
12+
public class ExampleUnitTest {
13+
@Test
14+
public void addition_isCorrect() throws Exception {
15+
assertEquals(4, 2 + 2);
16+
}
17+
}

build.gradle

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:2.3.3'
9+
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
jcenter()
18+
}
19+
}
20+
21+
task clean(type: Delete) {
22+
delete rootProject.buildDir
23+
}

fsensor/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

fsensor/build.gradle

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 26
5+
buildToolsVersion "26.0.0"
6+
7+
defaultConfig {
8+
minSdkVersion 15
9+
targetSdkVersion 26
10+
versionCode 1
11+
versionName "1.0"
12+
13+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14+
15+
}
16+
buildTypes {
17+
release {
18+
minifyEnabled false
19+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20+
}
21+
}
22+
}
23+
24+
dependencies {
25+
compile fileTree(dir: 'libs', include: ['*.jar'])
26+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27+
exclude group: 'com.android.support', module: 'support-annotations'
28+
})
29+
testCompile 'junit:junit:4.12'
30+
31+
compile files('libs/commons-math3-3.6.1.jar')
32+
}

fsensor/libs/commons-math3-3.6.1.jar

2.11 MB
Binary file not shown.

fsensor/proguard-rules.pro

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/kaleb/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
18+
19+
# Uncomment this to preserve the line number information for
20+
# debugging stack traces.
21+
#-keepattributes SourceFile,LineNumberTable
22+
23+
# If you keep the line number information, uncomment this to
24+
# hide the original source file name.
25+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.kircherelectronics.fsensor;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumentation test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.kircherelectronics.fsesnor.test", appContext.getPackageName());
25+
}
26+
}

fsensor/src/main/AndroidManifest.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
3+
package="com.kircherelectronics.fsensor">
4+
5+
<application android:allowBackup="true" android:label="@string/app_name" android:supportsRtl="true">
6+
7+
</application>
8+
9+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.kircherelectronics.fsensor.filter;
2+
3+
/**
4+
* Created by kaleb on 7/6/17.
5+
*/
6+
7+
public interface BaseFilter {
8+
float[] filter(float[] values);
9+
void setTimeConstant(float timeConstant);
10+
void reset();
11+
}

0 commit comments

Comments
 (0)