From 75f1aea29d5fc245a2f46dfdc32bf865b86635ac Mon Sep 17 00:00:00 2001 From: lukesta182 <33330639+lukesta182@users.noreply.github.com> Date: Sat, 19 Jan 2019 10:03:34 -0700 Subject: [PATCH] elevator code fix changed last years elevator code to work with this years desine, no closed loop control implemented other than limit switches. --- .gradle/5.0/fileChanges/last-build.bin | Bin 0 -> 1 bytes .gradle/5.0/fileHashes/fileHashes.lock | Bin 0 -> 17 bytes .gradle/5.0/gc.properties | 0 .gradle/5.0/taskHistory/taskHistory.bin | Bin 0 -> 18733 bytes .gradle/5.0/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../buildOutputCleanup.lock | Bin 0 -> 17 bytes .gradle/buildOutputCleanup/cache.properties | 2 + .gradle/vcs-1/gc.properties | 0 2019robot/build.gradle | 5 +- 2019robot/src/main/deploy/example.txt | 2 +- .../frc4388/robot/subsystems/Elevator.java | 109 +++++------------- vendordeps/PathfinderOLD.json | 85 ++++++++++++++ vendordeps/Phoenix.json | 87 ++++++++++++++ vendordeps/REVRobotics.json | 32 +++++ vendordeps/navx_frc.json | 33 ++++++ 15 files changed, 274 insertions(+), 81 deletions(-) create mode 100644 .gradle/5.0/fileChanges/last-build.bin create mode 100644 .gradle/5.0/fileHashes/fileHashes.lock create mode 100644 .gradle/5.0/gc.properties create mode 100644 .gradle/5.0/taskHistory/taskHistory.bin create mode 100644 .gradle/5.0/taskHistory/taskHistory.lock create mode 100644 .gradle/buildOutputCleanup/buildOutputCleanup.lock create mode 100644 .gradle/buildOutputCleanup/cache.properties create mode 100644 .gradle/vcs-1/gc.properties create mode 100644 vendordeps/PathfinderOLD.json create mode 100644 vendordeps/Phoenix.json create mode 100644 vendordeps/REVRobotics.json create mode 100644 vendordeps/navx_frc.json diff --git a/.gradle/5.0/fileChanges/last-build.bin b/.gradle/5.0/fileChanges/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/.gradle/5.0/fileHashes/fileHashes.lock b/.gradle/5.0/fileHashes/fileHashes.lock new file mode 100644 index 0000000000000000000000000000000000000000..7323246d690ae41729efc2e0c41ebcc54b5ab401 GIT binary patch literal 17 TcmZQJufO$m@tmuB8K3|FK+y$S literal 0 HcmV?d00001 diff --git a/.gradle/5.0/gc.properties b/.gradle/5.0/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/5.0/taskHistory/taskHistory.bin b/.gradle/5.0/taskHistory/taskHistory.bin new file mode 100644 index 0000000000000000000000000000000000000000..3cec7366a113771a6dfd1d8debaf6d6e9082bb3b GIT binary patch literal 18733 zcmeI%u}T9m7{Kv67eNYEQ0OZNdP-F~D-}c+DcZ%M#7jJ5&*aEmPkj;xm%f0LzJP4<-F8cK)v@VGfCuFK3 zk?E)qc|VV&7KyQWq2oN-8R%5*no>J!E|n=dDzmOQ^7nde61{8Rk= 0) { - elevatorRight.set(moveElevatorInput); + elevatorMain.set(moveElevatorInput); } else if(elevatorPos > elevatorSafeZone) { - elevatorRight.set(moveElevatorInput * 0.65); + elevatorMain.set(moveElevatorInput * 0.65); if(holdButtonPressed == true) { - elevatorRight.set(-0.43 * (0.2)); + elevatorMain.set(-0.43 * (0.2)); } else if(holdButtonPressed == false) { - elevatorRight.set(moveElevatorInput * 0.75); + elevatorMain.set(moveElevatorInput * 0.75); } } else if(elevatorPos < 0) { - elevatorRight.set(moveElevatorInput * 0.75); + elevatorMain.set(moveElevatorInput * 0.75); } */ } @@ -268,12 +242,12 @@ public class Elevator extends Subsystem implements ControlLoopable //PID encoder position public double getEncoderElevatorPosition() { - return elevatorRight.getPositionWorld(); + return elevatorMain.getPositionWorld(); } public double getElevatorHeightInchesAboveFloor() { - return elevatorRight.getPositionWorld(); + return elevatorMain.getPositionWorld(); } public synchronized void setControlMode(DriveControlMode controlMode) @@ -316,23 +290,23 @@ public class Elevator extends Subsystem implements ControlLoopable } */ public void rawSetOutput(double output){ - elevatorRight.set(/*ControlMode.PercentOutput,*/ output); + elevatorMain.set(/*ControlMode.PercentOutput,*/ output); } public void holdInPos() { - elevatorRight.set(-0.43 * 0.2); + elevatorMain.set(-0.43 * 0.2); } public void stopMotors() { - elevatorRight.set(0); + elevatorMain.set(0); } public void isSwitchPressed() { pressed = false; - isPressed = elevatorRight.getSensorCollection(); + isPressed = elevatorMain.getSensorCollection(); if(isPressed.isFwdLimitSwitchClosed() == true) { @@ -370,22 +344,6 @@ public class Elevator extends Subsystem implements ControlLoopable else if (!isFinished) { //PID control mode - if(controlMode == DriveControlMode.MOVE_POSITION_MAX_SCALE) - { - isFinished = pidPositionControllerMaxScale.controlLoopUpdate(getEncoderElevatorPosition()); - } - else if(controlMode == DriveControlMode.MOVE_POSITION_LOW_SCALE) - { - isFinished = pidPositionControllerLowScale.controlLoopUpdate(getEncoderElevatorPosition()); - } - else if(controlMode == DriveControlMode.MOVE_POSITION_SWITCH) - { - isFinished = pidPositionControllerSwitch.controlLoopUpdate(getEncoderElevatorPosition()); - } - else if(controlMode == DriveControlMode.MOVE_POSITION_LOWEST) - { - isFinished = pidPositionControllerLowest.controlLoopUpdate(getEncoderElevatorPosition()); - } /* else if(controlMode == DriveControlMode.RAW) { @@ -410,11 +368,6 @@ public class Elevator extends Subsystem implements ControlLoopable public void setPeriodMs(long periodMs) { //PID controller - pidPositionControllerMaxScale = new SoftwarePIDPositionController(PositionPMaxScale, elevatorRight); - pidPositionControllerLowScale = new SoftwarePIDPositionController(PositionPLowScale, elevatorRight); - pidPositionControllerSwitch = new SoftwarePIDPositionController(PositionPSwitch, elevatorRight); - pidPositionControllerLowest = new SoftwarePIDPositionController(PositionPLowest, elevatorRight); - this.periodMs = periodMs; } @@ -434,7 +387,7 @@ public class Elevator extends Subsystem implements ControlLoopable { try { - SmartDashboard.putNumber("Elevator Pos Ticks", elevatorRight.getSelectedSensorPosition(0)); + SmartDashboard.putNumber("Elevator Pos Ticks", elevatorMain.getSelectedSensorPosition(0)); SmartDashboard.putNumber("Elevator Pos Inches", getElevatorHeightInchesAboveFloor()); //SmartDashboard.putData(pressed); } diff --git a/vendordeps/PathfinderOLD.json b/vendordeps/PathfinderOLD.json new file mode 100644 index 0000000..2551e4d --- /dev/null +++ b/vendordeps/PathfinderOLD.json @@ -0,0 +1,85 @@ +{ + "fileName": "PathfinderOLD.json", + "name": "PathfinderOld", + "version": "2019.1.11", + "uuid": "7194a2d4-2860-4bcc-86c0-97879737d875", + "mavenUrls": [ + "https://dev.imjac.in/maven" + ], + "jsonUrl": "https://dev.imjac.in/maven/jaci/pathfinder/PathfinderOLD-latest.json", + "cppDependencies": [ + { + "groupId": "jaci.pathfinder", + "artifactId": "Pathfinder-Core", + "version": "2019.1.11", + "libName": "pathfinder", + "configuration": "native_pathfinder_old", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxx86-64", + "windowsx86-64", + "osxx86-64", + "linuxathena", + "linuxraspbian" + ] + }, + { + "groupId": "jaci.pathfinder", + "artifactId": "Pathfinder-FRCSupport", + "version": "2019.1.11", + "libName": "pathfinder_frc", + "configuration": "native_pathfinder_old", + "headerClassifier": "headers", + "binaryPlatforms": [] + } + ], + "javaDependencies": [ + { + "groupId": "jaci.pathfinder", + "artifactId": "Pathfinder-Java", + "version": "2019.1.11" + }, + { + "groupId": "jaci.jniloader", + "artifactId": "JNILoader", + "version": "1.0.1" + }, + { + "groupId": "jaci.pathfinder", + "artifactId": "Pathfinder-FRCSupport", + "version": "2019.1.11" + } + ], + "jniDependencies": [ + { + "groupId": "jaci.pathfinder", + "artifactId": "Pathfinder-JNI", + "version": "2019.1.11", + "isJar": true, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxx86-64", + "windowsx86-64", + "osxx86-64", + "linuxathena", + "linuxraspbian" + ] + }, + { + "groupId": "jaci.pathfinder", + "artifactId": "Pathfinder-CoreJNI", + "version": "2019.1.11", + "isJar": true, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxx86-64", + "windowsx86-64", + "osxx86-64", + "linuxathena", + "linuxraspbian" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/Phoenix.json b/vendordeps/Phoenix.json new file mode 100644 index 0000000..a1654ec --- /dev/null +++ b/vendordeps/Phoenix.json @@ -0,0 +1,87 @@ +{ + "fileName": "Phoenix.json", + "name": "CTRE-Phoenix", + "version": "5.12.1", + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "mavenUrls": [ + "http://devsite.ctr-electronics.com/maven/release/" + ], + "jsonUrl": "http://devsite.ctr-electronics.com/maven/release/com/ctre/phoenix/Phoenix-latest.json", + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-java", + "version": "5.12.1" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-java", + "version": "5.12.1" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.12.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena", + "windowsx86-64", + "linuxx86-64" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-cpp", + "version": "5.12.1", + "libName": "CTRE_Phoenix_WPI", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena", + "windowsx86-64", + "linuxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-cpp", + "version": "5.12.1", + "libName": "CTRE_Phoenix", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena", + "windowsx86-64", + "linuxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.12.1", + "libName": "CTRE_PhoenixCCI", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena", + "windowsx86-64", + "linuxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "core", + "version": "5.12.1", + "libName": "CTRE_PhoenixCore", + "headerClassifier": "headers" + } + ] +} \ No newline at end of file diff --git a/vendordeps/REVRobotics.json b/vendordeps/REVRobotics.json new file mode 100644 index 0000000..d997798 --- /dev/null +++ b/vendordeps/REVRobotics.json @@ -0,0 +1,32 @@ +{ + "fileName": "REVRobotics.json", + "name": "REVRobotics", + "version": "1.0.26", + "uuid": "c16ed09f-23df-4beb-87e8-460bd7fa9924", + "mavenUrls": [ + "http://www.revrobotics.com/content/sw/max/sdk/maven/" + ], + "jsonUrl": "http://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json", + "javaDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "SparkMax-java", + "version": "1.0.26" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "SparkMax-cpp", + "version": "1.0.26", + "libName": "libSparkMax", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/navx_frc.json b/vendordeps/navx_frc.json new file mode 100644 index 0000000..80defba --- /dev/null +++ b/vendordeps/navx_frc.json @@ -0,0 +1,33 @@ +{ + "fileName": "navx_frc.json", + "name": "KauaiLabs_navX_FRC", + "version": "3.1.344", + "uuid": "cb311d09-36e9-4143-a032-55bb2b94443b", + "mavenUrls": [ + "https://repo1.maven.org/maven2/" + ], + "jsonUrl": "https://www.kauailabs.com/dist/frc/2019/navx_frc.json", + "javaDependencies": [ + { + "groupId": "com.kauailabs.navx.frc", + "artifactId": "navx-java", + "version": "3.1.344" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "com.kauailabs.navx.frc", + "artifactId": "navx-cpp", + "version": "3.1.344", + "headerClassifier": "headers", + "sourcesClassifier": "sources", + "sharedLibrary": false, + "libName": "navx_frc", + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + } + ] +} \ No newline at end of file