-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructured repository and added field image
- Loading branch information
1 parent
f1790cd
commit 79f9f2c
Showing
99 changed files
with
1,793 additions
and
1,793 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
106 changes: 53 additions & 53 deletions
106
...am254/lib/util/CircularBufferGeneric.java → ...am254/lib/util/CircularBufferGeneric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
package com.team254.lib.util; | ||
|
||
import java.util.LinkedList; | ||
|
||
/** | ||
* Implements a simple circular buffer. | ||
* Can be used for any class. | ||
*/ | ||
public class CircularBufferGeneric<E> { | ||
final int mWindowSize; | ||
final LinkedList<E> mSamples; | ||
double mSum; | ||
|
||
public CircularBufferGeneric(int window_size) { | ||
mWindowSize = window_size; | ||
mSamples = new LinkedList<>(); | ||
mSum = 0.0; | ||
} | ||
|
||
|
||
public void clear() { | ||
mSamples.clear(); | ||
mSum = 0.0; | ||
} | ||
|
||
public void addValue(E val) { | ||
mSamples.addLast(val); | ||
if (mSamples.size() > mWindowSize) { | ||
mSamples.removeFirst(); | ||
} | ||
} | ||
|
||
public int getNumValues() { | ||
return mSamples.size(); | ||
} | ||
|
||
public boolean isFull() { | ||
return mWindowSize == mSamples.size(); | ||
} | ||
|
||
public LinkedList<E> getLinkedList() { | ||
/* | ||
* NOTE: To get an Array of the specific class type which the instance is using, | ||
* you have to use this specific code: | ||
* specificCircularBufferGeneric.getLinkedList().toArray(new ClassThatIWant[specificCircularBufferGeneric | ||
* .getLinkedList().size()]); | ||
* The reason is that for some reason an array of a generic class(i.e. E[]) cannot be created because | ||
* of some archaic data flow ambiguities | ||
*/ | ||
|
||
return mSamples; | ||
} | ||
} | ||
package com.team254.lib.util; | ||
|
||
import java.util.LinkedList; | ||
|
||
/** | ||
* Implements a simple circular buffer. | ||
* Can be used for any class. | ||
*/ | ||
public class CircularBufferGeneric<E> { | ||
final int mWindowSize; | ||
final LinkedList<E> mSamples; | ||
double mSum; | ||
|
||
public CircularBufferGeneric(int window_size) { | ||
mWindowSize = window_size; | ||
mSamples = new LinkedList<>(); | ||
mSum = 0.0; | ||
} | ||
|
||
|
||
public void clear() { | ||
mSamples.clear(); | ||
mSum = 0.0; | ||
} | ||
|
||
public void addValue(E val) { | ||
mSamples.addLast(val); | ||
if (mSamples.size() > mWindowSize) { | ||
mSamples.removeFirst(); | ||
} | ||
} | ||
|
||
public int getNumValues() { | ||
return mSamples.size(); | ||
} | ||
|
||
public boolean isFull() { | ||
return mWindowSize == mSamples.size(); | ||
} | ||
|
||
public LinkedList<E> getLinkedList() { | ||
/* | ||
* NOTE: To get an Array of the specific class type which the instance is using, | ||
* you have to use this specific code: | ||
* specificCircularBufferGeneric.getLinkedList().toArray(new ClassThatIWant[specificCircularBufferGeneric | ||
* .getLinkedList().size()]); | ||
* The reason is that for some reason an array of a generic class(i.e. E[]) cannot be created because | ||
* of some archaic data flow ambiguities | ||
*/ | ||
|
||
return mSamples; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 22 additions & 22 deletions
44
...team254/lib/util/InverseInterpolable.java → ...team254/lib/util/InverseInterpolable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
package com.team254.lib.util; | ||
|
||
/** | ||
* InverseInterpolable is an interface used by an Interpolating Tree as the Key type. Given two endpoint keys and a | ||
* third query key, an InverseInterpolable object can calculate the interpolation parameter of the query key on the | ||
* interval [0, 1]. | ||
* | ||
* @param <T> The Type of InverseInterpolable | ||
* @see InterpolatingTreeMap | ||
*/ | ||
public interface InverseInterpolable<T> { | ||
/** | ||
* Given this point (lower), a query point (query), and an upper point (upper), estimate how far (on [0, 1]) between | ||
* 'lower' and 'upper' the query point lies. | ||
* | ||
* @param upper | ||
* @param query | ||
* @return The interpolation parameter on [0, 1] representing how far between this point and the upper point the | ||
* query point lies. | ||
*/ | ||
double inverseInterpolate(T upper, T query); | ||
} | ||
package com.team254.lib.util; | ||
|
||
/** | ||
* InverseInterpolable is an interface used by an Interpolating Tree as the Key type. Given two endpoint keys and a | ||
* third query key, an InverseInterpolable object can calculate the interpolation parameter of the query key on the | ||
* interval [0, 1]. | ||
* | ||
* @param <T> The Type of InverseInterpolable | ||
* @see InterpolatingTreeMap | ||
*/ | ||
public interface InverseInterpolable<T> { | ||
/** | ||
* Given this point (lower), a query point (query), and an upper point (upper), estimate how far (on [0, 1]) between | ||
* 'lower' and 'upper' the query point lies. | ||
* | ||
* @param upper | ||
* @param query | ||
* @return The interpolation parameter on [0, 1] representing how far between this point and the upper point the | ||
* query point lies. | ||
*/ | ||
double inverseInterpolate(T upper, T query); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
80 changes: 40 additions & 40 deletions
80
...om/team319/follower/SrxMotionProfile.java → ...om/team319/follower/SrxMotionProfile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
/** | ||
* Copyright (c) 2018 Team319 | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
package com.team319.follower; | ||
|
||
//Generic Motion Profile Class | ||
public class SrxMotionProfile { | ||
|
||
public int numPoints; | ||
// Position (rotations) Velocity (RPM) Duration (ms) | ||
public double[][] points; | ||
|
||
public SrxMotionProfile() { | ||
|
||
} | ||
|
||
public SrxMotionProfile(int numPoints, double[][] points) { | ||
this.numPoints = numPoints; | ||
this.points = points; | ||
} | ||
} | ||
/** | ||
* Copyright (c) 2018 Team319 | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
package com.team319.follower; | ||
|
||
//Generic Motion Profile Class | ||
public class SrxMotionProfile { | ||
|
||
public int numPoints; | ||
// Position (rotations) Velocity (RPM) Duration (ms) | ||
public double[][] points; | ||
|
||
public SrxMotionProfile() { | ||
|
||
} | ||
|
||
public SrxMotionProfile(int numPoints, double[][] points) { | ||
this.numPoints = numPoints; | ||
this.points = points; | ||
} | ||
} |
84 changes: 42 additions & 42 deletions
84
...y/com/team319/follower/SrxTrajectory.java → ...c/com/team319/follower/SrxTrajectory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
/** | ||
* Copyright (c) 2018 Team319 | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
package com.team319.follower; | ||
|
||
//Combines left and right motion profiles in one object | ||
public class SrxTrajectory { | ||
public boolean flipped; | ||
public boolean highGear; | ||
public SrxMotionProfile leftProfile; | ||
public SrxMotionProfile centerProfile; | ||
public SrxMotionProfile rightProfile; | ||
|
||
public SrxTrajectory() { | ||
|
||
} | ||
|
||
public SrxTrajectory(SrxMotionProfile left, SrxMotionProfile center, SrxMotionProfile right) { | ||
this.leftProfile = left; | ||
this.centerProfile = center; | ||
this.rightProfile = right; | ||
} | ||
} | ||
/** | ||
* Copyright (c) 2018 Team319 | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
package com.team319.follower; | ||
|
||
//Combines left and right motion profiles in one object | ||
public class SrxTrajectory { | ||
public boolean flipped; | ||
public boolean highGear; | ||
public SrxMotionProfile leftProfile; | ||
public SrxMotionProfile centerProfile; | ||
public SrxMotionProfile rightProfile; | ||
|
||
public SrxTrajectory() { | ||
|
||
} | ||
|
||
public SrxTrajectory(SrxMotionProfile left, SrxMotionProfile center, SrxMotionProfile right) { | ||
this.leftProfile = left; | ||
this.centerProfile = center; | ||
this.rightProfile = right; | ||
} | ||
} |
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 20 additions & 20 deletions
40
trajectory/jama/util/Maths.java → trajectory/src/jama/util/Maths.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package jama.util; | ||
|
||
public class Maths { | ||
|
||
/** sqrt(a^2 + b^2) without under/overflow. **/ | ||
|
||
public static double hypot(double a, double b) { | ||
double r; | ||
if (Math.abs(a) > Math.abs(b)) { | ||
r = b / a; | ||
r = Math.abs(a) * Math.sqrt(1 + r * r); | ||
} else if (b != 0) { | ||
r = a / b; | ||
r = Math.abs(b) * Math.sqrt(1 + r * r); | ||
} else { | ||
r = 0.0; | ||
} | ||
return r; | ||
} | ||
} | ||
package jama.util; | ||
|
||
public class Maths { | ||
|
||
/** sqrt(a^2 + b^2) without under/overflow. **/ | ||
|
||
public static double hypot(double a, double b) { | ||
double r; | ||
if (Math.abs(a) > Math.abs(b)) { | ||
r = b / a; | ||
r = Math.abs(a) * Math.sqrt(1 + r * r); | ||
} else if (b != 0) { | ||
r = a / b; | ||
r = Math.abs(b) * Math.sqrt(1 + r * r); | ||
} else { | ||
r = 0.0; | ||
} | ||
return r; | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
trajectory/module-info.java → trajectory/src/module-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module aluminatipath2 { | ||
opens org.aluminati3555.aluminatipath2; | ||
|
||
requires javafx.base; | ||
requires javafx.controls; | ||
requires java.desktop; | ||
module aluminatipath2 { | ||
opens org.aluminati3555.aluminatipath2; | ||
|
||
requires javafx.base; | ||
requires javafx.controls; | ||
requires java.desktop; | ||
} |
Oops, something went wrong.