Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
4f604b1
initial commit
lydiaxing Feb 18, 2017
d93f584
working??? I want to sleep
camilo86 Feb 18, 2017
03db5b6
merged with week 0
lydiaxing Feb 18, 2017
880a5ae
only bug need to press b to start driving
camilo86 Feb 18, 2017
2f0183b
pressed ctrl-alt-l
camilo86 Feb 18, 2017
aa27b90
dt auto
Feb 18, 2017
f5bf989
auto
camilo86 Feb 18, 2017
7a17711
updated framework
camilo86 Feb 18, 2017
3a783a8
merged week0 into
Feb 18, 2017
9265b9c
switched to 1 second auto
NUTRONSDS Feb 19, 2017
c95192f
updated to add drive distance auto
NUTRONSDS Feb 19, 2017
a521b69
Added drive hold heading command and changed holdHeading to
Brinbri Feb 19, 2017
e0117d8
Updated to latest commit of week0-auto Framework and added drivetele …
NUTRONSDS Feb 19, 2017
3680227
updated some stuff
NUTRONSDS Feb 19, 2017
1a9574f
doing stuff on Escape Velocity
NUTRONSDS Feb 19, 2017
e251556
updated framework
NUTRONSDS Feb 19, 2017
4db3495
updated to have better interfaces
NUTRONSDS Feb 19, 2017
502898b
reverted RobotMap
NUTRONSDS Feb 19, 2017
4091e14
added turn to angle
Feb 20, 2017
c14460e
Added Gearplace subsystem, works with FRamework
Feb 20, 2017
84f3063
Merged with master
Feb 20, 2017
cc05ddf
turret working, pid nees to be tuned
lydiaxing Feb 20, 2017
ef8964f
working turret
lydiaxing Feb 20, 2017
ace0949
updated framework
Feb 20, 2017
c34b149
with new framework version
NUTRONSDS Feb 20, 2017
25d175f
reverted robotmap
NUTRONSDS Feb 20, 2017
f7b521c
fixed climbtake bug
lydiaxing Feb 20, 2017
2d60401
working distance
NUTRONSDS Feb 20, 2017
e2f2b41
fixed turn
NUTRONSDS Feb 20, 2017
8c23e66
some testing
NUTRONSDS Feb 21, 2017
2d4682d
joystick stuff added but untested
lydiaxing Feb 21, 2017
0665efc
starting on step #3 of email
lydiaxing Feb 21, 2017
786f93c
added 254 app, still getting red bar munching error
lydiaxing Feb 21, 2017
95aa811
update variable stays null
lydiaxing Feb 21, 2017
879ddcf
working
NUTRONSDS Feb 21, 2017
2648765
updated to newest week0-auto
Feb 21, 2017
7b6302b
merged master into week0-auto
Feb 21, 2017
1270283
updated framework submodule, fixed checkstyle warnings
Feb 21, 2017
b359013
test reimplementation
Feb 21, 2017
0366787
ready to test turret with new vision
lydiaxing Feb 21, 2017
1f24a0b
fixed angle calculation
lydiaxing Feb 21, 2017
90062f2
merged master
lydiaxing Feb 21, 2017
f2ceb07
merged with master
lydiaxing Feb 21, 2017
b2730cc
made edits on style and consistency with master
lydiaxing Feb 21, 2017
7849ddf
updated FRamework
lydiaxing Feb 21, 2017
fb655b8
Merged!
Feb 21, 2017
378717c
Fixed merge conflicts
Feb 21, 2017
ecf07d8
added distance function, but need to edit constants
lydiaxing Feb 21, 2017
0f8e8bb
updated FRamework
lydiaxing Feb 21, 2017
2c8019b
figured out what constants are and renamed accordingly
lydiaxing Feb 21, 2017
0529ab8
working encoder and gyro pid
NUTRONSDS Feb 21, 2017
a8b757b
merged master into drive-holdheading-encoder-pid
Feb 21, 2017
0d519d8
removed duplicate method, added javadoc, added auto
Feb 21, 2017
8c92b0a
pid turret working
lydiaxing Feb 22, 2017
0561178
updated frameworK'
Feb 22, 2017
a479f5a
Merge branch 'master' into Gear-Placer
Feb 22, 2017
5305da8
Renamed stuffs
Feb 22, 2017
cc2f7c6
Turns checkstyle back on
Feb 22, 2017
e547039
style and javadocs
Feb 22, 2017
cd51c5c
Merge branch 'master' into drive-holdheading-encoder-pid
Feb 22, 2017
990ac7c
FIXED CHECKSTYLE!
lydiaxing Feb 22, 2017
3baf0e7
Merge branch 'workingAndroidVision' of https://github.com/frc125/NU17…
lydiaxing Feb 22, 2017
7377590
changed to constant naming convention
Feb 22, 2017
08d279b
Merge branch 'master' into Gear-Placer
Feb 22, 2017
fa180d5
Changed port!
Feb 22, 2017
d4aa8a7
change controls
NUTRONSDS Feb 22, 2017
e9ef5c3
fixed merge conflicts
lydiaxing Feb 22, 2017
8be8ccf
merged master
lydiaxing Feb 22, 2017
117ec1a
merged
NUTRONSDS Feb 22, 2017
20b6237
made angle update faster and added distance calculation
lydiaxing Feb 24, 2017
9a40f38
fixed checkstyle
lydiaxing Feb 25, 2017
d8d45cb
distance now working
lydiaxing Feb 27, 2017
5074042
tested setpoints
lydiaxing Feb 28, 2017
96d4bdb
reverted trying to merge auto in workingAndroidVision
lydiaxing Mar 2, 2017
560720d
added feeder auto command
Mar 2, 2017
e251ae5
added shooter auto command that *should* work, adjusted getDistance i…
Mar 2, 2017
04d6ff4
added boolean boxes, untested
lydiaxing Mar 2, 2017
3869b09
Merge commit '04d6ff441148cfdf896bf4cb2b68268b563a48ee' into android-…
NUTRONSDS Mar 2, 2017
8ce8adc
auto things
NUTRONSDS Mar 2, 2017
8e3337f
shooting working
NUTRONSDS Mar 2, 2017
c740a45
working
NUTRONSDS Mar 2, 2017
e1b4f00
Merge branch 'android-vision-2-with-autos' into florida
NUTRONSDS Mar 2, 2017
cedf135
modified tolerances
NUTRONSDS Mar 2, 2017
83ecdfd
turret command
NUTRONSDS Mar 2, 2017
6602aea
merged encoder auto drive stuff
NUTRONSDS Mar 2, 2017
e8748a4
kinda working
NUTRONSDS Mar 2, 2017
befc7f2
auto selector
NUTRONSDS Mar 2, 2017
db733c1
multi auto
NUTRONSDS Mar 2, 2017
2ca6ad3
end of practice day, florida
NUTRONSDS Mar 3, 2017
c8e1149
fixed how we terminate some of our autos... I really should have fixe…
Mar 3, 2017
dedb8f3
commandified shooter
Mar 3, 2017
8a19c90
made turret changes, hopefully commandified
Mar 3, 2017
63e953a
merged in gear placer
Mar 3, 2017
1b92526
changed servo 'setpoints,' fixed some naming
Mar 3, 2017
59d71e9
added gearplacer command, changed how we flip servos
Mar 3, 2017
54088d1
fixed an oops
Mar 3, 2017
dbe7d12
fixed teleop usage of commands
Mar 3, 2017
845efcd
Merge branch 'florida' into florida-commandify-shooting
NUTRONSDS Mar 3, 2017
800056b
Added joystick hint and remapped things,
NUTRONSDS Mar 3, 2017
ebc1c1c
working! made turret slower on joystick
NUTRONSDS Mar 3, 2017
c5c4db9
got tuned turret
NUTRONSDS Mar 3, 2017
23190f8
Ayy lmao
NUTRONSDS Mar 3, 2017
f4c2751
tuned turret PID to be within ~1.5 degrees
NUTRONSDS Mar 3, 2017
98fff4a
edited 40kpa auto distances
NUTRONSDS Mar 3, 2017
1f008d5
now using less drive delay
Mar 4, 2017
7834581
added 40kpa auto
NUTRONSDS Mar 4, 2017
045371d
clean before milo fix
NUTRONSDS Mar 4, 2017
d82876f
memory fixes
Mar 4, 2017
2aca4d9
fixed npe
NUTRONSDS Mar 4, 2017
e70008b
cleaned class a little, removed leak from dashboard subscription
Mar 5, 2017
3023a69
actually really actually fixed memory
Mar 7, 2017
9776f73
updated FRamework submodule
Mar 8, 2017
1158552
added teleControl command
lydiaxing Mar 10, 2017
c9fae4a
split pid and joy
lydiaxing Mar 12, 2017
d3be661
Continued some tuning not there just yet.
AndreasLc1103 Mar 12, 2017
70aee1b
its working ayy
AndreasLc1103 Mar 13, 2017
0a7471f
Got turret to work no more manual/pid
AndreasLc1103 Mar 14, 2017
caedbc9
changed variable setpoint formula
lydiaxing Mar 15, 2017
2294638
added Asher's sketchy gui simulation!
Mar 15, 2017
9805e99
updated FRamework
Mar 15, 2017
e6aef35
Merge remote-tracking branch 'origin/florida' into simulation
Mar 15, 2017
00c5883
turret changes
Mar 15, 2017
2928d70
Merge remote-tracking branch 'origin/turret-control' into unbag-testing
Mar 15, 2017
65307d5
added rear view camera and it works
AndreasLc1103 Mar 16, 2017
8e55905
Just some testing changes
AndreasLc1103 Mar 16, 2017
852af0a
minor turret change to make button functional again
Mar 16, 2017
171f718
updated FRamework
Mar 16, 2017
460c85c
some more stuff from testing
AndreasLc1103 Mar 17, 2017
3632b20
fixed usb camera, shortened auto times
NUTRONSDS Mar 17, 2017
2a2aaf9
edited drive distance
NUTRONSDS Mar 18, 2017
f412c04
working district
NUTRONSDS Mar 18, 2017
b4556b2
edited shooter setpoints
lydiaxing Mar 18, 2017
7411371
edit
NUTRONSDS Mar 19, 2017
d106761
ready to tune setpoints
lydiaxing Mar 21, 2017
ee22af5
ready to test exponential driving
lydiaxing Mar 21, 2017
ab59e1b
ready to test efficientauto
lydiaxing Mar 21, 2017
0df0609
ready to test forced feeder
lydiaxing Mar 21, 2017
06dfa2e
everything works except for feeder, shooter, roller
lydiaxing Mar 21, 2017
729c506
auto tuned and bugs fixed, order works
lydiaxing Mar 22, 2017
235e139
added some printlns
Mar 22, 2017
6f5aa69
New gear pickup code, with placing functionality
Mar 22, 2017
045131c
Merge remote-tracking branch 'origin/gear-testing' into efficientAuto
AndreasLc1103 Mar 22, 2017
056b1ab
Added updated version of FRamework with gear placer code
Mar 22, 2017
5621eb0
merged some gear stuff
AndreasLc1103 Mar 23, 2017
2892dd0
Added button functionality
Mar 23, 2017
19b6d09
did some tuning on the shooter for setpoints
AndreasLc1103 Mar 23, 2017
1d03e77
Merge remote-tracking branch 'origin/gear-testing' into efficientAuto
Mar 23, 2017
3ffc5b6
no longer using old gear placer
Mar 23, 2017
46d4d1b
have to hold button to run gear placer commands now
Mar 23, 2017
0378c3e
readded commented-out old gear placer, in case we have to switch back…
AndreasLc1103 Mar 23, 2017
3dbaef2
switched to old gear placing system, and now instantiating gear servos
NUTRONSDS Mar 24, 2017
4915687
auto with calculated setpoint
NUTRONSDS Mar 25, 2017
9422d50
RI before quals
NUTRONSDS Mar 25, 2017
ae1a4e3
using sendable chooser in sane fashion, formatted auto
NUTRONSDS Mar 25, 2017
401883e
working saturday
NUTRONSDS Mar 25, 2017
152daf3
saturday match 2
NUTRONSDS Mar 25, 2017
594d3e7
merged with new auto
NUTRONSDS Mar 25, 2017
9ca3a7b
end of RI
NUTRONSDS Mar 28, 2017
fe11b9f
added ramping - untested
NUTRONSDS Mar 28, 2017
6a5338b
manually added gear placer
lydiaxing Mar 30, 2017
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ install:
- sed -i 's/compiler="javac1.8"//g' wpilib/ant/build.xml
- sed -i 's/compiler="javac1.8"//g' *.xml
- sed -i 's/compiler="javac1.8"//g' FRamework/*.xml
- ant checkstyle
- ant compile
- ant checkstyle
2 changes: 1 addition & 1 deletion FRamework
Submodule FRamework updated 37 files
+9 −0 .idea/FRamework.iml
+15 −0 FRamework.iml
+6 −6 docs/google_checks.xml
+1 −0 ivy.xml
+4 −5 src/com/nutrons/framework/Robot.java
+10 −7 src/com/nutrons/framework/StreamManager.java
+65 −28 src/com/nutrons/framework/commands/Command.java
+1 −1 src/com/nutrons/framework/commands/CommandWorkUnit.java
+5 −5 src/com/nutrons/framework/commands/FlattenedTerminator.java
+9 −5 src/com/nutrons/framework/commands/ParallelCommand.java
+9 −5 src/com/nutrons/framework/commands/SerialCommand.java
+1 −0 src/com/nutrons/framework/controllers/ControllerEvent.java
+13 −0 src/com/nutrons/framework/controllers/Events.java
+1 −0 src/com/nutrons/framework/controllers/FollowEvent.java
+4 −0 src/com/nutrons/framework/controllers/LoopModeEvent.java
+5 −0 src/com/nutrons/framework/controllers/LoopPropertiesEvent.java
+4 −0 src/com/nutrons/framework/controllers/LoopSpeedController.java
+4 −0 src/com/nutrons/framework/controllers/ResetPositionEvent.java
+44 −0 src/com/nutrons/framework/controllers/RevServo.java
+5 −0 src/com/nutrons/framework/controllers/RunAtPowerEvent.java
+10 −0 src/com/nutrons/framework/controllers/ServoCommand.java
+17 −0 src/com/nutrons/framework/controllers/ServoController.java
+13 −0 src/com/nutrons/framework/controllers/ServoInstr.java
+31 −0 src/com/nutrons/framework/controllers/SetAngleCommand.java
+33 −0 src/com/nutrons/framework/controllers/SetCommand.java
+5 −0 src/com/nutrons/framework/controllers/SetReversedSensorEvent.java
+5 −0 src/com/nutrons/framework/controllers/SetpointEvent.java
+14 −3 src/com/nutrons/framework/controllers/Talon.java
+110 −3 src/com/nutrons/framework/controllers/VirtualSpeedController.java
+43 −0 src/com/nutrons/framework/inputs/RadioBox.java
+4 −5 src/com/nutrons/framework/inputs/Serial.java
+4 −1 src/com/nutrons/framework/subsystems/WpiSmartDashboard.java
+34 −11 src/com/nutrons/framework/util/FlowOperators.java
+4 −26 test/com/nutrons/framework/test/MultiCommandTest.java
+31 −11 test/com/nutrons/framework/test/TestCommand.java
+14 −0 test/com/nutrons/framework/test/TestConnectables.java
+94 −0 test/com/nutrons/framework/test/TestSwitchCommand.java
107 changes: 0 additions & 107 deletions arduino/vision_runner/vision_runner.ino

This file was deleted.

2 changes: 1 addition & 1 deletion install-ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
ivy is in at least one of ant's lib dir or the local dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
Expand Down
1 change: 1 addition & 0 deletions ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<dependency org="junit" name="junit" rev="4.12"/>
<dependency org="org.apache.ant" name="ant-junit" rev="1.9.7"/>
<dependency org="com.puppycrawl.tools" name="checkstyle" rev="7.4"/>
<dependency org="com.googlecode.json-simple" name="json-simple" rev="1.1.1"/>
</dependencies>
</ivy-module>
113 changes: 113 additions & 0 deletions src/com/libKudos254/Rotation2d.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package com.libKudos254;

import java.text.DecimalFormat;

/**
* A rotation in a 2d coordinate frame represented a point on the unit circle
* (cosine and sine).
*
* Inspired by Sophus (https://github.com/strasdat/Sophus/tree/master/sophus)
*/
public class Rotation2d {
protected static final double kEpsilon = 1E-9;

protected double cos_angle_;
protected double sin_angle_;

public Rotation2d() {
this(1, 0, false);
}

public Rotation2d(double x, double y, boolean normalize) {
cos_angle_ = x;
sin_angle_ = y;
if (normalize) {
normalize();
}
}

public Rotation2d(Rotation2d other) {
cos_angle_ = other.cos_angle_;
sin_angle_ = other.sin_angle_;
}

public static Rotation2d fromRadians(double angle_radians) {
return new Rotation2d(Math.cos(angle_radians), Math.sin(angle_radians), false);
}

public static Rotation2d fromDegrees(double angle_degrees) {
return fromRadians(Math.toRadians(angle_degrees));
}

/**
* From trig, we know that sin^2 + cos^2 == 1, but as we do math on this
* object we might accumulate rounding errors. Normalizing forces us to
* re-scale the sin and cos to reset rounding errors.
*/
public void normalize() {
double magnitude = Math.hypot(cos_angle_, sin_angle_);
if (magnitude > kEpsilon) {
sin_angle_ /= magnitude;
cos_angle_ /= magnitude;
} else {
sin_angle_ = 0;
cos_angle_ = 1;
}
}

public double cos() {
return cos_angle_;
}

public double sin() {
return sin_angle_;
}

public double tan() {
if (cos_angle_ < kEpsilon) {
if (sin_angle_ >= 0.0) {
return Double.POSITIVE_INFINITY;
} else {
return Double.NEGATIVE_INFINITY;
}
}
return sin_angle_ / cos_angle_;
}

public double getRadians() {
return Math.atan2(sin_angle_, cos_angle_);
}

public double getDegrees() {
return Math.toDegrees(getRadians());
}

/**
* We can rotate this Rotation2d by adding together the effects of it and
* another rotation.
*
* @param other
* The other rotation. See:
* https://en.wikipedia.org/wiki/Rotation_matrix
* @return This rotation rotated by other.
*/
public Rotation2d rotateBy(Rotation2d other) {
return new Rotation2d(cos_angle_ * other.cos_angle_ - sin_angle_ * other.sin_angle_,
cos_angle_ * other.sin_angle_ + sin_angle_ * other.cos_angle_, true);
}

/**
* The inverse of a Rotation2d "undoes" the effect of this rotation.
*
* @return The opposite of this rotation.
*/
public Rotation2d inverse() {
return new Rotation2d(cos_angle_, -sin_angle_, false);
}

@Override
public String toString() {
final DecimalFormat fmt = new DecimalFormat("#0.000");
return "(" + fmt.format(getDegrees()) + " deg)";
}
}
80 changes: 80 additions & 0 deletions src/com/libKudos254/vision/AdbBridge.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package com.libKudos254.vision;

import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
* AdbBridge interfaces to an Android Debug Bridge (adb) binary, which is needed
* to communicate to Android devices over USB.
*
* adb binary provided by https://github.com/Spectrum3847/RIOdroid
*/
public class AdbBridge {
Path bin_location_;
public final static Path DEFAULT_LOCATION = Paths.get("/usr/bin/adb");

public AdbBridge() {
Path adb_location;
String env_val = System.getenv("FRC_ADB_LOCATION");
if (env_val == null || "".equals(env_val)) {
adb_location = DEFAULT_LOCATION;
} else {
adb_location = Paths.get(env_val);
}
bin_location_ = adb_location;
}

public AdbBridge(Path location) {
bin_location_ = location;
}

private boolean runCommand(String args) {
Runtime r = Runtime.getRuntime();
String cmd = bin_location_.toString() + " " + args;

try {
Process p = r.exec(cmd);
p.waitFor();
} catch (IOException e) {
System.err.println("AdbBridge: Could not run command " + cmd);
e.printStackTrace();
return false;
} catch (InterruptedException e) {
System.err.println("AdbBridge: Could not run command " + cmd);
e.printStackTrace();
return false;
}
return true;
}

public void start() {
System.out.println("Starting adb");
runCommand("start");
}

public void stop() {
System.out.println("Stopping adb");
runCommand("kill-server");
}

public void restartAdb() {
System.out.println("Restarting adb");
stop();
start();
}

public void portForward(int local_port, int remote_port) {
runCommand("forward tcp:" + local_port + " tcp:" + remote_port);
}

public void reversePortForward(int remote_port, int local_port) {
runCommand("reverse tcp:" + remote_port + " tcp:" + local_port);
}

public void restartApp() {
System.out.println("Restarting app");
runCommand("shell am force-stop com.team254.cheezdroid \\; "
+ "am start com.team254.cheezdroid/com.team254.cheezdroid.VisionTrackerActivity");
}
}
66 changes: 66 additions & 0 deletions src/com/libKudos254/vision/CrashTracker.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.libKudos254.vision;

import java.io.*;
import java.util.Date;
import java.util.UUID;

/**
* Tracks start-up and caught crash events, logging them to a file which dosn't
* roll over
*/
public class CrashTracker {

private static final UUID RUN_INSTANCE_UUID = UUID.randomUUID();

public static void logRobotStartup() {
logMarker("robot startup");
}

public static void logRobotConstruction() {
logMarker("robot startup");
}

public static void logRobotInit() {
logMarker("robot init");
}

public static void logTeleopInit() {
logMarker("teleop init");
}

public static void logAutoInit() {
logMarker("auto init");
}

public static void logDisabledInit() {
logMarker("disabled init");
}

public static void logThrowableCrash(Throwable throwable) {
logMarker("Exception", throwable);
}

private static void logMarker(String mark) {
logMarker(mark, null);
}

private static void logMarker(String mark, Throwable nullableException) {

try (PrintWriter writer = new PrintWriter(new FileWriter("/home/lvuser/crash_tracking.txt", true))) {
writer.print(RUN_INSTANCE_UUID.toString());
writer.print(", ");
writer.print(mark);
writer.print(", ");
writer.print(new Date().toString());

if (nullableException != null) {
writer.print(", ");
nullableException.printStackTrace(writer);
}

writer.println();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Loading