From 3cb6fb347aa5a67a090af7c62f00e1f20ee2ab88 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Wed, 7 Mar 2018 17:10:25 -0500 Subject: [PATCH 01/54] Added Buttons and got rid of errors --- .idea/.name | 1 + .idea/modules.xml | 1 + .idea/modules/Alloy_test.iml | 29 ++++++++++ build.gradle | 1 - .../alloy/ftc/FTCButton.java | 55 ++++++++++++++++++- .../alloy/test/TestRobot.java | 1 - .../alloy/update/Updatable.java | 2 +- 7 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 .idea/.name create mode 100644 .idea/modules/Alloy_test.iml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..7714568 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Alloy \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 07de6c1..9d7946a 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -5,6 +5,7 @@ + \ No newline at end of file diff --git a/.idea/modules/Alloy_test.iml b/.idea/modules/Alloy_test.iml new file mode 100644 index 0000000..a3178d0 --- /dev/null +++ b/.idea/modules/Alloy_test.iml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 57830b3..4482cb7 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,6 @@ repositories { maven { url "http://repo.maven.apache.org/maven2" } - } dependencies{ diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCButton.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCButton.java index 067e0d3..558738f 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCButton.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCButton.java @@ -1,5 +1,6 @@ package org.montclairrobotics.alloy.ftc; +import com.qualcomm.robotcore.hardware.Gamepad; import org.montclairrobotics.alloy.core.Button; import org.montclairrobotics.alloy.utils.Input; @@ -23,7 +24,7 @@ public FTCButton(Input buttonInput, boolean invert){ this.buttonInput = buttonInput; this.inverted = invert; } - + @Override public boolean getValue() { if(inverted) { @@ -32,4 +33,56 @@ public boolean getValue() { return buttonInput.get(); } } + + // BUTTON PAD + public static FTCButton getAButton(Gamepad gamepad){ + return new FTCButton(() -> gamepad.a); + } + + public static FTCButton getBButton(Gamepad gamepad){ + return new FTCButton(() -> gamepad.b); + } + + public static FTCButton getXButton(Gamepad gamepad){ + return new FTCButton(() -> gamepad.x); + } + + public static FTCButton getYButton(Gamepad gamepad){ + return new FTCButton(() -> gamepad.y); + } + + // DPAD + public static FTCButton getDPADUp(Gamepad gamepad){ + return new FTCButton(() -> gamepad.dpad_up); + } + + public static FTCButton getDPADDown(Gamepad gamepad){ + return new FTCButton(() -> gamepad.dpad_down); + } + + public static FTCButton getYDPADRight(Gamepad gamepad){ + return new FTCButton(() -> gamepad.dpad_right); + } + + public static FTCButton getDPADLeft(Gamepad gamepad){ + return new FTCButton(() -> gamepad.dpad_left); + } + + // Bumpers + public static FTCButton getRightBumper(Gamepad gamepad){ + return new FTCButton(() -> gamepad.right_bumper); + } + + public static FTCButton getLeftBumper(Gamepad gamepad){ + return new FTCButton(() -> gamepad.left_bumper); + } + + // Triggers + public static FTCButton getRightTrigger(Gamepad gamepad){ + return new FTCButton(() -> gamepad.right_trigger > .5); + } + + public static FTCButton getLeftTrigger(Gamepad gamepad){ + return new FTCButton(() -> gamepad.left_trigger > .5); + } } diff --git a/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java b/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java index ebf95a1..20d7210 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java +++ b/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java @@ -1,7 +1,6 @@ package org.montclairrobotics.alloy.test; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; -import com.sun.org.apache.xpath.internal.operations.Bool; import org.montclairrobotics.alloy.control.ToggleButton; import org.montclairrobotics.alloy.core.Alloy; import org.montclairrobotics.alloy.ftc.FTCButton; diff --git a/src/main/java/org/montclairrobotics/alloy/update/Updatable.java b/src/main/java/org/montclairrobotics/alloy/update/Updatable.java index cdf470b..4348baa 100644 --- a/src/main/java/org/montclairrobotics/alloy/update/Updatable.java +++ b/src/main/java/org/montclairrobotics/alloy/update/Updatable.java @@ -25,7 +25,7 @@ public class Updatable { public void run(){ try { - update.invoke(clazz, parameters); + update.invoke(clazz); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { From d1564d053805ff9fdfb359840669ef361fd2a28b Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Fri, 16 Mar 2018 14:55:57 -0400 Subject: [PATCH 02/54] Update README.md --- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 541dd50..53541f6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,46 @@ Status: **Beta** +Developed by FTC147 and FRC555 -Alloy is a robot framework designed specifically for the First Tech Challenge (FTC). +The goal of alloy is to provide a robot framework that allows anyone, including new programmers, to be able to implement +high functioning and quality code for their robots. In other terms, Alloy aims toprevent robot code from being a limiting +factor on the performance of the robot. + + +Alloy is a robot framework designed specifically for the First Tech Challenge (FTC), but is also designed +with expandibility in mind. FRC implementation is possible and will be coming in the future. Alloy is based off the FRC robot framework [Sprocket](https://github.com/MontclairRobotics/Sprocket), but redesigned to abstract away the more complex ideas but still allow for advanced robot functionality. + +Any information regarding Alloy, including how it works, project structure, as well as in depth explanation on how to use all of the components +can be found in the project [Wiki](). As well as a quick start guide. + + + +# FAQ + +### Q. What is the purpose/how do I use ___? + +A. Every class is heavily documented as well as wiki articles explaining the use of more complex/important parts of alloy + +### Q. I tried to update ___ method using @Update, but it isn't working? + +A. The way alloy is designed, is that everything is split up into components, and a method can only be updated if it is within a component. +you can read more about this topic [Here]() + +### Q. What is a component/what is the difference between the components? +A. Different components have different purposes, for example, a control component would be used for an advanced control system, +whereas a motor component, or motor ocmponent group would be used to control a drivetrain or manipulator + +### Q. What if I don't want to use components? + +A. Things can be done in alloy without the use of components, but if you are designing code for a specific tool or component on the robot, +such as a shooter, drivetrain, or control system, it is highly recommended as components add extra functionality like toggleability, +easier debugging, and updateable methods. But again, all of this can be done without the use of components. + +### Q. ___ isn't working. + +A. If you have a problem first see our [Troubleshooting guide](). If that does not fix your problem you can file an [Issue]() +using our issue template, please provide as much information as possible so we can fully understand the probelm and fix the issue. + From b5a963154ed509398068ca2bc567722ae5911612 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Fri, 16 Mar 2018 14:56:33 -0400 Subject: [PATCH 03/54] Update README.md Fixed grammatical error --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53541f6..378371e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ can be found in the project [Wiki](). As well as a quick start guide. # FAQ -### Q. What is the purpose/how do I use ___? +### Q. What is the purpose of/how do I use ___? A. Every class is heavily documented as well as wiki articles explaining the use of more complex/important parts of alloy From a15ed954ba1e96637bf2fd9b532d8e96d88264c7 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Fri, 16 Mar 2018 15:03:25 -0400 Subject: [PATCH 04/54] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 378371e..c26426d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ with expandibility in mind. FRC implementation is possible and will be coming in Alloy is based off the FRC robot framework [Sprocket](https://github.com/MontclairRobotics/Sprocket), but redesigned to abstract away the more complex ideas but still allow for advanced robot functionality. Any information regarding Alloy, including how it works, project structure, as well as in depth explanation on how to use all of the components -can be found in the project [Wiki](). As well as a quick start guide. +can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki). As well as a quick start guide. @@ -30,7 +30,7 @@ A. Every class is heavily documented as well as wiki articles explaining the use ### Q. I tried to update ___ method using @Update, but it isn't working? A. The way alloy is designed, is that everything is split up into components, and a method can only be updated if it is within a component. -you can read more about this topic [Here]() +you can read more about this topic [Here](https://github.com/GarrettBurroughs/Alloy/wiki/Alloy-Update-System) ### Q. What is a component/what is the difference between the components? A. Different components have different purposes, for example, a control component would be used for an advanced control system, @@ -44,6 +44,6 @@ easier debugging, and updateable methods. But again, all of this can be done wit ### Q. ___ isn't working. -A. If you have a problem first see our [Troubleshooting guide](). If that does not fix your problem you can file an [Issue]() +A. If you have a problem first see our [Troubleshooting guide](https://github.com/GarrettBurroughs/Alloy/wiki/Troubleshooting-Guide). If that does not fix your problem you can file an [Issue](https://github.com/GarrettBurroughs/Alloy/issues/new) using our issue template, please provide as much information as possible so we can fully understand the probelm and fix the issue. From a790ec9622b3d72579a676e563739cf216cdb83c Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Mon, 2 Apr 2018 00:26:27 -0400 Subject: [PATCH 05/54] Basic motor rework.... again --- .../core/{PoweredMotor.java => Motor.java} | 2 +- .../alloy/core/TargetMotor.java | 17 +----- .../alloy/core/UniversalMotor.java | 10 ---- .../montclairrobotics/alloy/ftc/FTCMotor.java | 60 +++++++------------ .../alloy/ftc/FTCMotorBase.java | 44 -------------- .../alloy/ftc/FTCPoweredMotor.java | 60 ------------------- .../alloy/ftc/FTCTargetMotor.java | 4 +- .../montclairrobotics/alloy/test/Shooter.java | 6 +- 8 files changed, 30 insertions(+), 173 deletions(-) rename src/main/java/org/montclairrobotics/alloy/core/{PoweredMotor.java => Motor.java} (96%) delete mode 100644 src/main/java/org/montclairrobotics/alloy/core/UniversalMotor.java delete mode 100644 src/main/java/org/montclairrobotics/alloy/ftc/FTCMotorBase.java delete mode 100644 src/main/java/org/montclairrobotics/alloy/ftc/FTCPoweredMotor.java diff --git a/src/main/java/org/montclairrobotics/alloy/core/PoweredMotor.java b/src/main/java/org/montclairrobotics/alloy/core/Motor.java similarity index 96% rename from src/main/java/org/montclairrobotics/alloy/core/PoweredMotor.java rename to src/main/java/org/montclairrobotics/alloy/core/Motor.java index 71533be..009d494 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/PoweredMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Motor.java @@ -10,7 +10,7 @@ * @since 0.1 * */ -public interface PoweredMotor { +public interface Motor { /** * Sets the motor Power * diff --git a/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java b/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java index 38c6334..1fba1f5 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java @@ -5,7 +5,7 @@ * Target motor is a motor interface for motors that have encoders. * Target motors can set encoder positions using PID control */ -public interface TargetMotor{ +public interface TargetMotor extends Motor{ /** * Sets the motor Power * @@ -20,21 +20,6 @@ public interface TargetMotor{ */ public double getTargetPower(); - - /** - * Sets weather the motor runs the default way , or inverted - * - * @param inverted true for inverted, false for normal - */ - public void setInverted(boolean inverted); - - /** - * Gets weather the motor is inverted - * - * @return true if the motor is inverted - */ - public boolean getInverted(); - /** * Sets the motor position * diff --git a/src/main/java/org/montclairrobotics/alloy/core/UniversalMotor.java b/src/main/java/org/montclairrobotics/alloy/core/UniversalMotor.java deleted file mode 100644 index 5502a42..0000000 --- a/src/main/java/org/montclairrobotics/alloy/core/UniversalMotor.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.montclairrobotics.alloy.core; - -/** - * Created by MHS Robotics on 2/25/2018. - * - * @author Garrett Burroughs - * @since - */ -public interface UniversalMotor extends TargetMotor, PoweredMotor { -} diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java index 39b620d..eed7b81 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java @@ -2,24 +2,28 @@ import com.qualcomm.robotcore.hardware.DcMotor; import com.qualcomm.robotcore.hardware.DcMotorSimple; -import org.montclairrobotics.alloy.core.PoweredMotor; +import org.montclairrobotics.alloy.core.Motor; import org.montclairrobotics.alloy.core.RobotCore; import org.montclairrobotics.alloy.core.TargetMotor; -import org.montclairrobotics.alloy.core.UniversalMotor; /** * Created by MHS Robotics on 11/14/2017. * - * FTCMotor is a class that dynamically switches a motor's runmode - * depending on what functionality is being used + * FTCMotor is a basic implementation of a motor used for FTC. + * Basic FTC motors can be controlled using motor power but can + * not have their positions set using encoders. If you wish to + * set a motors position + * @see FTCTargetMotor * * @author Garrett Burroughs * @since 0.1 */ -public class FTCMotor extends FTCMotorBase implements UniversalMotor { +public class FTCMotor implements Motor { + + DcMotor motor; public FTCMotor(String motorConfiguration) { - super(motorConfiguration); + motor = RobotCore.getHardwareMap().dcMotor.get(motorConfiguration); } /** @@ -44,44 +48,24 @@ public double getMotorPower() { } /** - * Sets the power at which the motor will move when set to a position - * - * @param power the power that the motor will be set to (0-1 inclusive ) - */ - @Override - public void setTargetPower(double power) { - motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); - motor.setPower(power); - } - - /** - * Gets the motor power - * - * @return the current motor power, a value between (0-1) - */ - @Override - public double getTargetPower() { - return motor.getPower(); - } - - /** - * Sets the motor position + * Sets weather the motor runs the default way , or inverted * - * @param position the position the motor will be set to (in encoder ticks) + * @param inverted true for inverted, false for normal */ - @Override - public void setPosition(int position) { - motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); - motor.setTargetPosition(position); + public void setInverted(boolean inverted) { + if(inverted) { + motor.setDirection(DcMotorSimple.Direction.REVERSE); + } else{ + motor.setDirection(DcMotorSimple.Direction.FORWARD); + } } /** - * Gets the motors position + * Gets weather the motor is inverted * - * @return the position that the motor is at (in encoder ticks) + * @return true if the motor is inverted */ - @Override - public double getPosition() { - return motor.getCurrentPosition(); + public boolean getInverted() { + return motor.getDirection() == DcMotorSimple.Direction.REVERSE ? true : false; } } diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotorBase.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotorBase.java deleted file mode 100644 index c3c4c4d..0000000 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotorBase.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.montclairrobotics.alloy.ftc; - -import com.qualcomm.robotcore.hardware.DcMotor; -import com.qualcomm.robotcore.hardware.DcMotorSimple; -import org.montclairrobotics.alloy.core.RobotCore; - -/** - * Created by MHS Robotics on 2/25/2018. - * - * FTCMotorBase is the base class that contains all of the methods - * that every motor has - * - * @author Garrett Burroughs - * @since - */ -public class FTCMotorBase { - DcMotor motor; - - public FTCMotorBase(String motorConfiguration) { - motor = RobotCore.getHardwareMap().dcMotor.get(motorConfiguration); - } - - /** - * Sets weather the motor runs the default way , or inverted - * - * @param inverted true for inverted, false for normal - */ - public void setInverted(boolean inverted) { - if(inverted) { - motor.setDirection(DcMotorSimple.Direction.REVERSE); - } else{ - motor.setDirection(DcMotorSimple.Direction.FORWARD); - } - } - - /** - * Gets weather the motor is inverted - * - * @return true if the motor is inverted - */ - public boolean getInverted() { - return motor.getDirection() == DcMotorSimple.Direction.REVERSE ? true : false; - } -} diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCPoweredMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCPoweredMotor.java deleted file mode 100644 index bcf3b10..0000000 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCPoweredMotor.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.montclairrobotics.alloy.ftc; - -import com.qualcomm.robotcore.hardware.DcMotor; -import com.qualcomm.robotcore.hardware.DcMotorSimple; -import org.montclairrobotics.alloy.core.PoweredMotor; -import org.montclairrobotics.alloy.core.RobotCore; - -/** - * Created by MHS Robotics on 2/24/2018. - * - * A powered motor is a motor that is controlled by setting motor voltage - * A powered motor takes care of setting the motor configuration as well - * as setting the motor runmode do not change the robot runmode, if you - * plan to use a motor that is both controlled by voltage and position - * use FTCMotor - * @see FTCMotor - * - * @author Garrett Burroughs - * @since 0.1 - */ -public class FTCPoweredMotor extends FTCMotorBase implements PoweredMotor { - - public FTCPoweredMotor(String motorConfiguration) { - super(motorConfiguration); - } - - /** - * Sets the motor Power - * - * @param power the power that the motor will be set to (0-1 inclusive ) - */ - @Override - public void setMotorPower(double power) { - motor.setPower(power); - } - - /** - * Gets the motor power - * - * @return the current motor power, a value between (0-1) - */ - @Override - public double getMotorPower() { - return motor.getPower(); - } - - /** - * Sets weather the motor runs the default way , or inverted - * - * @param inverted true for inverted, false for normal - */ - - - /** - * @return the motor being controlled - */ - public DcMotor getMotor() { - return motor; - } -} diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java index 7521599..bbc995d 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java @@ -19,7 +19,7 @@ * @author Garrett Burroughs * @since 0.1 */ -public class FTCTargetMotor extends FTCMotorBase implements TargetMotor { +public class FTCTargetMotor extends FTCMotor implements TargetMotor { public FTCTargetMotor(String motorConfiguration) { super(motorConfiguration); motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); @@ -58,6 +58,7 @@ enum Mode{ @Override public void setPosition(int position) { if(runmode == Mode.DEFAULT){ + motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); motor.setTargetPosition(position); }else{ pid.setTarget(position); @@ -117,6 +118,7 @@ public void disablePID(){ @Update public void update() { if(runmode == Mode.CUSTOM){ + motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER); setTargetPower(pid.get()); } } diff --git a/src/main/java/org/montclairrobotics/alloy/test/Shooter.java b/src/main/java/org/montclairrobotics/alloy/test/Shooter.java index e7a3ce2..8a658b8 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/Shooter.java +++ b/src/main/java/org/montclairrobotics/alloy/test/Shooter.java @@ -1,12 +1,12 @@ package org.montclairrobotics.alloy.test; -import org.montclairrobotics.alloy.core.PoweredMotor; +import org.montclairrobotics.alloy.core.Motor; import org.montclairrobotics.alloy.ftc.FTCMotor; import org.montclairrobotics.alloy.utils.Toggleable; public class Shooter extends Toggleable { - PoweredMotor motorR = new FTCMotor("Right PoweredMotor"); - PoweredMotor motorL = new FTCMotor("Left PoweredMotor"); + Motor motorR = new FTCMotor("Right PoweredMotor"); + Motor motorL = new FTCMotor("Left PoweredMotor"); @Override From cbb1c8d27a5e816e7323211088e959db1535cb69 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Sun, 29 Apr 2018 04:33:10 -0400 Subject: [PATCH 06/54] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c26426d..cb6cd24 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Status: **Beta** Developed by FTC147 and FRC555 -The goal of alloy is to provide a robot framework that allows anyone, including new programmers, to be able to implement -high functioning and quality code for their robots. In other terms, Alloy aims toprevent robot code from being a limiting +The goal of Alloy is to provide a robot framework that allows anyone, including new programmers, to be able to implement +high functioning and quality code for their robots. In other terms, Alloy aims to prevent robot code from being a limiting factor on the performance of the robot. @@ -16,8 +16,8 @@ with expandibility in mind. FRC implementation is possible and will be coming in Alloy is based off the FRC robot framework [Sprocket](https://github.com/MontclairRobotics/Sprocket), but redesigned to abstract away the more complex ideas but still allow for advanced robot functionality. -Any information regarding Alloy, including how it works, project structure, as well as in depth explanation on how to use all of the components -can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki). As well as a quick start guide. +Any information regarding Alloy, including how it works, project structure, as well as in-depth explanation on how to use all of the components +can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) as well as a [quick start guide](). From bfc9c2411b56cad403e9af13521e2686c4d4bd6a Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Sun, 6 May 2018 20:00:15 -0400 Subject: [PATCH 07/54] Started implementation of motor control elements --- .idea/compiler.xml | 9 -- .idea/misc.xml | 21 +-- .idea/modules.xml | 9 -- .idea/modules/Alloy_main.iml | 35 ----- .idea/vcs.xml | 2 +- Alloy.iml | 13 +- .../alloy/components/Component.java | 44 +++++- .../alloy/components/MotorComponent.java | 30 ---- .../montclairrobotics/alloy/core/Encoder.java | 141 ++++++++++++++++++ .../core/{PoweredMotor.java => Motor.java} | 12 +- .../alloy/core/TargetMotor.java | 11 +- .../alloy/core/UniversalMotor.java | 16 -- .../montclairrobotics/alloy/ftc/FTCMotor.java | 104 +++++-------- .../alloy/ftc/FTCMotorBase.java | 61 -------- .../alloy/ftc/FTCPoweredMotor.java | 91 ----------- .../alloy/ftc/FTCTargetMotor.java | 72 +++++---- .../montclairrobotics/alloy/motor/Mapper.java | 10 ++ .../alloy/motor/MotorGroup.java | 27 ++++ .../alloy/motor/MotorModule.java | 107 +++++++++++++ .../montclairrobotics/alloy/test/Shooter.java | 12 +- .../alloy/utils/Differential.java | 28 ++++ .../alloy/utils/ErrorCorrection.java | 7 + .../montclairrobotics/alloy/utils/PID.java | 25 +--- .../montclairrobotics/alloy/utils/Utils.java | 12 ++ 24 files changed, 464 insertions(+), 435 deletions(-) delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/modules/Alloy_main.iml delete mode 100644 src/main/java/org/montclairrobotics/alloy/components/MotorComponent.java create mode 100644 src/main/java/org/montclairrobotics/alloy/core/Encoder.java rename src/main/java/org/montclairrobotics/alloy/core/{PoweredMotor.java => Motor.java} (83%) delete mode 100644 src/main/java/org/montclairrobotics/alloy/core/UniversalMotor.java delete mode 100644 src/main/java/org/montclairrobotics/alloy/ftc/FTCMotorBase.java delete mode 100644 src/main/java/org/montclairrobotics/alloy/ftc/FTCPoweredMotor.java create mode 100644 src/main/java/org/montclairrobotics/alloy/motor/Mapper.java create mode 100644 src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java create mode 100644 src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java create mode 100644 src/main/java/org/montclairrobotics/alloy/utils/Differential.java create mode 100644 src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java create mode 100644 src/main/java/org/montclairrobotics/alloy/utils/Utils.java diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 3446932..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 2a6099a..bc8d0a3 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,24 +1,7 @@ - - + - + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 2e3ae80..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/Alloy_main.iml b/.idea/modules/Alloy_main.iml deleted file mode 100644 index d180623..0000000 --- a/.idea/modules/Alloy_main.iml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..35eb1dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/Alloy.iml b/Alloy.iml index fea8e87..329f535 100644 --- a/Alloy.iml +++ b/Alloy.iml @@ -1,13 +1,2 @@ - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/main/java/org/montclairrobotics/alloy/components/Component.java b/src/main/java/org/montclairrobotics/alloy/components/Component.java index 761b82d..7a4e333 100644 --- a/src/main/java/org/montclairrobotics/alloy/components/Component.java +++ b/src/main/java/org/montclairrobotics/alloy/components/Component.java @@ -7,9 +7,36 @@ import java.util.ArrayList; +/** + * The main component class that all components of alloy should extend + * + * Alloy is built of a system of components that all work together to operate a robot + * Components can be broken down into 2 simple parts + * -Physical Component + * -Input Component + * + * A physical component would include any part, feature, or function that is physically on the robot + * This can include things like motors, manipulators shooters, drivetrain, etc. + * + * An input component is more control based and includes things like buttons, joysticks, triggers, + * sensors, flow camera, optical control and anything else that would send an input to a physical component + * @see InputComponent + * + * All components have the ability to be toggled on and off as well as built in debug capability + * for easier testing and debugging of specific components. + * + * There is also a static list of all components that are created so that the updater can + * reference them. This means that you can have a method in a component be updated just by + * addint the @Update annotation + * + * @Author Garrett Burroughs + * @Version 0.1 + * @Since 0.1 + */ public abstract class Component extends Toggleable{ public static Debugger debugger; + private boolean debugMode = true; // // All components are added to the component arraylist so they can be updated public static ArrayList components; @@ -34,12 +61,27 @@ public void addDebugs(Iterable debugs){ } } + public void enableDebug(){ + debugMode = false; + } + + public void disableDebug(){ + debugMode = true; + } + @Update public void debug(){ - if(status.booleanValue()) { + if(status.booleanValue() && debugMode) { for (Debug debug : debugs) { debugger.debug(debug); } } } + + @Override + public void enableAction(){} + + @Override + public void disableAction(){} + } diff --git a/src/main/java/org/montclairrobotics/alloy/components/MotorComponent.java b/src/main/java/org/montclairrobotics/alloy/components/MotorComponent.java deleted file mode 100644 index 4c6dba2..0000000 --- a/src/main/java/org/montclairrobotics/alloy/components/MotorComponent.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.montclairrobotics.alloy.components; - -import org.montclairrobotics.alloy.core.PoweredMotor; - -/** - * Created by MHS Robotics on 3/12/2018. - * - * @author Garrett Burroughs - * @since - */ -public class MotorComponent extends Component{ - - PoweredMotor motor; - - /** - * Method to be called when the toggleable is enabled - */ - @Override - public void enableAction() { - - } - - /** - * Method to be called when the toggleable is disabled - */ - @Override - public void disableAction() { - - } -} diff --git a/src/main/java/org/montclairrobotics/alloy/core/Encoder.java b/src/main/java/org/montclairrobotics/alloy/core/Encoder.java new file mode 100644 index 0000000..1ca454f --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/core/Encoder.java @@ -0,0 +1,141 @@ +package org.montclairrobotics.alloy.core; + +import org.montclairrobotics.alloy.components.InputComponent; +import org.montclairrobotics.alloy.utils.Differential; +import org.montclairrobotics.alloy.utils.Input; + + +/** + * A motor encoder that keeps track of kinematic information about the motor + * + * At a basic level hardware encoders are able to get how far a motor has gone + * as a unit of encoder ticks. The encoder class also calculates the acceleration + * anc velocity of the motor in terms of encoder ticks, and then the user can + * define the distance of unit to measure the motor in + */ +public abstract class Encoder extends InputComponent { + + /** + * An Object that calculates the change in position with respect to time (Velocity) + * Measured in Ticks per Second + */ + Differential calcVelocity; + + /** + * An Object that calculates the change in velocity with respect to time (Acceleration) + * Measured in Ticks per Second per Second + */ + Differential calcAcceleration; + + /** + * How far the motor goes for each encoder tick + * NOTE : It is very important that distances are consistent + */ + private double distancePerTick; + + /** + * Max speed that the motor can go + * Measured in Ticks per Second + */ + private double maxSpeed; + + /** + * A method that should be overridden by the encoder + * + * @return the raw value of encoder ticks that the encoder reads + */ + public abstract int getTicks(); + + public Encoder(double distancePerTick, double maxSpeed) { + this.distancePerTick = distancePerTick; + setInput(() -> getTicks()); + calcVelocity = new Differential((Input) () -> (double)getTicks()); + calcAcceleration = new Differential(calcVelocity); + } + + /** + * Create a new encoder with default values + */ + public Encoder(){ + this(1.0, 1.0); + } + + /** + * Set the distance per tick + * + * The distance per tick is the amount of distance the motor will move (or + * what the motor is attached to, eg wheel/lift) + * The distance unit should stay consistent throughout the robot project + * This method can also be daisychained as it returns a reference to itself + * + * @param distancePerTick how far the motor moves for 1 encoder tick + * @return the encoder + */ + public Encoder setDistancePerTick(double distancePerTick) { + this.distancePerTick = distancePerTick; + return this; + } + + /** + * Set the max speed (In Ticks per Second) that the motor can run + * + * @param maxSpeed max speed that the motor can run + * @return the encoder + */ + public Encoder setMaxSpeed(double maxSpeed){ + this.maxSpeed = maxSpeed; + return this; + } + + /** + * Get the velocity in Ticks per Second + * + * @return velocity in ticks per second + */ + public double getRawVelocity(){ + return calcVelocity.get(); + } + + /** + * Get the acceleration in ticks per second per second + * + * @return acceleration in ticks per second per second + */ + private double getRawAcceleration(){ + return calcAcceleration.get(); + } + + /** + * Get the velocity in distance per second + * The distance is set by the distance per tick method, + * it is important to keep distances consistent throughout + * the project. + * + * @return velocity in distance per second + */ + public double getVelocity(){ + return getRawVelocity() / distancePerTick; + } + + /** + * Get the acceleration in distance per second + * The distance is set by the distance per tick method, + * it is important to keep distances consistent throughout + * + * @return acceleration in distance per second + */ + public double getAcceleration(){ + return getRawAcceleration() / distancePerTick; + } + + + /** + * Get a scaled value (0 - 1) of how fast the motor is going + * + * @return a value 0 - 1 depending on how fast the motor is going + */ + public double getScaledVelocity(){ + return getRawVelocity() / maxSpeed; + } + +} diff --git a/src/main/java/org/montclairrobotics/alloy/core/PoweredMotor.java b/src/main/java/org/montclairrobotics/alloy/core/Motor.java similarity index 83% rename from src/main/java/org/montclairrobotics/alloy/core/PoweredMotor.java rename to src/main/java/org/montclairrobotics/alloy/core/Motor.java index 57f2831..cc23e02 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/PoweredMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Motor.java @@ -1,5 +1,8 @@ package org.montclairrobotics.alloy.core; + +import org.montclairrobotics.alloy.components.Component; + import java.util.ArrayList; /** @@ -12,7 +15,7 @@ * @since 0.1 * */ -public interface PoweredMotor { +public interface Motor { /** * Sets the motor Power * @@ -41,11 +44,4 @@ public interface PoweredMotor { * @return true if the motor is inverted */ public boolean getInverted(); - - /** - * gets the debug information for the motor - * - * @return the motor debugs - */ - public ArrayList getDebugs(); } diff --git a/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java b/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java index d783c1c..1da71e8 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java @@ -7,7 +7,7 @@ * Target motor is a motor interface for motors that have encoders. * Target motors can set encoder positions using PID control */ -public interface TargetMotor{ +public interface TargetMotor extends Motor{ /** * Sets the motor Power * @@ -49,12 +49,5 @@ public interface TargetMotor{ * * @return the position that the motor is at (in encoder ticks) */ - public double getPosition(); - - /** - * Gets the debug information of the motor - * - * @return the debugs for the motor - */ - public ArrayList getDebugs(); + public int getPosition(); } diff --git a/src/main/java/org/montclairrobotics/alloy/core/UniversalMotor.java b/src/main/java/org/montclairrobotics/alloy/core/UniversalMotor.java deleted file mode 100644 index bae027e..0000000 --- a/src/main/java/org/montclairrobotics/alloy/core/UniversalMotor.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.montclairrobotics.alloy.core; - -/** - * Created by MHS Robotics on 2/25/2018. - * - * A universal motor is a motor that has the ability to both be controlled by motor power - * As well as controlled by encoder position. In FTC this also means dynamically switching - * the modes that the motor is in - * @see TargetMotor - * @see PoweredMotor - * - * @author Garrett Burroughs - * @since - */ -public interface UniversalMotor extends TargetMotor, PoweredMotor { -} diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java index 79abf6e..925a1df 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java @@ -2,27 +2,39 @@ import com.qualcomm.robotcore.hardware.DcMotor; import com.qualcomm.robotcore.hardware.DcMotorSimple; +import org.montclairrobotics.alloy.components.Component; import org.montclairrobotics.alloy.core.*; import org.montclairrobotics.alloy.update.Update; import org.montclairrobotics.alloy.utils.Input; +import java.awt.*; import java.util.ArrayList; /** * Created by MHS Robotics on 11/14/2017. * - * FTCMotor is a class that dynamically switches a motor's runmode - * depending on what functionality is being used + * The basic motor for use in FTC. Basic motors are not aware of encoders and + * are not recommended for use in FTC as all motors come with encoders + * * * @author Garrett Burroughs * @since 0.1 */ -public class FTCMotor extends FTCMotorBase implements UniversalMotor { +public class FTCMotor extends Component implements Motor { - private double power; + /** + * The physical hardware motor reference to the motor being controlled + */ + public DcMotor motor; + + /** + * The power that the motor should be running at + */ + public double power; public FTCMotor(String motorConfiguration) { - super(motorConfiguration); + motor = RobotCore.getHardwareMap().dcMotor.get(motorConfiguration); + addDebug(new Debug(motorConfiguration + " Motor Power: ", (Input) () -> power)); } /** @@ -45,90 +57,46 @@ public void setMotorPower(double power) { public double getMotorPower() { return motor.getPower(); } - - /** - * Sets the power at which the motor will move when set to a position - * - * @param power the power that the motor will be set to (0-1 inclusive ) - */ - @Override - public void setTargetPower(double power) { - motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); - this.power = power; - } - - /** - * Gets the motor power - * - * @return the current motor power, a value between (0-1) - */ - @Override - public double getTargetPower() { - return motor.getPower(); - } - + /** - * Sets the motor position + * Sets whether the motor runs the default way , or inverted * - * @param position the position the motor will be set to (in encoder ticks) + * @param inverted true for inverted, false for normal */ @Override - public void setPosition(int position) { - motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); - motor.setTargetPosition(position); + public void setInverted(boolean inverted) { + if (inverted) { + motor.setDirection(DcMotorSimple.Direction.REVERSE); + } else { + motor.setDirection(DcMotorSimple.Direction.FORWARD); + } } - + /** - * Gets the motors position + * Gets weather the motor is inverted * - * @return the position that the motor is at (in encoder ticks) + * @return true if the motor is inverted */ @Override - public double getPosition() { - return motor.getCurrentPosition(); + public boolean getInverted() { + return motor.getDirection() == DcMotorSimple.Direction.REVERSE ? true : false; } @Update public void updateMotor(){ + + // Set Motor Power if it is enabled if(status.booleanValue()){ motor.setPower(power); }else{ motor.setPower(0); } + } - /** - * @return the motor position, and powers - */ @Override - public ArrayList getDebugs(){ - ArrayList motorDebugs = new ArrayList<>(); - - motorDebugs.add(new Debug("Motor Power", new Input(){ - - @Override - public Double get() { - return getMotorPower(); - } - })); - - motorDebugs.add(new Debug("Motor Position", new Input(){ - - @Override - public Double get() { - return getPosition(); - } - })); - - motorDebugs.add(new Debug("Target Power", new Input(){ - - @Override - public Double get() { - return getTargetPower(); - } - })); - - return motorDebugs; + public void disableAction() { + motor.setPower(0); } } diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotorBase.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotorBase.java deleted file mode 100644 index 56c6418..0000000 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotorBase.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.montclairrobotics.alloy.ftc; - -import com.qualcomm.robotcore.hardware.DcMotor; -import com.qualcomm.robotcore.hardware.DcMotorSimple; -import org.montclairrobotics.alloy.components.Component; -import org.montclairrobotics.alloy.core.RobotCore; - -/** - * Created by MHS Robotics on 2/25/2018. - * - * FTCMotorBase is the base class that contains all of the methods - * that every motor has - * - * @author Garrett Burroughs - * @since - */ -public class FTCMotorBase extends Component{ - DcMotor motor; - - public FTCMotorBase(String motorConfiguration) { - motor = RobotCore.getHardwareMap().dcMotor.get(motorConfiguration); - } - - /** - * Sets weather the motor runs the default way , or inverted - * - * @param inverted true for inverted, false for normal - */ - public void setInverted(boolean inverted) { - if(inverted) { - motor.setDirection(DcMotorSimple.Direction.REVERSE); - } else{ - motor.setDirection(DcMotorSimple.Direction.FORWARD); - } - } - - /** - * Gets weather the motor is inverted - * - * @return true if the motor is inverted - */ - public boolean getInverted() { - return motor.getDirection() == DcMotorSimple.Direction.REVERSE ? true : false; - } - - /** - * Method to be called when the toggleable is enabled - */ - @Override - public void enableAction() { - - } - - /** - * Method to be called when the toggleable is disabled - */ - @Override - public void disableAction() { - - } -} diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCPoweredMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCPoweredMotor.java deleted file mode 100644 index 9c185e4..0000000 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCPoweredMotor.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.montclairrobotics.alloy.ftc; - -import com.qualcomm.robotcore.hardware.DcMotor; -import com.qualcomm.robotcore.hardware.DcMotorSimple; -import org.montclairrobotics.alloy.core.Debug; -import org.montclairrobotics.alloy.core.PoweredMotor; -import org.montclairrobotics.alloy.core.RobotCore; -import org.montclairrobotics.alloy.update.Update; -import org.montclairrobotics.alloy.utils.Input; - -import java.util.ArrayList; -import java.util.Arrays; - -/** - * Created by MHS Robotics on 2/24/2018. - * - * A powered motor is a motor that is controlled by setting motor voltage - * A powered motor takes care of setting the motor configuration as well - * as setting the motor runmode do not change the robot runmode, if you - * plan to use a motor that is both controlled by voltage and position - * use FTCMotor - * @see FTCMotor - * - * @author Garrett Burroughs - * @since 0.1 - */ -public class FTCPoweredMotor extends FTCMotorBase implements PoweredMotor { - - private double power; - - public FTCPoweredMotor(String motorConfiguration) { - super(motorConfiguration); - } - - /** - * Sets the motor Power - * - * @param power the power that the motor will be set to (0-1 inclusive ) - */ - @Override - public void setMotorPower(double power) { - this.power = power; - } - - /** - * Gets the motor power - * - * @return the current motor power, a value between (0-1) - */ - @Override - public double getMotorPower() { - return motor.getPower(); - } - - /** - * gets the debug information for the motor - * - * @return the motor debugs - */ - @Override - public ArrayList getDebugs() { - ArrayList motorDebugs = new ArrayList<>(); - - motorDebugs.add(new Debug("Motor Power", new Input(){ - - @Override - public Double get() { - return getMotorPower(); - } - })); - - return motorDebugs; - } - - @Update - public void motorUpdate(){ - if(status.booleanValue()){ - motor.setPower(power); - }else{ - motor.setPower(0); - } - } - - - /** - * @return the motor being controlled - */ - public DcMotor getMotor() { - return motor; - } -} diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java index 0d1399d..f71d621 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java @@ -2,6 +2,7 @@ import com.qualcomm.robotcore.hardware.DcMotor; import org.montclairrobotics.alloy.core.Debug; +import org.montclairrobotics.alloy.core.Encoder; import org.montclairrobotics.alloy.core.TargetMotor; import org.montclairrobotics.alloy.update.Update; import org.montclairrobotics.alloy.utils.Input; @@ -23,13 +24,16 @@ * @author Garrett Burroughs * @since 0.1 */ -public class FTCTargetMotor extends FTCMotorBase implements TargetMotor { +public class FTCTargetMotor extends FTCMotor implements TargetMotor { - private double power; + private double targetPower; public FTCTargetMotor(String motorConfiguration) { super(motorConfiguration); motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); + addDebug(new Debug(motorConfiguration + " Motor Power: ", (Input) () -> power)); + addDebug(new Debug(motorConfiguration + " Motor Position: ", (Input) () -> getPosition())); + addDebug(new Debug(motorConfiguration + " Target Motor Power: ", (Input) () -> targetPower)); } enum Mode{ @@ -67,7 +71,7 @@ public void setPosition(int position) { if(runmode == Mode.DEFAULT){ motor.setTargetPosition(position); }else{ - pid.setTarget(position); + pid.setTarget((double)position); } } @@ -77,38 +81,10 @@ public void setPosition(int position) { * @return the position that the motor is at (in encoder ticks) */ @Override - public double getPosition() { + public int getPosition() { return motor.getCurrentPosition(); } - /** - * Gets the debug information of the motor - * - * @return the debugs for the motor - */ - @Override - public ArrayList getDebugs() { - ArrayList motorDebugs = new ArrayList<>(); - - motorDebugs.add(new Debug("Motor Position", new Input(){ - - @Override - public Double get() { - return getPosition(); - } - })); - - motorDebugs.add(new Debug("Motor Power", new Input(){ - - @Override - public Double get() { - return getTargetPower(); - } - })); - - return motorDebugs; - } - /** * Sets the motor Power * @@ -116,7 +92,8 @@ public Double get() { */ @Override public void setTargetPower(double power) { - this.power = power; + motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); + this.targetPower = power; } /** @@ -151,13 +128,18 @@ public void disablePID(){ */ @Update public void update() { - if(status.booleanValue()) { - if (runmode == Mode.CUSTOM) { - setTargetPower(pid.get()); + if(status.booleanValue()) { // Check if enabled + if(motor.getMode() == DcMotor.RunMode.RUN_TO_POSITION){ + if (runmode == Mode.CUSTOM) { + setTargetPower(pid.get()); // If running using custom PID mode, set power to PID output + }else{ + motor.setPower(targetPower); // If running in default target mode, set the target power + } + }else{ + motor.setPower(power); // If running by power, set the power } - motor.setPower(power); }else{ - motor.setPower(0); + motor.setPower(0); // If disabled, set power to 0 } } @@ -182,4 +164,18 @@ public DcMotor getMotor() { public Mode getRunmode() { return runmode; } + + /** + * Allows for the creation of an encoder object that is aware of the amount of ticks the motor has gone + * + * @return a new encoder object that will return the amount of encoder ticks the motor is at + */ + public Encoder getEncoder(){ + return new Encoder() { + @Override + public int getTicks() { + return getPosition(); + } + }; + } } diff --git a/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java b/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java new file mode 100644 index 0000000..50837e0 --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java @@ -0,0 +1,10 @@ +package org.montclairrobotics.alloy.motor; + +import org.montclairrobotics.alloy.components.Component; +import org.montclairrobotics.alloy.core.Motor; + +import java.util.ArrayList; + +public interface Mapper { + public void map(T input, MotorModule modules); +} diff --git a/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java b/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java new file mode 100644 index 0000000..00afb5a --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java @@ -0,0 +1,27 @@ +package org.montclairrobotics.alloy.motor; + +import org.montclairrobotics.alloy.components.Component; + +import java.util.ArrayList; + + +/** + * A motor group is a group of motor modules that run together + * + * A motor group should control any collection of motors that + * take an input, and then maps the output to a set of motors + * that run together. For example in a lift mechanism there + * may be 2 motor that both run in the same direction but + * one should be inverted to lift the lift up. The modules + * would define what direction the motors are running in + * the mapper would define that they need to run in opposite + * directions and the MotorGroup would run the motors together + * fully operating the lift. This could work with other things + * like an intake, shooter or other manipulator that requires + * multiple motors running together from one input + */ +public class MotorGroup extends Component { + + public Mapper mapper; + public ArrayList modules; +} diff --git a/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java b/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java new file mode 100644 index 0000000..ddae964 --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java @@ -0,0 +1,107 @@ +package org.montclairrobotics.alloy.motor; + +import org.montclairrobotics.alloy.components.Component; +import org.montclairrobotics.alloy.core.Encoder; +import org.montclairrobotics.alloy.core.Motor; +import org.montclairrobotics.alloy.update.Update; +import org.montclairrobotics.alloy.utils.ConstantInput; +import org.montclairrobotics.alloy.utils.Input; +import org.montclairrobotics.alloy.utils.PID; +import org.montclairrobotics.alloy.vector.Vector; + +import java.util.ArrayList; +import java.util.Arrays; + +/** + * Highly Functional set of motors that run together + * + * A motor module consists of multiple motors that run together + * in the same direction. Modules are aware of what direction + * the run in so they can be used in MoroGroups to be run together + * with other modules. Modules can also be controlled with an + * encoder and a PID to ensure that the are going the right + * speed. + * + * @Author Garrett Burroughs + * @Version 0.1 + * @Since 0.1 + */ +public class MotorModule extends Component { + /** + * The motors that the module will control + */ + public ArrayList motors; + + /** + * The direction that the modules run + * This is for use in a motor group running + * with different modules + */ + public Vector direction; + + /** + * A PID controller that will control the + */ + public PID powerControl; + public Encoder encoder; + public double targetPower; + + public MotorModule(Vector direction, Encoder encoder, PID powerControl, Motor ... motors){ + this.direction = direction; + this.motors = new ArrayList<>(Arrays.asList(motors)); + this.powerControl = powerControl; + this.encoder = encoder; + try { + powerControl.setInput(() -> encoder.getScaledVelocity()); + }catch(NullPointerException e){ + powerControl.setInput(new ConstantInput(0.0)); + } + } + + public MotorModule(Vector direction, Motor ... motors){ + this(direction, null, null, motors); + } + + + public MotorModule setEncoder(Encoder encoder){ + this.encoder = encoder; + return this; + } + + public MotorModule setPID(PID powerControl){ + this.powerControl = powerControl; + return this; + } + + @Update + public void powerCorrection(){ + if(status.booleanValue()){ // Check if its enabled + for(Motor m : motors){ + if(powerControl != null) { + m.setMotorPower(targetPower + powerControl.get()); + }else{ + m.setMotorPower(targetPower); + } + } + }else{ // If disabled, set the power to 0 + for(Motor m : motors){ + m.setMotorPower(0); + } + } + } + + public void setPower(double power){ + targetPower = power; + powerControl.setTarget(power); + } + + /** + * Method to be called when the toggleable is disabled + */ + @Override + public void disableAction() { + for(Motor m : motors){ + m.setMotorPower(0); + } + } +} diff --git a/src/main/java/org/montclairrobotics/alloy/test/Shooter.java b/src/main/java/org/montclairrobotics/alloy/test/Shooter.java index f616084..c31aa3b 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/Shooter.java +++ b/src/main/java/org/montclairrobotics/alloy/test/Shooter.java @@ -1,21 +1,15 @@ package org.montclairrobotics.alloy.test; import org.montclairrobotics.alloy.components.Component; -import org.montclairrobotics.alloy.core.Debug; -import org.montclairrobotics.alloy.core.PoweredMotor; +import org.montclairrobotics.alloy.core.Motor; import org.montclairrobotics.alloy.ftc.FTCMotor; -import org.montclairrobotics.alloy.utils.Toggleable; - -import java.util.ArrayList; public class Shooter extends Component { - PoweredMotor motorR = new FTCMotor("Right PoweredMotor"); - PoweredMotor motorL = new FTCMotor("Left PoweredMotor"); + Motor motorR = new FTCMotor("Right Motor"); + Motor motorL = new FTCMotor("Left Motor"); public Shooter(){ super(); - addDebugs(motorL.getDebugs()); - addDebugs(motorR.getDebugs()); } @Override diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Differential.java b/src/main/java/org/montclairrobotics/alloy/utils/Differential.java new file mode 100644 index 0000000..a60ad09 --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/utils/Differential.java @@ -0,0 +1,28 @@ +package org.montclairrobotics.alloy.utils; + +import org.montclairrobotics.alloy.components.InputComponent; +import org.montclairrobotics.alloy.update.Update; + +public class Differential extends InputComponent { + Input input; + + double prevTime; + double prevIn; + + public Differential(Input in){ + input = in; + } + + @Update + public void calculateDifferential(){ + double elapsedTime = System.nanoTime() - prevTime; + double elapsedIn = input.get() - prevIn; + if(System.nanoTime() != 0) { + output = elapsedIn / elapsedTime; + }else{ + output = 0.0; + } + prevIn = input.get(); + prevTime = System.nanoTime(); + } +} diff --git a/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java b/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java new file mode 100644 index 0000000..a6f66df --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java @@ -0,0 +1,7 @@ +package org.montclairrobotics.alloy.utils; + +public interface ErrorCorrection { + public void setInput(Input input); + public void setTarget(T target); + public T getCorrection(); +} diff --git a/src/main/java/org/montclairrobotics/alloy/utils/PID.java b/src/main/java/org/montclairrobotics/alloy/utils/PID.java index 30591d7..40e9bda 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/PID.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/PID.java @@ -22,7 +22,7 @@ * @author Garrett Burroughs * @since 0.1 */ -public class PID extends InputComponent { +public class PID extends InputComponent implements ErrorCorrection { private double p; private double i; private double d; @@ -71,18 +71,16 @@ public PID(double p, double i, double d, Input input, double target) { this.target = target; } - public PID setTarget(double target){ + @Override + public void setTarget(Double target){ this.target = target; - return this; } + @Override public void setInput(Input input){ this.input = input; } - /** - * The update method should be defined for every updatable, and is called every loop if added to the updater - */ @Update public void update() { @@ -120,19 +118,8 @@ public void update() { prevTime = System.currentTimeMillis()/1000d; } - /** - * Method to be called when the toggleable is enabled - */ @Override - public void enableAction() { - - } - - /** - * Method to be called when the toggleable is disabled - */ - @Override - public void disableAction() { - + public Double getCorrection(){ + return output; } } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Utils.java b/src/main/java/org/montclairrobotics/alloy/utils/Utils.java new file mode 100644 index 0000000..afbd134 --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/utils/Utils.java @@ -0,0 +1,12 @@ +package org.montclairrobotics.alloy.utils; + +public class Utils { + public static double constrain(double in, double min, double max){ + if(in > max){ + return max; + }else if(in < min){ + return min; + } + return in; + } +} From 2409e2bd36f6b8a87f33b85fc3771da18d2b01a8 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Sun, 6 May 2018 21:39:27 -0400 Subject: [PATCH 08/54] Added Spotless code formatter https://github.com/diffplug/spotless to clean up and organize code --- .idea/modules.xml | 1 - .idea/modules/Alloy_main.iml | 25 +-- .idea/modules/Alloy_test.iml | 28 +--- Alloy.iml | 1 + README.md | 97 ++++++----- SpotlessLicense | 23 +++ build.gradle | 28 +++- gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 0 .../alloy/auto/AlloyAutonomous.java | 34 +++- .../montclairrobotics/alloy/auto/README.md | 4 +- .../montclairrobotics/alloy/auto/State.java | 44 +++-- .../alloy/auto/StateMachine.java | 74 +++++---- .../alloy/control/ButtonAction.java | 77 +++++---- .../montclairrobotics/alloy/control/README.md | 10 +- .../alloy/control/ToggleButton.java | 71 ++++---- .../montclairrobotics/alloy/core/Alloy.java | 57 ++++--- .../montclairrobotics/alloy/core/Button.java | 32 +++- .../montclairrobotics/alloy/core/Debug.java | 33 +++- .../alloy/core/Joystick.java | 26 ++- .../montclairrobotics/alloy/core/Mode.java | 34 +++- .../montclairrobotics/alloy/core/Motor.java | 29 +++- .../montclairrobotics/alloy/core/README.md | 4 +- .../alloy/core/RobotCore.java | 67 +++++--- .../alloy/core/TargetMotor.java | 34 +++- .../alloy/drive/DTMapper.java | 23 +++ .../alloy/drive/DriveTrain.java | 26 ++- .../alloy/ftc/FTCButton.java | 88 ++++++---- .../montclairrobotics/alloy/ftc/FTCDebug.java | 32 +++- .../alloy/ftc/FTCJoystick.java | 42 +++-- .../montclairrobotics/alloy/ftc/FTCMotor.java | 49 ++++-- .../alloy/ftc/FTCTargetMotor.java | 86 +++++----- .../montclairrobotics/alloy/test/Shooter.java | 24 ++- .../alloy/test/TestRobot.java | 40 ++++- .../alloy/update/Updatable.java | 27 ++- .../alloy/update/Update.java | 24 +++ .../alloy/update/Updater.java | 70 +++++--- .../montclairrobotics/alloy/utils/Input.java | 23 +++ .../montclairrobotics/alloy/utils/PID.java | 87 ++++++---- .../alloy/utils/Toggleable.java | 94 ++++++----- .../alloy/utils/TuneablePID.java | 26 ++- .../montclairrobotics/alloy/vector/Angle.java | 86 +++++----- .../montclairrobotics/alloy/vector/Polar.java | 138 ++++++++------- .../alloy/vector/Vector.java | 157 +++++++++--------- .../montclairrobotics/alloy/vector/XY.java | 143 +++++++++------- 45 files changed, 1372 insertions(+), 749 deletions(-) create mode 100644 SpotlessLicense mode change 100644 => 100755 gradlew diff --git a/.idea/modules.xml b/.idea/modules.xml index 9d7946a..07de6c1 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -5,7 +5,6 @@ - \ No newline at end of file diff --git a/.idea/modules/Alloy_main.iml b/.idea/modules/Alloy_main.iml index b653b4a..795b244 100644 --- a/.idea/modules/Alloy_main.iml +++ b/.idea/modules/Alloy_main.iml @@ -1,25 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/.idea/modules/Alloy_test.iml b/.idea/modules/Alloy_test.iml index a3178d0..6b3eb10 100644 --- a/.idea/modules/Alloy_test.iml +++ b/.idea/modules/Alloy_test.iml @@ -1,29 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/Alloy.iml b/Alloy.iml index fea8e87..9dd3ce3 100644 --- a/Alloy.iml +++ b/Alloy.iml @@ -1,5 +1,6 @@ + diff --git a/README.md b/README.md index cb6cd24..a65a2dd 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,48 @@ -# Alloy  [![Build Status](https://travis-ci.org/GarrettBurroughs/Alloy.svg?branch=master)](https://travis-ci.org/GarrettBurroughs/Alloy) [![CodeFactor](https://www.codefactor.io/repository/github/garrettburroughs/alloy/badge)](https://www.codefactor.io/repository/github/garrettburroughs/alloy) - -![AlloyLogo](http://gdurl.com/AFl8) - -Status: **Beta** - -Developed by FTC147 and FRC555 - -The goal of Alloy is to provide a robot framework that allows anyone, including new programmers, to be able to implement -high functioning and quality code for their robots. In other terms, Alloy aims to prevent robot code from being a limiting -factor on the performance of the robot. - - -Alloy is a robot framework designed specifically for the First Tech Challenge (FTC), but is also designed -with expandibility in mind. FRC implementation is possible and will be coming in the future. - -Alloy is based off the FRC robot framework [Sprocket](https://github.com/MontclairRobotics/Sprocket), but redesigned to abstract away the more complex ideas but still allow for advanced robot functionality. - -Any information regarding Alloy, including how it works, project structure, as well as in-depth explanation on how to use all of the components -can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) as well as a [quick start guide](). - - - -# FAQ - -### Q. What is the purpose of/how do I use ___? - -A. Every class is heavily documented as well as wiki articles explaining the use of more complex/important parts of alloy - -### Q. I tried to update ___ method using @Update, but it isn't working? - -A. The way alloy is designed, is that everything is split up into components, and a method can only be updated if it is within a component. -you can read more about this topic [Here](https://github.com/GarrettBurroughs/Alloy/wiki/Alloy-Update-System) - -### Q. What is a component/what is the difference between the components? -A. Different components have different purposes, for example, a control component would be used for an advanced control system, -whereas a motor component, or motor ocmponent group would be used to control a drivetrain or manipulator - -### Q. What if I don't want to use components? - -A. Things can be done in alloy without the use of components, but if you are designing code for a specific tool or component on the robot, -such as a shooter, drivetrain, or control system, it is highly recommended as components add extra functionality like toggleability, -easier debugging, and updateable methods. But again, all of this can be done without the use of components. - -### Q. ___ isn't working. - -A. If you have a problem first see our [Troubleshooting guide](https://github.com/GarrettBurroughs/Alloy/wiki/Troubleshooting-Guide). If that does not fix your problem you can file an [Issue](https://github.com/GarrettBurroughs/Alloy/issues/new) -using our issue template, please provide as much information as possible so we can fully understand the probelm and fix the issue. - +# Alloy  [![Build Status](https://travis-ci.org/GarrettBurroughs/Alloy.svg?branch=master)](https://travis-ci.org/GarrettBurroughs/Alloy) [![CodeFactor](https://www.codefactor.io/repository/github/garrettburroughs/alloy/badge)](https://www.codefactor.io/repository/github/garrettburroughs/alloy) + +![AlloyLogo](http://gdurl.com/AFl8) + +Status: **Beta** + +Developed by FTC147 and FRC555 + +The goal of Alloy is to provide a robot framework that allows anyone, including new programmers, to be able to implement +high functioning and quality code for their robots. In other terms, Alloy aims to prevent robot code from being a limiting +factor on the performance of the robot. + + +Alloy is a robot framework designed specifically for the First Tech Challenge (FTC), but is also designed +with expandibility in mind. FRC implementation is possible and will be coming in the future. + +Alloy is based off the FRC robot framework [Sprocket](https://github.com/MontclairRobotics/Sprocket), but redesigned to abstract away the more complex ideas but still allow for advanced robot functionality. + +Any information regarding Alloy, including how it works, project structure, as well as in-depth explanation on how to use all of the components +can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) as well as a [quick start guide](). + + + +# FAQ + +### Q. What is the purpose of/how do I use ___? + +A. Every class is heavily documented as well as wiki articles explaining the use of more complex/important parts of alloy + +### Q. I tried to update ___ method using @Update, but it isn't working? + +A. The way alloy is designed, is that everything is split up into components, and a method can only be updated if it is within a component. +you can read more about this topic [Here](https://github.com/GarrettBurroughs/Alloy/wiki/Alloy-Update-System) + +### Q. What is a component/what is the difference between the components? +A. Different components have different purposes, for example, a control component would be used for an advanced control system, +whereas a motor component, or motor ocmponent group would be used to control a drivetrain or manipulator + +### Q. What if I don't want to use components? + +A. Things can be done in alloy without the use of components, but if you are designing code for a specific tool or component on the robot, +such as a shooter, drivetrain, or control system, it is highly recommended as components add extra functionality like toggleability, +easier debugging, and updateable methods. But again, all of this can be done without the use of components. + +### Q. ___ isn't working. + +A. If you have a problem first see our [Troubleshooting guide](https://github.com/GarrettBurroughs/Alloy/wiki/Troubleshooting-Guide). If that does not fix your problem you can file an [Issue](https://github.com/GarrettBurroughs/Alloy/issues/new) +using our issue template, please provide as much information as possible so we can fully understand the probelm and fix the issue. diff --git a/SpotlessLicense b/SpotlessLicense new file mode 100644 index 0000000..31878a2 --- /dev/null +++ b/SpotlessLicense @@ -0,0 +1,23 @@ +/* +MIT License + +Copyright (c) $YEAR Garrett Burroughs + +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. +*/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 4482cb7..315f0e2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,11 @@ -apply plugin: 'java' -apply plugin: 'maven' +plugins { + id "com.diffplug.gradle.spotless" version "3.10.0" + id 'java' + id 'maven' +} + + + group = 'Alloy' version = '0.0.1-SNAPSHOT' @@ -12,13 +18,21 @@ targetCompatibility = 1.8 repositories { - - maven { url "http://repo.maven.apache.org/maven2" } + maven { url "http://repo.maven.apache.org/maven2" } + +} + +spotless { + java { + googleJavaFormat('1.1').aosp() + + licenseHeaderFile 'SpotlessLicense' + } } dependencies{ - testCompile 'junit:junit:4.12' - compile fileTree(dir: "src/main/libs/", include: ['*.jar']) - compile 'org.reflections:reflections:0.9.11' + testCompile 'junit:junit:4.12' + compile fileTree(dir: "src/main/libs/", include: ['*.jar']) + compile 'org.reflections:reflections:0.9.11' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2c2bbe5..6dfd77e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Sun May 06 20:16:45 EDT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/main/java/org/montclairrobotics/alloy/auto/AlloyAutonomous.java b/src/main/java/org/montclairrobotics/alloy/auto/AlloyAutonomous.java index 89f62e4..5ec0bf6 100644 --- a/src/main/java/org/montclairrobotics/alloy/auto/AlloyAutonomous.java +++ b/src/main/java/org/montclairrobotics/alloy/auto/AlloyAutonomous.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.auto; import com.qualcomm.robotcore.eventloop.opmode.OpMode; @@ -7,16 +30,11 @@ * * @author Garrett Burroughs */ -public abstract class AlloyAutonomous extends OpMode{ - +public abstract class AlloyAutonomous extends OpMode { @Override - public void init() { - - } + public void init() {} @Override - public void loop() { - - } + public void loop() {} } diff --git a/src/main/java/org/montclairrobotics/alloy/auto/README.md b/src/main/java/org/montclairrobotics/alloy/auto/README.md index 41048d5..91d5243 100644 --- a/src/main/java/org/montclairrobotics/alloy/auto/README.md +++ b/src/main/java/org/montclairrobotics/alloy/auto/README.md @@ -6,7 +6,7 @@ can be found in the auto package. ## Contents -1. State Machine - A state machine is an object that takes in a number of states and then runs them, states can be ran
+1. State Machine - A state machine is an object that takes in a number of states and then runs them, states can be ran
in a linear fashion by default, but can have more fine tuned control by the user. State machines can also be used outside
of auto modes to run states in teleop. State machines are also states themselves so a state machine can run another state machine @@ -16,4 +16,4 @@ when they have finished running 3. Alloy Autonomus - This is the basic framework for alloy auto's. An alloy autonomous takes care of running the state machine
that the auto is using so all the user has to do is create the state machine and define functionality. -You can read more about how to use an Alloy Autonomous [Here](https://github.com/GarrettBurroughs/Alloy/wiki/Creating-An-Auto-Mode) \ No newline at end of file +You can read more about how to use an Alloy Autonomous [Here](https://github.com/GarrettBurroughs/Alloy/wiki/Creating-An-Auto-Mode) diff --git a/src/main/java/org/montclairrobotics/alloy/auto/State.java b/src/main/java/org/montclairrobotics/alloy/auto/State.java index ebb5b45..e9b515d 100644 --- a/src/main/java/org/montclairrobotics/alloy/auto/State.java +++ b/src/main/java/org/montclairrobotics/alloy/auto/State.java @@ -1,13 +1,36 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.auto; /** * Created by MHS Robotics on 12/16/2017. * - * States are designed to be passed in and run in a state machine. States can be used for + *

States are designed to be passed in and run in a state machine. States can be used for * Autonomous modes as well as autonomously doing actions in teleop. + * * @see StateMachine * @see AlloyAutonomous - * * @author Garrett Burroughs * @since 0.1 * @version 0.1 @@ -16,29 +39,24 @@ public abstract class State { Integer nextState = null; - /** - * The start method is the first thing called when the state is run - */ + /** The start method is the first thing called when the state is run */ public abstract void start(); - /** - * The run method is called every loop while the state is running - */ + /** The run method is called every loop while the state is running */ public abstract void run(); - /** - * The Stop method is the last thing called once the state is done - */ + /** The Stop method is the last thing called once the state is done */ public abstract void stop(); /** * IsDone should return true when the state is finished + * * @return true if the state is done */ public abstract boolean isDone(); - public int getNextState(int currentState){ - if(nextState != null){ + public int getNextState(int currentState) { + if (nextState != null) { return nextState; } return currentState + 1; diff --git a/src/main/java/org/montclairrobotics/alloy/auto/StateMachine.java b/src/main/java/org/montclairrobotics/alloy/auto/StateMachine.java index 6f9cd4d..4c5f120 100644 --- a/src/main/java/org/montclairrobotics/alloy/auto/StateMachine.java +++ b/src/main/java/org/montclairrobotics/alloy/auto/StateMachine.java @@ -1,20 +1,39 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.auto; -import org.montclairrobotics.alloy.core.RobotCore; -import org.montclairrobotics.alloy.ftc.FTCDebug; - import java.util.ArrayList; /** * Created by MHS Robotics on 12/16/2017. * - * A state machine takes in states and runs them in a controlled order.
- * By default the states will run in a linear fashion and the next state will start - * when the previous state has finished.
- *
- * State machines can be used for controlling auto modes, - * but can also be ran in teleop modes for pre coded instructions that make driving easier. - * + *

A state machine takes in states and runs them in a controlled order.
+ * By default the states will run in a linear fashion and the next state will start when the + * previous state has finished.
+ *
+ * State machines can be used for controlling auto modes, but can also be ran in teleop modes for + * pre coded instructions that make driving easier. * * @author Garrett Burroughs * @since @@ -23,43 +42,36 @@ public class StateMachine extends State { ArrayList states; - /** - * Since state machines can run in a non linear fashion, the last state in the array - * may not be the last state in the state machine, finalState keeps track of what signifies the end - * of the state machine. The final state should not be in reference to an actual state, but a number that - * is outside the index of the state machine.
- * For example, if a state machine had 5 states in it, a valid final state would could be 6, and to end the state - * machine, you would simply have the last state you want to run, go to state 6 once it is done.
- * Note: even if your state machine is running in a linear fashion, it needs to have a final state. + * Since state machines can run in a non linear fashion, the last state in the array may not be + * the last state in the state machine, finalState keeps track of what signifies the end of the + * state machine. The final state should not be in reference to an actual state, but a number + * that is outside the index of the state machine.
+ * For example, if a state machine had 5 states in it, a valid final state would could be 6, and + * to end the state machine, you would simply have the last state you want to run, go to state 6 + * once it is done.
+ * Note: even if your state machine is running in a linear fashion, it needs to have a final + * state. */ Integer finalState; - public StateMachine(State ... states){ - - } + public StateMachine(State... states) {} @Override - public void start() { - - } + public void start() {} @Override - public void run() { - - } + public void run() {} @Override - public void stop() { - - } + public void stop() {} @Override public boolean isDone() { return false; } - public void addState(State state){ + public void addState(State state) { states.add(state); } } diff --git a/src/main/java/org/montclairrobotics/alloy/control/ButtonAction.java b/src/main/java/org/montclairrobotics/alloy/control/ButtonAction.java index 4a82752..7d42757 100644 --- a/src/main/java/org/montclairrobotics/alloy/control/ButtonAction.java +++ b/src/main/java/org/montclairrobotics/alloy/control/ButtonAction.java @@ -1,65 +1,76 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.control; import org.montclairrobotics.alloy.core.Button; -import org.montclairrobotics.alloy.update.Updatable; import org.montclairrobotics.alloy.update.Update; -import org.montclairrobotics.alloy.update.Updater; /** * Created by MHS Robotics on 2/11/2018. * - * Every Button action is tied to a button, and controls what - * happens when the button is pressed, held, unpressed, and released + *

Every Button action is tied to a button, and controls what happens when the button is pressed, + * held, unpressed, and released * * @author Garrett Burroughs * @since 0.1 */ -public abstract class ButtonAction { - +public abstract class ButtonAction { + public Button button; - - public ButtonAction(Button button){ + + public ButtonAction(Button button) { this.button = button; } - - - /** - * On pressed is called once, when the button goes from being unpressed, to pressed - */ + + /** On pressed is called once, when the button goes from being unpressed, to pressed */ public abstract void onPressed(); - - /** - * On released is called once, when the button goes from being pressed, to unpressed - */ + + /** On released is called once, when the button goes from being pressed, to unpressed */ public abstract void onReleased(); - - /** - * While pressed is called every loop while the button is pressed - */ + + /** While pressed is called every loop while the button is pressed */ public abstract void whilePressed(); - - /** - * While released is called every loop while the button is unpressed - */ + + /** While released is called every loop while the button is unpressed */ public abstract void whileReleased(); - + public boolean wasPressed = false; - + @Update public void update() { - if(button.getValue()){ + if (button.getValue()) { whilePressed(); - }else{ + } else { whileReleased(); } - if(wasPressed && !button.getValue()){ + if (wasPressed && !button.getValue()) { onReleased(); } - if(!wasPressed && button.getValue()){ + if (!wasPressed && button.getValue()) { onPressed(); } - - + wasPressed = button.getValue(); } } diff --git a/src/main/java/org/montclairrobotics/alloy/control/README.md b/src/main/java/org/montclairrobotics/alloy/control/README.md index f643833..828c0d0 100644 --- a/src/main/java/org/montclairrobotics/alloy/control/README.md +++ b/src/main/java/org/montclairrobotics/alloy/control/README.md @@ -1,13 +1,13 @@ # Control -The control package contains all of the classes that deal with the control features of the robot. +The control package contains all of the classes that deal with the control features of the robot. This is mostly includes the human to robot interaction as well as tools that help the user -control the robot. This package does not however, contain any autonomous robot control, that can be found +control the robot. This package does not however, contain any autonomous robot control, that can be found in the "auto" package -## Contents +## Contents -1. Button Action - Button actions are the way that functionality can be tied to buttons in alloy. A button action can +1. Button Action - Button actions are the way that functionality can be tied to buttons in alloy. A button action can have functionality defined for when a button is pressed, released, held, and un-held -2. Toggle Button - A toggle button is a button that is tied to a toggleable, they toggle the toggleable when the button +2. Toggle Button - A toggle button is a button that is tied to a toggleable, they toggle the toggleable when the button is pressed diff --git a/src/main/java/org/montclairrobotics/alloy/control/ToggleButton.java b/src/main/java/org/montclairrobotics/alloy/control/ToggleButton.java index a85371d..c6d5272 100644 --- a/src/main/java/org/montclairrobotics/alloy/control/ToggleButton.java +++ b/src/main/java/org/montclairrobotics/alloy/control/ToggleButton.java @@ -1,5 +1,27 @@ -package org.montclairrobotics.alloy.control; +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.control; import org.montclairrobotics.alloy.core.Button; import org.montclairrobotics.alloy.utils.Toggleable; @@ -7,52 +29,37 @@ /** * Created by MHS Robotics on 2/11/2018. * - * A ToggleButton is tied to a button and a toggleable, - * when the button is pressed the toggleable will - * toggle between states + *

A ToggleButton is tied to a button and a toggleable, when the button is pressed the toggleable + * will toggle between states + * * @see Toggleable * @see ButtonAction - * * @author Garrett Burroughs * @since 0.1 */ -public class ToggleButton extends ButtonAction{ +public class ToggleButton extends ButtonAction { Toggleable toggleable; - + public ToggleButton(Button button, Toggleable toggleable) { super(button); this.toggleable = toggleable; } - - /** - * On pressed is called once, when the button goes from being unpressed, to pressed - */ + + /** On pressed is called once, when the button goes from being unpressed, to pressed */ @Override public void onPressed() { toggleable.toggle(); } - - /** - * On released is called once, when the button goes from being pressed, to unpressed - */ + + /** On released is called once, when the button goes from being pressed, to unpressed */ @Override - public void onReleased() { - - } - - /** - * While pressed is called every loop while the button is pressed - */ + public void onReleased() {} + + /** While pressed is called every loop while the button is pressed */ @Override - public void whilePressed() { - - } - - /** - * While released is called every loop while the button is unpressed - */ + public void whilePressed() {} + + /** While released is called every loop while the button is unpressed */ @Override - public void whileReleased() { - - } + public void whileReleased() {} } diff --git a/src/main/java/org/montclairrobotics/alloy/core/Alloy.java b/src/main/java/org/montclairrobotics/alloy/core/Alloy.java index 5a79c25..964c7cf 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/Alloy.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Alloy.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.core; import com.qualcomm.robotcore.eventloop.opmode.OpMode; @@ -6,40 +29,35 @@ /** * Created by MHS Robotics on 11/13/2017. * - * The main purpose behind the alloy class is to controll how and when all of the mehotds in Robot are run - * as well as initialize all global variables + *

The main purpose behind the alloy class is to controll how and when all of the mehotds in + * Robot are run as well as initialize all global variables * * @author Garrett Burroughs * @version 0.1 * @since 0.1 - * */ -public abstract class Alloy extends OpMode{ - - +public abstract class Alloy extends OpMode { + /** - * The robotSetup is where all code specific to robot setup is placed - * If you only have one teleop this can be done in the initialization - * Method. robotSetup is called right after the robot core is initialized + * The robotSetup is where all code specific to robot setup is placed If you only have one + * teleop this can be done in the initialization Method. robotSetup is called right after the + * robot core is initialized */ public abstract void robotSetup(); - + /** - * The initialization method is were everything specific to the OpMode - * Should be set up. Initialization will be the first thing called after - * The robot setup. + * The initialization method is were everything specific to the OpMode Should be set up. + * Initialization will be the first thing called after The robot setup. */ public abstract void initialization(); /** - * Although most of the periodic actions are taken care by the updater, the user may want to - * add their own methods and code that need to be updated or run periodically, this can be done in - * the periodic() method - * periodic will be run every loop. + * Although most of the periodic actions are taken care by the updater, the user may want to add + * their own methods and code that need to be updated or run periodically, this can be done in + * the periodic() method periodic will be run every loop. */ public abstract void periodic(); - @Override public void init() { // Set Up the core robot components, This allows them to be accessed throughout the project @@ -49,8 +67,7 @@ public void init() { } @Override - public void loop() - { + public void loop() { Updater.update(); periodic(); } diff --git a/src/main/java/org/montclairrobotics/alloy/core/Button.java b/src/main/java/org/montclairrobotics/alloy/core/Button.java index d37d0aa..5c56181 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/Button.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Button.java @@ -1,20 +1,42 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.core; /** * Created by MHS Robotics on 11/13/2017. * - * The button interface is implemented in ftc button - * The user can get the value of the button, - * In most cases this will be a Boolean (True if pressed, false if not), + *

The button interface is implemented in ftc button The user can get the value of the button, In + * most cases this will be a Boolean (True if pressed, false if not), * * @author Garrett Burroughs * @version 0.1 * @since 0.1 - * */ -public interface Button{ +public interface Button { /** * Gets the value of a button + * * @return returns the value of the button, in most case True(pressed) or False(unpressed) */ public boolean getValue(); diff --git a/src/main/java/org/montclairrobotics/alloy/core/Debug.java b/src/main/java/org/montclairrobotics/alloy/core/Debug.java index 27c4caa..6875349 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/Debug.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Debug.java @@ -1,23 +1,44 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.core; /** * Created by MHS Robotics on 11/13/2017. * - * Debugs are used for debugging information to the user - * In ftc the debugs use Telemetry to read an output to the phone - * The debug allows for easier usage of the telemetry methods - * That are most used for debugging. + *

Debugs are used for debugging information to the user In ftc the debugs use Telemetry to read + * an output to the phone The debug allows for easier usage of the telemetry methods That are most + * used for debugging. * * @author Garrett Burroughs * @version 0.1 * @since 0.1 - * */ public interface Debug { /** * Debugs a value with a Key(Identifier) * - * @param key Name of the value + * @param key Name of the value * @param value Value to be debugged */ public void log(String key, Object value); diff --git a/src/main/java/org/montclairrobotics/alloy/core/Joystick.java b/src/main/java/org/montclairrobotics/alloy/core/Joystick.java index 9f807ce..1fa6c06 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/Joystick.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Joystick.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.core; import org.montclairrobotics.alloy.vector.Vector; @@ -5,12 +28,11 @@ /** * Created by MHS Robotics on 11/14/2017. * - * Joysticks should return a vector made up of the X and Y values of their position + *

Joysticks should return a vector made up of the X and Y values of their position * * @author Garrett Burroughs * @version 0.1 * @since 0.1 - * */ public interface Joystick { /** diff --git a/src/main/java/org/montclairrobotics/alloy/core/Mode.java b/src/main/java/org/montclairrobotics/alloy/core/Mode.java index 784280b..8477a97 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/Mode.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Mode.java @@ -1,22 +1,40 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.core; /** * Created by MHS Robotics on 11/14/2017. * - * Mode stores all the different run modes that a robot can run in + *

Mode stores all the different run modes that a robot can run in * * @author Garrett Burroughs * @version 0.1 * @since 0.1 - * */ public enum Mode { - /** - * ftc Telemetry Operated Mode - */ + /** ftc Telemetry Operated Mode */ FTCTELEOP, - /** - * ftc autonomous mode - */ + /** ftc autonomous mode */ FTCAUTONOMOUS } diff --git a/src/main/java/org/montclairrobotics/alloy/core/Motor.java b/src/main/java/org/montclairrobotics/alloy/core/Motor.java index 009d494..53030f8 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/Motor.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Motor.java @@ -1,14 +1,34 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.core; /** * Created by MHS Robotics on 11/13/2017. * - * - * * @author Garrett Burroughs * @version 0.1 * @since 0.1 - * */ public interface Motor { /** @@ -25,7 +45,6 @@ public interface Motor { */ public double getMotorPower(); - /** * Sets weather the motor runs the default way , or inverted * @@ -34,7 +53,7 @@ public interface Motor { public void setInverted(boolean inverted); /** - * Gets weather the motor is inverted + * Gets weather the motor is inverted * * @return true if the motor is inverted */ diff --git a/src/main/java/org/montclairrobotics/alloy/core/README.md b/src/main/java/org/montclairrobotics/alloy/core/README.md index a6e9bd9..3216c85 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/README.md +++ b/src/main/java/org/montclairrobotics/alloy/core/README.md @@ -1,8 +1,8 @@ # CORE -This is where all the base functionality and components are located. +This is where all the base functionality and components are located. -The intent of Alloy is to be Multi-Platform (FTC aswell as FRC), so everything in core +The intent of Alloy is to be Multi-Platform (FTC aswell as FRC), so everything in core was designed to be the very base components of a robot and should then be implemented in the respective FTC and FRC folders. diff --git a/src/main/java/org/montclairrobotics/alloy/core/RobotCore.java b/src/main/java/org/montclairrobotics/alloy/core/RobotCore.java index d05d3d8..fbc90e0 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/RobotCore.java +++ b/src/main/java/org/montclairrobotics/alloy/core/RobotCore.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.core; import com.qualcomm.robotcore.hardware.Gamepad; @@ -7,47 +30,43 @@ /** * Created by MHS Robotics on 12/5/2017. * - * Since essential parts to the robots operation are stored in OpMode - * @see com.qualcomm.robotcore.eventloop.opmode.OpMode - * The robot core class creates static instances of all of the essentail objects on initialization - * The actual objects are passed in in the alloy class - * @see Alloy - * With this, the user can acess all of the objects throughout the project. + *

Since essential parts to the robots operation are stored in OpMode * + * @see com.qualcomm.robotcore.eventloop.opmode.OpMode The robot core class creates static instances + * of all of the essentail objects on initialization The actual objects are passed in in the + * alloy class + * @see Alloy With this, the user can acess all of the objects throughout the project. * @author Garrett Burroughs * @version 0.1 * @since 0.1 - * */ public class RobotCore { /** - * Telemetry is used for reading out information on the phones and is useful for debugging, - * The telemetry is also used in Debug + * Telemetry is used for reading out information on the phones and is useful for debugging, The + * telemetry is also used in Debug + * * @see Debug */ public static Telemetry telemetry; /** - * The hardware map is essential to any robot and is how the ftc core interacts with the hardware devices - * on the phones + * The hardware map is essential to any robot and is how the ftc core interacts with the + * hardware devices on the phones */ public static HardwareMap hardwareMap; - /** - * The first gamepad, generated by pressing start + 'a' on the controller - */ + /** The first gamepad, generated by pressing start + 'a' on the controller */ public static Gamepad gamepad1; - /** - * The second gamepad, generated by pressing start + 'b' on the controller - */ + /** The second gamepad, generated by pressing start + 'b' on the controller */ public static Gamepad gamepad2; - public RobotCore(Telemetry telemetry, HardwareMap hardwareMap, Gamepad gamepad1, Gamepad gamepad2) { - //Instantiate all static instances - this.telemetry = telemetry; + public RobotCore( + Telemetry telemetry, HardwareMap hardwareMap, Gamepad gamepad1, Gamepad gamepad2) { + // Instantiate all static instances + this.telemetry = telemetry; this.hardwareMap = hardwareMap; - this.gamepad1 = gamepad1; - this.gamepad2 = gamepad2; + this.gamepad1 = gamepad1; + this.gamepad2 = gamepad2; } /** @@ -55,7 +74,7 @@ public RobotCore(Telemetry telemetry, HardwareMap hardwareMap, Gamepad gamepad1, * * @return the hardware map */ - public static HardwareMap getHardwareMap(){ + public static HardwareMap getHardwareMap() { return hardwareMap; } @@ -64,7 +83,7 @@ public static HardwareMap getHardwareMap(){ * * @return telemetry */ - public static Telemetry getTelemetry() throws NullPointerException{ + public static Telemetry getTelemetry() throws NullPointerException { return telemetry; } diff --git a/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java b/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java index 1fba1f5..2f423b3 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/core/TargetMotor.java @@ -1,25 +1,47 @@ -package org.montclairrobotics.alloy.core; +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs +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 org.montclairrobotics.alloy.core; /** - * Target motor is a motor interface for motors that have encoders. - * Target motors can set encoder positions using PID control + * Target motor is a motor interface for motors that have encoders. Target motors can set encoder + * positions using PID control */ -public interface TargetMotor extends Motor{ +public interface TargetMotor extends Motor { /** * Sets the motor Power * * @param power the power that the motor will be set to (0-1 inclusive ) */ public void setTargetPower(double power); - + /** * Gets the motor power * * @return the current motor power, a value between (0-1) */ public double getTargetPower(); - + /** * Sets the motor position * diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java b/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java index 9a64841..babe125 100644 --- a/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java +++ b/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.drive; /** diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java b/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java index 04299a2..d71e835 100644 --- a/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java +++ b/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.drive; /** @@ -6,5 +29,4 @@ * @author Garrett Burroughs * @since 0.1 */ -public class DriveTrain { -} +public class DriveTrain {} diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCButton.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCButton.java index 558738f..94bd61c 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCButton.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCButton.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.ftc; import com.qualcomm.robotcore.hardware.Gamepad; @@ -7,82 +30,83 @@ /** * Created by MHS Robotics on 11/14/2017. * - * An FTC button provides implementation for a button used in the FTC competition + *

An FTC button provides implementation for a button used in the FTC competition + * * @author Garrett Burroughs * @since 0.1 */ public class FTCButton implements Button { - + Input buttonInput; private boolean inverted; - - public FTCButton(Input buttonInput){ + + public FTCButton(Input buttonInput) { this(buttonInput, false); } - public FTCButton(Input buttonInput, boolean invert){ + public FTCButton(Input buttonInput, boolean invert) { this.buttonInput = buttonInput; this.inverted = invert; } - + @Override public boolean getValue() { - if(inverted) { + if (inverted) { return !buttonInput.get(); - }else{ + } else { return buttonInput.get(); } } - + // BUTTON PAD - public static FTCButton getAButton(Gamepad gamepad){ + public static FTCButton getAButton(Gamepad gamepad) { return new FTCButton(() -> gamepad.a); } - - public static FTCButton getBButton(Gamepad gamepad){ + + public static FTCButton getBButton(Gamepad gamepad) { return new FTCButton(() -> gamepad.b); } - - public static FTCButton getXButton(Gamepad gamepad){ + + public static FTCButton getXButton(Gamepad gamepad) { return new FTCButton(() -> gamepad.x); } - - public static FTCButton getYButton(Gamepad gamepad){ + + public static FTCButton getYButton(Gamepad gamepad) { return new FTCButton(() -> gamepad.y); } - + // DPAD - public static FTCButton getDPADUp(Gamepad gamepad){ + public static FTCButton getDPADUp(Gamepad gamepad) { return new FTCButton(() -> gamepad.dpad_up); } - - public static FTCButton getDPADDown(Gamepad gamepad){ + + public static FTCButton getDPADDown(Gamepad gamepad) { return new FTCButton(() -> gamepad.dpad_down); } - - public static FTCButton getYDPADRight(Gamepad gamepad){ + + public static FTCButton getYDPADRight(Gamepad gamepad) { return new FTCButton(() -> gamepad.dpad_right); } - - public static FTCButton getDPADLeft(Gamepad gamepad){ + + public static FTCButton getDPADLeft(Gamepad gamepad) { return new FTCButton(() -> gamepad.dpad_left); } - + // Bumpers - public static FTCButton getRightBumper(Gamepad gamepad){ + public static FTCButton getRightBumper(Gamepad gamepad) { return new FTCButton(() -> gamepad.right_bumper); } - - public static FTCButton getLeftBumper(Gamepad gamepad){ + + public static FTCButton getLeftBumper(Gamepad gamepad) { return new FTCButton(() -> gamepad.left_bumper); } - + // Triggers - public static FTCButton getRightTrigger(Gamepad gamepad){ + public static FTCButton getRightTrigger(Gamepad gamepad) { return new FTCButton(() -> gamepad.right_trigger > .5); } - - public static FTCButton getLeftTrigger(Gamepad gamepad){ + + public static FTCButton getLeftTrigger(Gamepad gamepad) { return new FTCButton(() -> gamepad.left_trigger > .5); } } diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCDebug.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCDebug.java index ddaaddb..1c11c96 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCDebug.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCDebug.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.ftc; import org.firstinspires.ftc.robotcore.external.Telemetry; @@ -7,10 +30,8 @@ /** * Created by MHS Robotics on 11/14/2017. * - * The FTCDebug class is a basic wrapper around the - * ftc telemetry framework and allows telemetry to be - * used in any class as well as making debugging information - * easier + *

The FTCDebug class is a basic wrapper around the ftc telemetry framework and allows telemetry + * to be used in any class as well as making debugging information easier * * @author Garrett Burroughs * @since 0.1 @@ -22,10 +43,11 @@ public class FTCDebug implements Debug { public FTCDebug() { try { this.telemetry = RobotCore.getTelemetry(); - }catch (NullPointerException e){ + } catch (NullPointerException e) { e.printStackTrace(); } } + @Override public void log(String key, Object value) { telemetry.addData(key, value); diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java index 20d5f50..b2c67c6 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java @@ -1,6 +1,28 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.ftc; -import com.qualcomm.robotcore.eventloop.opmode.OpMode; import com.qualcomm.robotcore.hardware.Gamepad; import org.montclairrobotics.alloy.core.Joystick; import org.montclairrobotics.alloy.vector.Vector; @@ -12,24 +34,24 @@ * @author Garrett Burroughs * @since 0.1 */ -public class FTCJoystick implements Joystick{ - - public enum Side{ +public class FTCJoystick implements Joystick { + + public enum Side { RIGHT, LEFT } - + Gamepad gamepad; Side side; - + public FTCJoystick(Gamepad gamepad, Side side) { this.gamepad = gamepad; this.side = side; } - + @Override - public Vector getValue(){ - switch (side){ + public Vector getValue() { + switch (side) { case RIGHT: return new XY(gamepad.right_stick_x, gamepad.right_stick_y); case LEFT: @@ -38,6 +60,4 @@ public Vector getValue(){ return new XY(0, 0); } } - - } diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java index eed7b81..16fcbb1 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java @@ -1,31 +1,52 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.ftc; import com.qualcomm.robotcore.hardware.DcMotor; import com.qualcomm.robotcore.hardware.DcMotorSimple; import org.montclairrobotics.alloy.core.Motor; import org.montclairrobotics.alloy.core.RobotCore; -import org.montclairrobotics.alloy.core.TargetMotor; /** * Created by MHS Robotics on 11/14/2017. * - * FTCMotor is a basic implementation of a motor used for FTC. - * Basic FTC motors can be controlled using motor power but can - * not have their positions set using encoders. If you wish to - * set a motors position - * @see FTCTargetMotor + *

FTCMotor is a basic implementation of a motor used for FTC. Basic FTC motors can be controlled + * using motor power but can not have their positions set using encoders. If you wish to set a + * motors position * + * @see FTCTargetMotor * @author Garrett Burroughs * @since 0.1 */ public class FTCMotor implements Motor { - + DcMotor motor; - + public FTCMotor(String motorConfiguration) { motor = RobotCore.getHardwareMap().dcMotor.get(motorConfiguration); } - + /** * Sets the motor Power * @@ -36,7 +57,7 @@ public void setMotorPower(double power) { motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER); motor.setPower(power); } - + /** * Gets the motor power * @@ -46,20 +67,20 @@ public void setMotorPower(double power) { public double getMotorPower() { return motor.getPower(); } - + /** * Sets weather the motor runs the default way , or inverted * * @param inverted true for inverted, false for normal */ public void setInverted(boolean inverted) { - if(inverted) { + if (inverted) { motor.setDirection(DcMotorSimple.Direction.REVERSE); - } else{ + } else { motor.setDirection(DcMotorSimple.Direction.FORWARD); } } - + /** * Gets weather the motor is inverted * diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java index bbc995d..048521d 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.ftc; import com.qualcomm.robotcore.hardware.DcMotor; @@ -5,16 +28,14 @@ import org.montclairrobotics.alloy.update.Update; import org.montclairrobotics.alloy.utils.PID; - /** * Created by MHS Robotics on 2/24/2018. * - * A target motor is a motor that can use encoders to be set to a certain position - * Since FTC motors have their own PIDs that they are controlled with by default, - * the user has the ability to override this and use custom PIDs if need be. - * By default, the user does not have to worry about any of this. - * Do not attempt to change the PID if you do not know what you are doing - * You can read more about PIDs here https://en.wikipedia.org/wiki/PID_controller + *

A target motor is a motor that can use encoders to be set to a certain position Since FTC + * motors have their own PIDs that they are controlled with by default, the user has the ability to + * override this and use custom PIDs if need be. By default, the user does not have to worry about + * any of this. Do not attempt to change the PID if you do not know what you are doing You can read + * more about PIDs here https://en.wikipedia.org/wiki/PID_controller * * @author Garrett Burroughs * @since 0.1 @@ -24,32 +45,27 @@ public FTCTargetMotor(String motorConfiguration) { super(motorConfiguration); motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); } - - enum Mode{ + + enum Mode { /** - * Defualt target motor runmode - * The default mode will run using the build in Motor PIDs to control the motor + * Defualt target motor runmode The default mode will run using the build in Motor PIDs to + * control the motor */ DEFAULT, /** - * Custom target motor runmode - * The custom mode will control the motor with a user defined PID controller + * Custom target motor runmode The custom mode will control the motor with a user defined + * PID controller */ CUSTOM } - /** - * PID being used to control the motor in custom mode - */ + /** PID being used to control the motor in custom mode */ private PID pid; - - /** - * Current target motor runmode - * NOTE: not equal to the DCMotor runmode - */ + + /** Current target motor runmode NOTE: not equal to the DCMotor runmode */ private Mode runmode = Mode.DEFAULT; - + /** * Sets the motor position * @@ -57,10 +73,10 @@ enum Mode{ */ @Override public void setPosition(int position) { - if(runmode == Mode.DEFAULT){ + if (runmode == Mode.DEFAULT) { motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); motor.setTargetPosition(position); - }else{ + } else { pid.setTarget(position); } } @@ -96,18 +112,17 @@ public double getTargetPower() { } /** - * Set the motor to run using a custom PID + * Set the motor to run using a custom PID + * * @param pid the PID that the motor will be controlled with */ - public void setPID(PID pid){ + public void setPID(PID pid) { this.pid = pid; runmode = runmode.CUSTOM; } - /** - * Stop using the custom PID and return to using the default mode - */ - public void disablePID(){ + /** Stop using the custom PID and return to using the default mode */ + public void disablePID() { this.pid = null; runmode = Mode.DEFAULT; } @@ -117,28 +132,25 @@ public void disablePID(){ */ @Update public void update() { - if(runmode == Mode.CUSTOM){ + if (runmode == Mode.CUSTOM) { motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER); setTargetPower(pid.get()); } } - /** - * @return the PID being used to control the motor - */ + /** @return the PID being used to control the motor */ public PID getPid() { return pid; } - /** - * @return the motor being controlled - */ + /** @return the motor being controlled */ public DcMotor getMotor() { return motor; } /** * NOTE: this is not the same as the DCMotor runmode + * * @return the current target motor runmode */ public Mode getRunmode() { diff --git a/src/main/java/org/montclairrobotics/alloy/test/Shooter.java b/src/main/java/org/montclairrobotics/alloy/test/Shooter.java index 8a658b8..cbbeef8 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/Shooter.java +++ b/src/main/java/org/montclairrobotics/alloy/test/Shooter.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.test; import org.montclairrobotics.alloy.core.Motor; @@ -8,7 +31,6 @@ public class Shooter extends Toggleable { Motor motorR = new FTCMotor("Right PoweredMotor"); Motor motorL = new FTCMotor("Left PoweredMotor"); - @Override public void enableAction() { motorR.setMotorPower(1); diff --git a/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java b/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java index 20d7210..e52ba87 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java +++ b/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.test; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; @@ -17,18 +40,17 @@ public void robotSetup() { } @Override - public void initialization() { - - } + public void initialization() {} @Override public void periodic() { - Input shooterButton = new Input() { - @Override - public Boolean get() { - return gamepad1.a; - } - }; + Input shooterButton = + new Input() { + @Override + public Boolean get() { + return gamepad1.a; + } + }; new ToggleButton(new FTCButton(shooterButton), shooter); } diff --git a/src/main/java/org/montclairrobotics/alloy/update/Updatable.java b/src/main/java/org/montclairrobotics/alloy/update/Updatable.java index 4348baa..6d1b3aa 100644 --- a/src/main/java/org/montclairrobotics/alloy/update/Updatable.java +++ b/src/main/java/org/montclairrobotics/alloy/update/Updatable.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.update; import java.lang.reflect.InvocationTargetException; @@ -23,7 +46,7 @@ public class Updatable { this.parameters = parameters; } - public void run(){ + public void run() { try { update.invoke(clazz); } catch (IllegalAccessException e) { @@ -33,7 +56,7 @@ public void run(){ } } - public int getUpdateRate(){ + public int getUpdateRate() { return updateRate; } } diff --git a/src/main/java/org/montclairrobotics/alloy/update/Update.java b/src/main/java/org/montclairrobotics/alloy/update/Update.java index f9db354..a8779f6 100644 --- a/src/main/java/org/montclairrobotics/alloy/update/Update.java +++ b/src/main/java/org/montclairrobotics/alloy/update/Update.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.update; import java.lang.annotation.ElementType; @@ -9,5 +32,6 @@ @Target({ElementType.METHOD}) public @interface Update { int updateRate() default 1; + int priority() default 0; } diff --git a/src/main/java/org/montclairrobotics/alloy/update/Updater.java b/src/main/java/org/montclairrobotics/alloy/update/Updater.java index 3272379..ef18fc1 100644 --- a/src/main/java/org/montclairrobotics/alloy/update/Updater.java +++ b/src/main/java/org/montclairrobotics/alloy/update/Updater.java @@ -1,14 +1,36 @@ -package org.montclairrobotics.alloy.update; +/* +MIT License -import org.reflections.Reflections; -import org.reflections.scanners.MethodAnnotationsScanner; -import org.reflections.scanners.SubTypesScanner; +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.update; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.Comparator; import java.util.Set; import java.util.TreeMap; +import org.reflections.Reflections; +import org.reflections.scanners.MethodAnnotationsScanner; +import org.reflections.scanners.SubTypesScanner; /** * Created by MHS Robotics on 12/5/2017. @@ -16,44 +38,48 @@ * @author Garrett Burroughs * @since 0.1 */ - -//I'm making my life so much harder than it has to be because I hate myself public class Updater { private static int counter; - private static TreeMap updateables = new TreeMap<>(new Comparator() { - @Override - public int compare(Integer o1, Integer o2) { - return o2 - o1; - } - }); - + private static TreeMap updateables = + new TreeMap<>( + new Comparator() { + @Override + public int compare(Integer o1, Integer o2) { + return o2 - o1; + } + }); - public static void registerUpdatables() { + public static void registerUpdatables() { String userFiles = ""; - Reflections alloyReflections = new Reflections("org.montclairrobotics", new MethodAnnotationsScanner(), new SubTypesScanner()); + Reflections alloyReflections = + new Reflections( + "org.montclairrobotics", + new MethodAnnotationsScanner(), + new SubTypesScanner()); // Reflections userRefelecitons = new Reflections(userFiles); System.out.println(alloyReflections.getMethodsAnnotatedWith(Update.class)); Set methods = alloyReflections.getMethodsAnnotatedWith(Update.class); - for(Method method : methods){ + for (Method method : methods) { int updateRate = 1; int priority = 0; - for(Annotation annotation : method.getDeclaredAnnotations()){ - if(annotation instanceof Update){ + for (Annotation annotation : method.getDeclaredAnnotations()) { + if (annotation instanceof Update) { updateRate = ((Update) annotation).updateRate(); priority = ((Update) annotation).priority(); } } - updateables.put(priority, new Updatable(method, updateRate, method.getClass(), method.getParameters())); + updateables.put( + priority, + new Updatable(method, updateRate, method.getClass(), method.getParameters())); } } - public static void update() { - for (Updatable updatable : updateables.values()){ - if(counter % updatable.getUpdateRate() == 0){ + for (Updatable updatable : updateables.values()) { + if (counter % updatable.getUpdateRate() == 0) { updatable.run(); } } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Input.java b/src/main/java/org/montclairrobotics/alloy/utils/Input.java index 5b5bee3..828a3a4 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/Input.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/Input.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.utils; /** diff --git a/src/main/java/org/montclairrobotics/alloy/utils/PID.java b/src/main/java/org/montclairrobotics/alloy/utils/PID.java index 93c84fa..6155316 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/PID.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/PID.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.utils; import org.montclairrobotics.alloy.update.Update; @@ -5,18 +28,17 @@ /** * Created by Montclair robotics on 2/27/2018 * - * A PID controller is able to control a component that has a target, current state, and can be controlled for example: - * - A robots heading using a Gryo - * - A motors position using encoders + *

A PID controller is able to control a component that has a target, current state, and can be + * controlled for example: - A robots heading using a Gryo - A motors position using encoders * - * PID stands for Proportion, Integral and Derivative control. - * It uses the error of a component and then calculates the correction - * the PID values must be tuned in order to have a working PID loop - * A properly tuned implementation of a PID controller should result in a correction that goes fast, and accurate to - * its target, and does not overshoot it. + *

PID stands for Proportion, Integral and Derivative control. It uses the error of a component + * and then calculates the correction the PID values must be tuned in order to have a working PID + * loop A properly tuned implementation of a PID controller should result in a correction that goes + * fast, and accurate to its target, and does not overshoot it. * - * You can read more about implementing PID control here https://github.com/GarrettBurroughs/Alloy/wiki/Using-PID-control - * You can read more about how PID works here https://en.wikipedia.org/wiki/PID_controller + *

You can read more about implementing PID control here + * https://github.com/GarrettBurroughs/Alloy/wiki/Using-PID-control You can read more + * about how PID works here https://en.wikipedia.org/wiki/PID_controller * * @author Garrett Burroughs * @since 0.1 @@ -29,35 +51,43 @@ public class PID implements Input { private double target; private double correction; - /** The error of the PID, calculated by the target - input*/ + /** The error of the PID, calculated by the target - input */ private double error; - /** The rate that the error is changing on a certain interval (Slope of the error if it were graphed) AKA derivative*/ + /** + * The rate that the error is changing on a certain interval (Slope of the error if it were + * graphed) AKA derivative + */ private double errorRate; - /** The total error that has accumulated over time (Area under the graph if the error were graphed) AKA Integral*/ + /** + * The total error that has accumulated over time (Area under the graph if the error were + * graphed) AKA Integral + */ private double totalError; - /** The error of the previous calculation, used for calculating the rate of error*/ + /** The error of the previous calculation, used for calculating the rate of error */ private double prevError; - /** The time of the previous calculation, used for calculating the rate of error*/ + /** The time of the previous calculation, used for calculating the rate of error */ private double prevTime; - /** The difference in time between update loops*/ + /** The difference in time between update loops */ private double timeDifference; - /** The difference in error between update loops*/ + /** The difference in error between update loops */ private double errorDifference; - + /** * Create a new PID + * * @param p proportional constant * @param i integral constant * @param d derivative constant */ - public PID(double p, double i, double d){ + public PID(double p, double i, double d) { this.p = p; this.i = i; this.d = d; } - + /** * Create a new PID with the input and target defined + * * @param p proportional constan * @param i integral constant * @param d derivative constant @@ -72,12 +102,12 @@ public PID(double p, double i, double d, Input input, double target) { this.target = target; } - public PID setTarget(double target){ + public PID setTarget(double target) { this.target = target; return this; } - public PID setInput(Input input){ + public PID setInput(Input input) { this.input = input; return this; } @@ -88,17 +118,18 @@ public Double get() { } /** - * The update method should be defined for every updatable, and is called every loop if added to the updater + * The update method should be defined for every updatable, and is called every loop if added to + * the updater */ - @Update public void update() { // Calculate Error try { error = target - input.get(); - }catch(NullPointerException e){ - throw new RuntimeException("PID input has not been defined use pid.setInput(Input input), to set it"); + } catch (NullPointerException e) { + throw new RuntimeException( + "PID input has not been defined use pid.setInput(Input input), to set it"); } // calculate time difference in time since the last update @@ -110,7 +141,7 @@ public void update() { // Calculate slope of the error (Derivative) change in error / change in time try { errorRate = errorDifference / timeDifference; - }catch(ArithmeticException e){ + } catch (ArithmeticException e) { errorRate = 0; } @@ -121,6 +152,6 @@ public void update() { correction = p * error + i * totalError + d * errorRate; prevError = error; - prevTime = System.currentTimeMillis()/1000d; + prevTime = System.currentTimeMillis() / 1000d; } } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Toggleable.java b/src/main/java/org/montclairrobotics/alloy/utils/Toggleable.java index a8397dd..aaa142e 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/Toggleable.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/Toggleable.java @@ -1,75 +1,83 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.utils; /** * Created by MHS Robotics on 2/11/2018. * - * Toggleables are used for objects of mechanisms that can - * either be on (Enabled), or off toggleables can have - * actions defined for when they are enabled and disabled, - * as well as be tied to different parts of alloy like - * buttons and auto states - * @see org.montclairrobotics.alloy.control.ToggleButton + *

Toggleables are used for objects of mechanisms that can either be on (Enabled), or off + * toggleables can have actions defined for when they are enabled and disabled, as well as be tied + * to different parts of alloy like buttons and auto states * + * @see org.montclairrobotics.alloy.control.ToggleButton * @author Garrett Burroughs * @since 0.1 */ public abstract class Toggleable { - - /** - * Method to be called when the toggleable is enabled - */ + + /** Method to be called when the toggleable is enabled */ public abstract void enableAction(); - - /** - * Method to be called when the toggleable is disabled - */ + + /** Method to be called when the toggleable is disabled */ public abstract void disableAction(); - - /** - * The status of the toggleable, to keep track of weather it is enabled, or disabled - */ + + /** The status of the toggleable, to keep track of weather it is enabled, or disabled */ Status status; - - - enum Status{ + + enum Status { ENABLED(true), DISABLED(false); - - + boolean enabled; - private Status(boolean enabled){ + + private Status(boolean enabled) { this.enabled = enabled; } - - public boolean booleanValue(){ + + public boolean booleanValue() { return enabled; } } - - /** - * Enables the toggleable - */ - public void enable(){ + + /** Enables the toggleable */ + public void enable() { status = Status.ENABLED; enableAction(); } - - - /** - * Disables the toggleable - */ - public void disable(){ + + /** Disables the toggleable */ + public void disable() { status = Status.DISABLED; disableAction(); } - + /** - * Switches(Toggles), between the two states, - * If the toggleable is disabled, enable it - * If the toggleable is enabled, disable it + * Switches(Toggles), between the two states, If the toggleable is disabled, enable it If the + * toggleable is enabled, disable it */ - public void toggle(){ - switch (status){ + public void toggle() { + switch (status) { case ENABLED: disable(); break; diff --git a/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java b/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java index 6936ed5..419fb23 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java @@ -1,6 +1,26 @@ -package org.montclairrobotics.alloy.utils; +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs -public class TuneablePID { +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 org.montclairrobotics.alloy.utils; -} +public class TuneablePID {} diff --git a/src/main/java/org/montclairrobotics/alloy/vector/Angle.java b/src/main/java/org/montclairrobotics/alloy/vector/Angle.java index f41766c..ad4a747 100644 --- a/src/main/java/org/montclairrobotics/alloy/vector/Angle.java +++ b/src/main/java/org/montclairrobotics/alloy/vector/Angle.java @@ -1,12 +1,34 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.vector; /** * Created by MHS Robotics on 11/13/2017. * - * - * The angle class allows for easy management of angles as well as easy conversion between degree and radian - * angle measure - * The class keeps track of the angle in degrees but can easily be converted to radians + *

The angle class allows for easy management of angles as well as easy conversion between degree + * and radian angle measure The class keeps track of the angle in degrees but can easily be + * converted to radians * * @author Garrett Burroughs * @version 0.1 @@ -14,42 +36,36 @@ */ public class Angle { - /** - * AngleMeasure, is used for keeping track of what type of angle measure the angle is being created with + * AngleMeasure, is used for keeping track of what type of angle measure the angle is being + * created with */ - enum AngleMeasure{ - /** - * Radian Angle Measure - */ + enum AngleMeasure { + /** Radian Angle Measure */ RADIAN, - /** - * Degree Angle Measure - */ + /** Degree Angle Measure */ DEGREE } - /** - * Keeps Track of the degrees that the angle is - */ + /** Keeps Track of the degrees that the angle is */ private double degrees; // Zero Angle public final Angle ZERO = new Angle(AngleMeasure.DEGREE, 0); - /** * Creating a new angle with an angle measure unit and the measure of the angle itself * * @param angleMeasure What unit to be used for the angle measure - * @param angle The angle + * @param angle The angle */ - public Angle(AngleMeasure angleMeasure, double angle){ - // If angle is in degrees set degrees to the angle, no conversion is needed because they are the same unit - if(angleMeasure == AngleMeasure.DEGREE){ + public Angle(AngleMeasure angleMeasure, double angle) { + // If angle is in degrees set degrees to the angle, no conversion is needed because they are the + // same unit + if (angleMeasure == AngleMeasure.DEGREE) { degrees = angle; - }else{ + } else { // Convert the radian measure to degrees (radians to degrees: (angle * PI)/180) degrees = angle * (Math.PI / 180); } @@ -60,28 +76,25 @@ public Angle(AngleMeasure angleMeasure, double angle){ * * @param degrees Degree angle measure */ - public Angle(double degrees){ + public Angle(double degrees) { this(AngleMeasure.DEGREE, degrees); } - - - /** * Get the angle measure in degrees * - * @return the degree angle measure + * @return the degree angle measure */ - public double getDegrees(){ + public double getDegrees() { return degrees; } /** * Get the angle measure in radians * - * @return the radian angle measure + * @return the radian angle measure */ - public double getRadians(){ + public double getRadians() { return degrees * (Math.PI / 180); } @@ -90,7 +103,7 @@ public double getRadians(){ * * @param degrees the degree angle measure */ - public void setDegrees(double degrees){ + public void setDegrees(double degrees) { this.degrees = degrees; } @@ -99,8 +112,8 @@ public void setDegrees(double degrees){ * * @param radians the degree angle measure */ - public void setRadians(double radians){ - this.degrees = radians * (180/Math.PI); + public void setRadians(double radians) { + this.degrees = radians * (180 / Math.PI); } /** @@ -108,7 +121,7 @@ public void setRadians(double radians){ * * @return the sine of the angle */ - public double sin(){ + public double sin() { return Math.sin(getRadians()); } @@ -117,7 +130,7 @@ public double sin(){ * * @return the cosine of the angle */ - public double cos(){ + public double cos() { return Math.cos(getRadians()); } @@ -126,8 +139,7 @@ public double cos(){ * * @return the tangent of the angle */ - public double tan(){ + public double tan() { return Math.tan(getRadians()); } - } diff --git a/src/main/java/org/montclairrobotics/alloy/vector/Polar.java b/src/main/java/org/montclairrobotics/alloy/vector/Polar.java index 56f0a99..a3e3a6b 100644 --- a/src/main/java/org/montclairrobotics/alloy/vector/Polar.java +++ b/src/main/java/org/montclairrobotics/alloy/vector/Polar.java @@ -1,23 +1,45 @@ -package org.montclairrobotics.alloy.vector; +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.vector; /** * Created by MHS Robotics on 11/14/2017. * - * A vector can be defined in rectangular(XY), or polar form.
- * This class is implementation for vectors in Polar form
+ *

A vector can be defined in rectangular(XY), or polar form.
+ * This class is implementation for vectors in Polar form
* It controls the conversions from rectangular to polar and vice versa * - * https://en.wikipedia.org/wiki/Vector_notation - * @see Vector + *

https://en.wikipedia.org/wiki/Vector_notation * + * @see Vector * @author Garrett Burroughs * @version 0.1 * @since 0.1 */ public class Polar implements Vector { private double magnitude; - private Angle angle; + private Angle angle; public Polar(double magnitude, Angle angle) { this.magnitude = magnitude; @@ -108,25 +130,25 @@ public void setAngle(Angle angle) { /** * Adds two vectors together and returns the result + * *

+ * + *

The result of a vector addition will be another vector, One way of adding two vectors + * together is splitting it up into it's x and y components and adding them together and making + * a new vector out of those components
+ * EX:
+ * V1 = 3i + 4j
+ * V2 = 7i + 5j
+ *
+ * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
+ * Geometric Visualization:
+ * Vectors can also be added in a geometric way through the "Tip-To-Tail" method, In this method + * both the vectors are drawn using arrow vector notation + * https://en.wikipedia.org/wiki/Vector_notation one vector is then drawn at the + * edge of the first vector. The resultant vector is then drawn from the start of the first + * vector to the tip of the second vector This is where the name tip to tail comes from + * *

- * The result of a vector addition will be another vector, - * One way of adding two vectors together is splitting it up into it's x and y components and adding them - * together and making a new vector out of those components
- * EX:
- * V1 = 3i + 4j
- * V2 = 7i + 5j
- *
- * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j - *
- * Geometric Visualization:
- * Vectors can also be added in a geometric way through the "Tip-To-Tail" method, - * In this method both the vectors are drawn using arrow vector notation https://en.wikipedia.org/wiki/Vector_notation - * one vector is then drawn at the edge of the first vector. - * The resultant vector is then drawn from the start of the first vector to the tip of the second vector - * This is where the name tip to tail comes from - *

- *

* * @param vector The vector to be added * @return The result of the two vectors being added @@ -138,17 +160,17 @@ public Vector add(Vector vector) { /** * Subtracts a vector and returns the result + * *

- *

- * vector subtraction is similar to vector addition but the direction of the vector being subtracted - * is simply reversed
- * EX:
- * V1 = 3i + 4j
- * V2 = 7i + 5j
- *
- * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
- * V1 - V2 = 3i + (-7i) + 4j + (-5j) = -4i + -j
- *

+ * + *

vector subtraction is similar to vector addition but the direction of the vector being + * subtracted is simply reversed
+ * EX:
+ * V1 = 3i + 4j
+ * V2 = 7i + 5j
+ *
+ * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
+ * V1 - V2 = 3i + (-7i) + 4j + (-5j) = -4i + -j
* * @param vector The vector to be subtracted * @return The result of the passed in vector being subtracted from the vector object @@ -171,16 +193,15 @@ public Vector scale(double scalar) { /** * Returns the product of two vectors that have been crossed + * *

- *

- * The result of the cross product is a vector, - * The cross product of a vector is the vector that is perpendicular to both vectors - * When crossing two 2dimensional vectors the result will be a 3dimensional vector - * Because of this this method only returns the magnitude (Z component) of the cross product - * The magnitude of the cross product is same as the area of the parallelogram that the two - * vectors make in the X/Y plane.
+ * + *

The result of the cross product is a vector, The cross product of a vector is the vector + * that is perpendicular to both vectors When crossing two 2dimensional vectors the result will + * be a 3dimensional vector Because of this this method only returns the magnitude (Z component) + * of the cross product The magnitude of the cross product is same as the area of the + * parallelogram that the two vectors make in the X/Y plane.
* https://en.wikipedia.org/wiki/Cross_product - *

* * @param vector the vector to be multiplied using the cross product * @return the magnitude of the cross product of the two vectors @@ -192,18 +213,17 @@ public double cross(Vector vector) { /** * Returns the dot product of two vectors + * *

- *

- * The result of the dot product is a scalar value (number), - * The dot product can be viewed as the projection of one vector on to another times the magnitude of the - * original vector
- * This can be written mathematically as |A||B|cos(theta), where theta is the angle between A and B - * Another mathematical representation of the dot product using its components is:
- * A = {@literal }
- * B = {@literal }
- * A . B = a1*b1 + a2*b2
+ * + *

The result of the dot product is a scalar value (number), The dot product can be viewed as + * the projection of one vector on to another times the magnitude of the original vector
+ * This can be written mathematically as |A||B|cos(theta), where theta is the angle between A + * and B Another mathematical representation of the dot product using its components is:
+ * A = {@literal }
+ * B = {@literal }
+ * A . B = a1*b1 + a2*b2
* https://en.wikipedia.org/wiki/Dot_product - *

* * @param vector The vector to be multiplied using the dot product * @return the scalar result of the dot of the two vectors @@ -237,15 +257,15 @@ public Angle angleBetween(Vector vector) { /** * Normalizes a vector and returns the result + * *

- *

- * A normalized vector is a vector with magnitude 1. - * Normalized vectors are also called unit vectors. - * A normalized vector keeps it's direction as well as the same proportions of its components. - * When a vector is defined by its components it can be normalized it can be expressed as
- * A = {@literal }
- * A' = {@literal }
- *

+ * + *

A normalized vector is a vector with magnitude 1. Normalized vectors are also called unit + * vectors. A normalized vector keeps it's direction as well as the same proportions of its + * components. When a vector is defined by its components it can be normalized it can be + * expressed as
+ * A = {@literal }
+ * A' = {@literal }
* * @return the normalized vector */ diff --git a/src/main/java/org/montclairrobotics/alloy/vector/Vector.java b/src/main/java/org/montclairrobotics/alloy/vector/Vector.java index 0fabfad..28916cf 100644 --- a/src/main/java/org/montclairrobotics/alloy/vector/Vector.java +++ b/src/main/java/org/montclairrobotics/alloy/vector/Vector.java @@ -1,24 +1,49 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.vector; /** - * Created by MHS Robotics on 11/14/2017.
- *
- * Interface for creating vector classes, implemented in vector.XY and vector.Polar
- *
- * Since a 2D vector can be made up of an angle and a Magnitude or it's vector components (XY) - * The vector interface contains all functionality that a vector should have and it is then implemented - * in each vector subclass
- *
- * NOTE: No mathematical operations are performed on the vector but return a new vector that is the result of the operation
- *
- * To read more about vectors see here https://en.wikipedia.org/wiki/Euclidean_vector
- * To read more about dot products see here https://en.wikipedia.org/wiki/Dot_product
- * To read more about cross products see here https://en.wikipedia.org/wiki/Cross_product
+ * Created by MHS Robotics on 11/14/2017.
+ *
+ * Interface for creating vector classes, implemented in vector.XY and vector.Polar
+ *
+ * Since a 2D vector can be made up of an angle and a Magnitude or it's vector components (XY) The + * vector interface contains all functionality that a vector should have and it is then implemented + * in each vector subclass
+ *
+ * NOTE: No mathematical operations are performed on the vector but return a new vector that is the + * result of the operation
+ *
+ * To read more about vectors see here https://en.wikipedia.org/wiki/Euclidean_vector + *
+ * To read more about dot products see here https://en.wikipedia.org/wiki/Dot_product + *
+ * To read more about cross products see here + * https://en.wikipedia.org/wiki/Cross_product
+ * * @see Polar * @see XY - * - * - * * @author Garrett Burroughs * @version 0.1 * @since 0.1 @@ -83,24 +108,20 @@ public interface Vector { /** * Adds two vectors together and returns the result * - *

- * The result of a vector addition will be another vector, - * One way of adding two vectors together is splitting it up into it's x and y components and adding them - * together and making a new vector out of those components
- * EX:
- * V1 = 3i + 4j
- * V2 = 7i + 5j
- *
- * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j - *
- * Geometric Visualization:
- * Vectors can also be added in a geometric way through the "Tip-To-Tail" method, - * In this method both the vectors are drawn using arrow vector notation https://en.wikipedia.org/wiki/Vector_notation - * one vector is then drawn at the edge of the first vector. - * The resultant vector is then drawn from the start of the first vector to the tip of the second vector - * This is where the name tip to tail comes from - * - *

+ *

The result of a vector addition will be another vector, One way of adding two vectors + * together is splitting it up into it's x and y components and adding them together and making + * a new vector out of those components
+ * EX:
+ * V1 = 3i + 4j
+ * V2 = 7i + 5j
+ *
+ * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
+ * Geometric Visualization:
+ * Vectors can also be added in a geometric way through the "Tip-To-Tail" method, In this method + * both the vectors are drawn using arrow vector notation + * https://en.wikipedia.org/wiki/Vector_notation one vector is then drawn at the + * edge of the first vector. The resultant vector is then drawn from the start of the first + * vector to the tip of the second vector This is where the name tip to tail comes from * * @param vector The vector to be added * @return The result of the two vectors being added @@ -110,17 +131,14 @@ public interface Vector { /** * Subtracts a vector and returns the result * - *

- * vector subtraction is similar to vector addition but the direction of the vector being subtracted - * is simply reversed
- * EX:
- * V1 = 3i + 4j
- * V2 = 7i + 5j
- *
- * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
- * V1 - V2 = 3i + (-7i) + 4j + (-5j) = -4i + -j
- *

- * + *

vector subtraction is similar to vector addition but the direction of the vector being + * subtracted is simply reversed
+ * EX:
+ * V1 = 3i + 4j
+ * V2 = 7i + 5j
+ *
+ * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
+ * V1 - V2 = 3i + (-7i) + 4j + (-5j) = -4i + -j
* * @param vector The vector to be subtracted * @return The result of the passed in vector being subtracted from the vector object @@ -138,15 +156,12 @@ public interface Vector { /** * Returns the product of two vectors that have been crossed * - *

- * The result of the cross product is a vector, - * The cross product of a vector is the vector that is perpendicular to both vectors - * When crossing two 2dimensional vectors the result will be a 3dimensional vector - * Because of this this method only returns the magnitude (Z component) of the cross product - * The magnitude of the cross product is same as the area of the parallelogram that the two - * vectors make in the X/Y plane.
- * https://en.wikipedia.org/wiki/Cross_product - *

+ *

The result of the cross product is a vector, The cross product of a vector is the vector + * that is perpendicular to both vectors When crossing two 2dimensional vectors the result will + * be a 3dimensional vector Because of this this method only returns the magnitude (Z component) + * of the cross product The magnitude of the cross product is same as the area of the + * parallelogram that the two vectors make in the X/Y plane.
+ * https://en.wikipedia.org/wiki/Cross_product * * @param vector the vector to be multiplied using the cross product * @return the magnitude of the cross product of the two vectors @@ -156,17 +171,14 @@ public interface Vector { /** * Returns the dot product of two vectors * - *

- * The result of the dot product is a scalar value (number), - * The dot product can be viewed as the projection of one vector on to another times the magnitude of the - * original vector
- * This can be written mathematically as |A||B|cos(theta), where theta is the angle between A and B - * Another mathematical representation of the dot product using its components is:
- * A = {@literal }
- * B = {@literal }
- * A . B = {@literal }
- * https://en.wikipedia.org/wiki/Dot_product - *

+ *

The result of the dot product is a scalar value (number), The dot product can be viewed as + * the projection of one vector on to another times the magnitude of the original vector
+ * This can be written mathematically as |A||B|cos(theta), where theta is the angle between A + * and B Another mathematical representation of the dot product using its components is:
+ * A = {@literal }
+ * B = {@literal }
+ * A . B = {@literal }
+ * https://en.wikipedia.org/wiki/Dot_product * * @param vector The vector to be multiplied using the dot product * @return the scalar result of the dot of the two vectors @@ -192,14 +204,12 @@ public interface Vector { /** * Normalizes a vector and returns the result * - *

- * A normalized vector is a vector with magnitude 1. - * Normalized vectors are also called unit vectors. - * A normalized vector keeps it's direction as well as the same proportions of its components. - * When a vector is defined by its components it can be normalized it can be expressed as
- * A = {@literal }
- * A' = {@literal }
- *

+ *

A normalized vector is a vector with magnitude 1. Normalized vectors are also called unit + * vectors. A normalized vector keeps it's direction as well as the same proportions of its + * components. When a vector is defined by its components it can be normalized it can be + * expressed as
+ * A = {@literal }
+ * A' = {@literal }
* * @return the normalized vector */ @@ -211,5 +221,4 @@ public interface Vector { * @return a copy of the vector */ public Vector copy(); - } diff --git a/src/main/java/org/montclairrobotics/alloy/vector/XY.java b/src/main/java/org/montclairrobotics/alloy/vector/XY.java index f25b117..765598c 100644 --- a/src/main/java/org/montclairrobotics/alloy/vector/XY.java +++ b/src/main/java/org/montclairrobotics/alloy/vector/XY.java @@ -1,29 +1,52 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.vector; /** * Created by MHS Robotics on 11/14/2017. * - * A vector can be defined in rectangular(XY), or polar form.
- * This class is implementation for vectors in XY form
+ *

A vector can be defined in rectangular(XY), or polar form.
+ * This class is implementation for vectors in XY form
* It controls the conversions from rectangular to polar and vice versa * - * https://en.wikipedia.org/wiki/Vector_notation - * @see Vector + *

https://en.wikipedia.org/wiki/Vector_notation * + * @see Vector * @author Garrett Burroughs * @version 0.1 * @since 0.1 */ -public class XY implements Vector{ +public class XY implements Vector { private double x; private double y; - public XY(double x, double y){ + public XY(double x, double y) { this.x = x; this.y = y; } - public XY(XY vector){ + public XY(XY vector) { x = vector.getY(); y = vector.getY(); } @@ -112,25 +135,25 @@ public void setAngle(Angle angle) { /** * Adds two vectors together and returns the result + * *

+ * + *

The result of a vector addition will be another vector, One way of adding two vectors + * together is splitting it up into it's x and y components and adding them together and making + * a new vector out of those components
+ * EX:
+ * V1 = 3i + 4j
+ * V2 = 7i + 5j
+ *
+ * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
+ * Geometric Visualization:
+ * Vectors can also be added in a geometric way through the "Tip-To-Tail" method, In this method + * both the vectors are drawn using arrow vector notation + * https://en.wikipedia.org/wiki/Vector_notation one vector is then drawn at the + * edge of the first vector. The resultant vector is then drawn from the start of the first + * vector to the tip of the second vector This is where the name tip to tail comes from + * *

- * The result of a vector addition will be another vector, - * One way of adding two vectors together is splitting it up into it's x and y components and adding them - * together and making a new vector out of those components
- * EX:
- * V1 = 3i + 4j
- * V2 = 7i + 5j
- *
- * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j - *
- * Geometric Visualization:
- * Vectors can also be added in a geometric way through the "Tip-To-Tail" method, - * In this method both the vectors are drawn using arrow vector notation https://en.wikipedia.org/wiki/Vector_notation - * one vector is then drawn at the edge of the first vector. - * The resultant vector is then drawn from the start of the first vector to the tip of the second vector - * This is where the name tip to tail comes from - *

- *

* * @param vector The vector to be added * @return The result of the two vectors being added @@ -142,17 +165,17 @@ public Vector add(Vector vector) { /** * Subtracts a vector and returns the result + * *

- *

- * vector subtraction is similar to vector addition but the direction of the vector being subtracted - * is simply reversed
- * EX:
- * V1 = 3i + 4j
- * V2 = 7i + 5j
- *
- * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
- * V1 - V2 = 3i + (-7i) + 4j + (-5j) = -4i + -j
- *

+ * + *

vector subtraction is similar to vector addition but the direction of the vector being + * subtracted is simply reversed
+ * EX:
+ * V1 = 3i + 4j
+ * V2 = 7i + 5j
+ *
+ * V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
+ * V1 - V2 = 3i + (-7i) + 4j + (-5j) = -4i + -j
* * @param vector The vector to be subtracted * @return The result of the passed in vector being subtracted from the vector object @@ -175,16 +198,15 @@ public Vector scale(double scalar) { /** * Returns the product of two vectors that have been crossed + * *

- *

- * The result of the cross product is a vector, - * The cross product of a vector is the vector that is perpendicular to both vectors - * When crossing two 2dimensional vectors the result will be a 3dimensional vector - * Because of this this method only returns the magnitude (Z component) of the cross product - * The magnitude of the cross product is same as the area of the parallelogram that the two - * vectors make in the X/Y plane.
+ * + *

The result of the cross product is a vector, The cross product of a vector is the vector + * that is perpendicular to both vectors When crossing two 2dimensional vectors the result will + * be a 3dimensional vector Because of this this method only returns the magnitude (Z component) + * of the cross product The magnitude of the cross product is same as the area of the + * parallelogram that the two vectors make in the X/Y plane.
* https://en.wikipedia.org/wiki/Cross_product - *

* * @param vector the vector to be multiplied using the cross product * @return the magnitude of the cross product of the two vectors @@ -196,18 +218,17 @@ public double cross(Vector vector) { /** * Returns the dot product of two vectors + * *

- *

- * The result of the dot product is a scalar value (number), - * The dot product can be viewed as the projection of one vector on to another times the magnitude of the - * original vector
- * This can be written mathematically as |A||B|cos(theta), where theta is the angle between A and B - * Another mathematical representation of the dot product using its components is:
- * A = {@literal }
- * B = {@literal }
- * A . B = {@literal }
+ * + *

The result of the dot product is a scalar value (number), The dot product can be viewed as + * the projection of one vector on to another times the magnitude of the original vector
+ * This can be written mathematically as |A||B|cos(theta), where theta is the angle between A + * and B Another mathematical representation of the dot product using its components is:
+ * A = {@literal }
+ * B = {@literal }
+ * A . B = {@literal }
* https://en.wikipedia.org/wiki/Dot_product - *

* * @param vector The vector to be multiplied using the dot product * @return the scalar result of the dot of the two vectors @@ -241,21 +262,21 @@ public Angle angleBetween(Vector vector) { /** * Normalizes a vector and returns the result + * *

- *

- * A normalized vector is a vector with magnitude 1. - * Normalized vectors are also called unit vectors. - * A normalized vector keeps it's direction as well as the same proportions of its components. - * When a vector is defined by its components it can be normalized it can be expressed as
- * A = {@literal }
- * A' = {@literal }
- *

+ * + *

A normalized vector is a vector with magnitude 1. Normalized vectors are also called unit + * vectors. A normalized vector keeps it's direction as well as the same proportions of its + * components. When a vector is defined by its components it can be normalized it can be + * expressed as
+ * A = {@literal }
+ * A' = {@literal }
* * @return the normalized vector */ @Override public Vector normalize() { - return new XY(x/getManitude(), y/getManitude()); + return new XY(x / getManitude(), y / getManitude()); } /** From 2984a7800d7d97c7b4957547022a3ee223bf3700 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Sun, 6 May 2018 21:44:30 -0400 Subject: [PATCH 09/54] Updated readme to include command reference for Spotless --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index a65a2dd..5056154 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,20 @@ Any information regarding Alloy, including how it works, project structure, as w can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) as well as a [quick start guide](). +##Formatting +Alloy uses the [Spotless]() code formatter to ensure that +all of the code follows a specific format. It is added as a build step for a gradle +build so this means that all code in alloy must be compliant to be merged. +Spotless allows for automatic code formatting. Just run +``` +cmd> gradlew spotlessApply +:spotlessApply +BUILD SUCCESSFUL + +cmd> gradlew build +BUILD SUCCESSFUL +``` + # FAQ From 13d5079eff73a636b7dc45a6cf9c9c19957e3fcc Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Sun, 6 May 2018 21:45:45 -0400 Subject: [PATCH 10/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5056154..98a641c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Any information regarding Alloy, including how it works, project structure, as w can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) as well as a [quick start guide](). -##Formatting +## Formatting Alloy uses the [Spotless]() code formatter to ensure that all of the code follows a specific format. It is added as a build step for a gradle build so this means that all code in alloy must be compliant to be merged. From 049daf98a388b73a1f4dcc6dca60ae4b1376cb89 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Sun, 6 May 2018 21:46:20 -0400 Subject: [PATCH 11/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98a641c..714b424 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wik Alloy uses the [Spotless]() code formatter to ensure that all of the code follows a specific format. It is added as a build step for a gradle build so this means that all code in alloy must be compliant to be merged. -Spotless allows for automatic code formatting. Just run +Spotless allows for automatic code formatting, just run: ``` cmd> gradlew spotlessApply :spotlessApply From bc8be91f7a07f909d69bcf629da7a34e512ede37 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Tue, 15 May 2018 16:17:18 -0400 Subject: [PATCH 12/54] added utils --- .../{Updatable.java => Updateable.java} | 24 +++++++++++++++---- .../alloy/utils/BangBang.java | 4 ++++ 2 files changed, 23 insertions(+), 5 deletions(-) rename src/main/java/org/montclairrobotics/alloy/update/{Updatable.java => Updateable.java} (76%) create mode 100644 src/main/java/org/montclairrobotics/alloy/utils/BangBang.java diff --git a/src/main/java/org/montclairrobotics/alloy/update/Updatable.java b/src/main/java/org/montclairrobotics/alloy/update/Updateable.java similarity index 76% rename from src/main/java/org/montclairrobotics/alloy/update/Updatable.java rename to src/main/java/org/montclairrobotics/alloy/update/Updateable.java index bec0579..690cfec 100644 --- a/src/main/java/org/montclairrobotics/alloy/update/Updatable.java +++ b/src/main/java/org/montclairrobotics/alloy/update/Updateable.java @@ -26,11 +26,18 @@ of this software and associated documentation files (the "Software"), to deal import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Parameter; +import java.util.ArrayList; + import org.montclairrobotics.alloy.components.Component; /** - * Created by MHS Robotics on 2/11/2018. + * A class used for creating objects that can be updated by the Updater + * + * An updateable conatins a method to be updates along with any + * extra information needed for it to be properly called and updated + * like the update rate, parameters and objects that it should be invoked on * + * @see Updater * @author Garrett Burroughs * @since 0.1 */ @@ -39,6 +46,7 @@ public class Updatable { private int updateRate; private Class clazz; private Parameter[] parameters; + private ArrayList objects; Updatable(Method update, int updateRate, Class clazz, Parameter[] parameters) { this.update = update; @@ -47,15 +55,21 @@ public class Updatable { this.parameters = parameters; } + public void getReferences(){ + for(Component c : Component.getComponents()){ + if(c.getClass().equals(clazz)){ + objects.add(c); + } + } + } + public void run() { if (parameters.length != 0) { throw new RuntimeException("UPDATED METHODS CAN NOT HAVE PARAMETERS"); } try { - for (Component component : Component.getComponents()) { - if (component.getClass().equals(clazz)) { - update.invoke(component, (Object[]) parameters); - } + for(Object o : objects){ + update.invoke(o, (Object[]) parameters); } } catch (IllegalAccessException e) { e.printStackTrace(); diff --git a/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java b/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java new file mode 100644 index 0000000..be22c9e --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java @@ -0,0 +1,4 @@ +package org.montclairrobotics.alloy.utils; + +public class BangBang { +} From 3a75a0dd5a660f4c1b21a77af5b2edaa3a21b388 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Tue, 15 May 2018 16:17:41 -0400 Subject: [PATCH 13/54] Added more utils --- .classpath | 12 +++ .project | 23 ++++++ .settings/org.eclipse.buildship.core.prefs | 2 + SpotlessLicense | 2 +- .../alloy/motor/MotorModule.java | 20 +++-- .../alloy/update/Updateable.java | 30 +++++--- .../alloy/update/Updater.java | 62 +++++++++++----- .../alloy/utils/BangBang.java | 73 ++++++++++++++++++- .../alloy/utils/Differential.java | 37 +++++++--- .../alloy/utils/ErrorCorrection.java | 33 +++++++++ .../montclairrobotics/alloy/utils/PID.java | 1 + .../alloy/utils/TuneablePID.java | 40 +++++++++- .../montclairrobotics/alloy/utils/Utils.java | 41 +++++++++++ 13 files changed, 329 insertions(+), 47 deletions(-) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.buildship.core.prefs diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..4857be4 --- /dev/null +++ b/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..2744906 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + Alloy + Project Alloy created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..654fdc2 --- /dev/null +++ b/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +#Tue May 08 17:04:10 EDT 2018 +connection.project.dir= diff --git a/SpotlessLicense b/SpotlessLicense index 31878a2..88d4450 100644 --- a/SpotlessLicense +++ b/SpotlessLicense @@ -20,4 +20,4 @@ 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. -*/ \ No newline at end of file +*/ diff --git a/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java b/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java index f43b511..59698d1 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java @@ -30,7 +30,7 @@ of this software and associated documentation files (the "Software"), to deal import org.montclairrobotics.alloy.core.Motor; import org.montclairrobotics.alloy.update.Update; import org.montclairrobotics.alloy.utils.ConstantInput; -import org.montclairrobotics.alloy.utils.PID; +import org.montclairrobotics.alloy.utils.ErrorCorrection; import org.montclairrobotics.alloy.vector.Vector; /** @@ -38,8 +38,8 @@ of this software and associated documentation files (the "Software"), to deal * *

A motor module consists of multiple motors that run together in the same direction. Modules * are aware of what direction the run in so they can be used in MoroGroups to be run together with - * other modules. Modules can also be controlled with an encoder and a PID to ensure that the are - * going the right speed. @Author Garrett Burroughs @Version 0.1 @Since 0.1 + * other modules. Modules can also be controlled with an encoder and a ErrorCorrection to ensure + * that the are going the right speed. @Author Garrett Burroughs @Version 0.1 @Since 0.1 */ public class MotorModule extends Component { /** The motors that the module will control */ @@ -51,13 +51,17 @@ public class MotorModule extends Component { */ public Vector direction; - /** A PID controller that will control the */ - public PID powerControl; + /** An error correction that will control the power */ + public ErrorCorrection powerControl; public Encoder encoder; public double targetPower; - public MotorModule(Vector direction, Encoder encoder, PID powerControl, Motor... motors) { + public MotorModule( + Vector direction, + Encoder encoder, + ErrorCorrection powerControl, + Motor... motors) { this.direction = direction; this.motors = new ArrayList<>(Arrays.asList(motors)); this.powerControl = powerControl; @@ -78,7 +82,7 @@ public MotorModule setEncoder(Encoder encoder) { return this; } - public MotorModule setPID(PID powerControl) { + public MotorModule setErrorCorrection(ErrorCorrection powerControl) { this.powerControl = powerControl; return this; } @@ -88,7 +92,7 @@ public void powerCorrection() { if (status.booleanValue()) { // Check if its enabled for (Motor m : motors) { if (powerControl != null) { - m.setMotorPower(targetPower + powerControl.get()); + m.setMotorPower(targetPower + powerControl.getCorrection()); } else { m.setMotorPower(targetPower); } diff --git a/src/main/java/org/montclairrobotics/alloy/update/Updateable.java b/src/main/java/org/montclairrobotics/alloy/update/Updateable.java index 690cfec..fbd6e30 100644 --- a/src/main/java/org/montclairrobotics/alloy/update/Updateable.java +++ b/src/main/java/org/montclairrobotics/alloy/update/Updateable.java @@ -27,37 +27,47 @@ of this software and associated documentation files (the "Software"), to deal import java.lang.reflect.Method; import java.lang.reflect.Parameter; import java.util.ArrayList; - import org.montclairrobotics.alloy.components.Component; /** * A class used for creating objects that can be updated by the Updater * - * An updateable conatins a method to be updates along with any - * extra information needed for it to be properly called and updated - * like the update rate, parameters and objects that it should be invoked on + *

An updateable conatins a method to be updates along with any extra information needed for it + * to be properly called and updated like the update rate, parameters and objects that it should be + * invoked on * * @see Updater * @author Garrett Burroughs * @since 0.1 */ -public class Updatable { +public class Updateable { + + /** The method that will be called when it is updated */ private Method update; + + /** How often the updateable should be updated */ private int updateRate; + + /** The class that contains the method */ private Class clazz; + + /** Any parameters for the method (This should be empty) */ private Parameter[] parameters; + + /** All objects that the method needs to be called on */ private ArrayList objects; - Updatable(Method update, int updateRate, Class clazz, Parameter[] parameters) { + Updateable(Method update, int updateRate, Class clazz, Parameter[] parameters) { this.update = update; this.updateRate = updateRate; this.clazz = clazz; this.parameters = parameters; } - public void getReferences(){ - for(Component c : Component.getComponents()){ - if(c.getClass().equals(clazz)){ + /** Gets references to all of the object that the update method should be called on */ + public void getReferences() { + for (Component c : Component.getComponents()) { + if (c.getClass().equals(clazz)) { objects.add(c); } } @@ -68,7 +78,7 @@ public void run() { throw new RuntimeException("UPDATED METHODS CAN NOT HAVE PARAMETERS"); } try { - for(Object o : objects){ + for (Object o : objects) { update.invoke(o, (Object[]) parameters); } } catch (IllegalAccessException e) { diff --git a/src/main/java/org/montclairrobotics/alloy/update/Updater.java b/src/main/java/org/montclairrobotics/alloy/update/Updater.java index acb5aa6..405e93c 100644 --- a/src/main/java/org/montclairrobotics/alloy/update/Updater.java +++ b/src/main/java/org/montclairrobotics/alloy/update/Updater.java @@ -25,9 +25,8 @@ of this software and associated documentation files (the "Software"), to deal import java.lang.annotation.Annotation; import java.lang.reflect.Method; -import java.util.Comparator; -import java.util.Set; -import java.util.TreeMap; +import java.util.*; +import org.montclairrobotics.alloy.components.Component; import org.reflections.Reflections; import org.reflections.scanners.MethodAnnotationsScanner; import org.reflections.scanners.SubTypesScanner; @@ -40,9 +39,13 @@ of this software and associated documentation files (the "Software"), to deal */ public class Updater { + /** + * Keeps track of the number of times the updater has run Used in diagnostics and calculating + * when to update methods + */ private static int counter; - private static TreeMap updateables = + private static TreeMap updateables = new TreeMap<>( new Comparator() { @Override @@ -52,16 +55,33 @@ public int compare(Integer o1, Integer o2) { }); public static void registerUpdatables() { - String userFiles = ""; - Reflections alloyReflections = - new Reflections( - "org.montclairrobotics", - new MethodAnnotationsScanner(), - new SubTypesScanner()); - // Reflections userRefelecitons = new Reflections(userFiles); - System.out.println(alloyReflections.getMethodsAnnotatedWith(Update.class)); + // Create an arraylist to store all package names + ArrayList packageReferences = new ArrayList<>(); + // Create an arraylist of all the reflections that will later be used to get annotated methods + ArrayList reflections = new ArrayList<>(); + // Create a set of all the methods + Set methods = new HashSet<>(); - Set methods = alloyReflections.getMethodsAnnotatedWith(Update.class); + // Iterate through all of the components to get the package + for (Object o : Component.getComponents()) { + System.out.println(o.getClass().getPackage().getName()); + // Check if the package has already been added + if (!packageReferences.contains(o.getClass().getPackage().getName())) { + packageReferences.add(o.getClass().getPackage().getName()); // add the package + } + } + + // Iterate through all of the package referneces to create a reflections object + for (String p : packageReferences) { + reflections.add( + new Reflections(p, new MethodAnnotationsScanner(), new SubTypesScanner())); + } + + // Get all update methods + for (Reflections r : reflections) { + methods.addAll(r.getMethodsAnnotatedWith(Update.class)); + } + // Loop through all methods and create Updateable objects for (Method method : methods) { int updateRate = 1; int priority = 0; @@ -73,18 +93,26 @@ public static void registerUpdatables() { } updateables.put( priority, - new Updatable( + new Updateable( method, updateRate, method.getDeclaringClass(), method.getParameters())); } + for (Updateable u : updateables.values()) { + u.getReferences(); + } } + /** + * The update method takes care of updating all of the methods in the project that are within a + * component and are annotated with @Update It will also check the Update rate and decide + * weather to update the method accordingly + */ public static void update() { - for (Updatable updatable : updateables.values()) { - if (counter % updatable.getUpdateRate() == 0) { - updatable.run(); + for (Updateable updateable : updateables.values()) { + if (counter % updateable.getUpdateRate() == 0) { + updateable.run(); } } } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java b/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java index be22c9e..362c394 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java @@ -1,4 +1,75 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.utils; -public class BangBang { +import java.lang.Double; +import org.montclairrobotics.alloy.components.InputComponent; +import org.montclairrobotics.alloy.update.Update; + +public class BangBang extends InputComponent implements ErrorCorrection { + + public double target; + public double lowOut; + public double highOut; + + public BangBang(double lowOut, double highOut) { + this.lowOut = lowOut; + this.highOut = highOut; + } + + public BangBang(double correction) { + this(-correction, correction); + } + + /** + * Set the target for the correction When the input is equal to the target the error is 0 + * + * @param target the goal of the error correction + */ + @Override + public void setTarget(Double target) { + this.target = target; + } + + /** + * Get the value to apply the correction + * + * @return the correction + */ + @Override + public Double getCorrection() { + return output; + } + + @Update + public void calculateCorrection() { + if (input.get() > target) { + output = highOut; + } else if (input.get() < target) { + output = lowOut; + } else { + output = 0d; + } + } } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Differential.java b/src/main/java/org/montclairrobotics/alloy/utils/Differential.java index 028a891..3f8c5a9 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/Differential.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/Differential.java @@ -26,11 +26,26 @@ of this software and associated documentation files (the "Software"), to deal import org.montclairrobotics.alloy.components.InputComponent; import org.montclairrobotics.alloy.update.Update; +/** + * A class to calculate how an input varies with time + * + *

A differential is the rate of change of a certain variable with respect to another one. In + * simplper terms is is the slope. The Differential class takes an input and calculates the average + * rate of change over a very small interval of the input with respect to time + * + *

This concept is a calculus concept when and can be most easily understood when looking at a + * graph where time is the independent variable and the input is dependant on the time + * + *

For example, a time differential of position would be velocity because velocity is how much + * the position changes over time (eg. meters per second) @Author Garrett Burroughs @Since + * 0.1 @Version 0.1 + */ public class Differential extends InputComponent { - Input input; + /** The dependant variable in the situation */ + public Input input; - double prevTime; - double prevIn; + private double prevTime; + private double prevIn; public Differential(Input in) { input = in; @@ -38,14 +53,18 @@ public Differential(Input in) { @Update public void calculateDifferential() { - double elapsedTime = System.nanoTime() - prevTime; - double elapsedIn = input.get() - prevIn; - if (System.nanoTime() != 0) { - output = elapsedIn / elapsedTime; + double elapsedTime = System.nanoTime() - prevTime; // Calculate how much time has passed + double elapsedIn = input.get() - prevIn; // Caclulate how much the input has changed + if (System.nanoTime() != 0) { // Avoid a divide by zero error + output = elapsedIn / elapsedTime; // Return the slope (Delta Input / Delta time) } else { output = 0.0; } - prevIn = input.get(); - prevTime = System.nanoTime(); + prevIn = input.get(); // set previous input to current input for next calculation + prevTime = System.nanoTime(); // Set previous time to current time for next calculation + } + + public Double getInput() { + return input.get(); } } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java b/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java index aacd43f..eb5d471 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java @@ -23,10 +23,43 @@ of this software and associated documentation files (the "Software"), to deal */ package org.montclairrobotics.alloy.utils; +/** + * A interface that defines the process of correcting an error + * + *

Error correction can be implemented in different ways but is very important in creating a + * funcitonal robot. The most common + * + *

Most error corrections calculate the error based on the difference of the input and the target + * and then return an output correction based on that. + * + *

Some common examples of error corrections are - PID Loop - Bang Bang control + * + * @see PID + * @param the type of error that will be corrected + * @version 0.1 + * @since 0.1 + */ public interface ErrorCorrection { + + /** + * Set the input of the error correction the input should be the source of what correction is + * correcting. For example in a motor the input would be the encoder + * + * @param input the input to the error correction + */ public void setInput(Input input); + /** + * Set the target for the correction When the input is equal to the target the error is 0 + * + * @param target the goal of the error correction + */ public void setTarget(T target); + /** + * Get the value to apply the correction + * + * @return the correction + */ public T getCorrection(); } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/PID.java b/src/main/java/org/montclairrobotics/alloy/utils/PID.java index e53a614..8c5749b 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/PID.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/PID.java @@ -43,6 +43,7 @@ of this software and associated documentation files (the "Software"), to deal * * @author Garrett Burroughs * @since 0.1 + * @version 0.1 */ public class PID extends InputComponent implements ErrorCorrection { private double p; diff --git a/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java b/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java index 419fb23..d709d9c 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java @@ -23,4 +23,42 @@ of this software and associated documentation files (the "Software"), to deal */ package org.montclairrobotics.alloy.utils; -public class TuneablePID {} +import org.montclairrobotics.alloy.components.InputComponent; + +/** + * A PID class that takes in tunable inputs to make PID tuning easier + * + *

Using a standard PID model, the user would have to re-deploy an test code which can end up + * becoming a very long and drawn out process. By making them inputs, it is able to change these + * values at runtime This could be done easily in FRC using smartdashboard or in FTC by using + * buttons or joysticks to change values + */ +public class TuneablePID extends InputComponent implements ErrorCorrection { + + /** + * Set the input of the error correction the input should be the source of what correction is + * correcting. For example in a motor the input would be the encoder + * + * @param input the input to the error correction + */ + @Override + public void setInput(Input input) {} + + /** + * Set the target for the correction When the input is equal to the target the error is 0 + * + * @param target the goal of the error correction + */ + @Override + public void setTarget(Object target) {} + + /** + * Get the value to apply the correction + * + * @return the correction + */ + @Override + public Object getCorrection() { + return null; + } +} diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Utils.java b/src/main/java/org/montclairrobotics/alloy/utils/Utils.java index 963dafd..27e7f8e 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/Utils.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/Utils.java @@ -23,7 +23,27 @@ of this software and associated documentation files (the "Software"), to deal */ package org.montclairrobotics.alloy.utils; +/** + * A set of common methods that are useful in writing robot code + * + *

The Utils class contains static methods that can perform basic functions that can be useful + * + * @author garrettburroughs + * @version 0.1 + * @since 0.1 + */ public class Utils { + /** + * Makes sure that a value is between 2 different values + * + *

The constrain method will return the passed in value if it is between the boundaries (min + * & max), amd will return the min or the max depending on which side it runs out on + * + * @param in the value being passed in + * @param min minimum the value can be + * @param max maximum the value can be + * @return a value between the maximum and minimum value + */ public static double constrain(double in, double min, double max) { if (in > max) { return max; @@ -32,4 +52,25 @@ public static double constrain(double in, double min, double max) { } return in; } + + /** + * The map function takes an input value that can be between a certain range and maps it to a + * specified output range + * + * @param in the value being passed in + * @param inputMin the minimum value the input can be + * @param inputMax the maximum value the input can be + * @param outputMin the minimum value the output can be + * @param outputMax the maximum value the output can be + * @return a mapped value from the input range to the output range + */ + public static double map( + double in, double inputMin, double inputMax, double outputMin, double outputMax) { + double scaled = + (in - inputMin) / (inputMax - inputMin); // scale the input to a value from 0-1 + double output = + (outputMax - outputMin) * scaled + + outputMin; // adjust the scaled value to fit the output + return output; + } } From bc0b26ef92078d6c1b1a2a471808d5da05c01b78 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Mon, 21 May 2018 12:02:47 -0400 Subject: [PATCH 14/54] quick readability change --- .idea/modules/Alloy_main.iml | 20 +++++++++++++++++++ .idea/modules/Alloy_test.iml | 20 +++++++++++++++++++ .../montclairrobotics/alloy/ftc/FTCMotor.java | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.idea/modules/Alloy_main.iml b/.idea/modules/Alloy_main.iml index 795b244..ff3d097 100644 --- a/.idea/modules/Alloy_main.iml +++ b/.idea/modules/Alloy_main.iml @@ -1,4 +1,24 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Alloy_test.iml b/.idea/modules/Alloy_test.iml index 6b3eb10..2fc9ec6 100644 --- a/.idea/modules/Alloy_test.iml +++ b/.idea/modules/Alloy_test.iml @@ -1,5 +1,25 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java index 16fcbb1..079e705 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java @@ -87,6 +87,6 @@ public void setInverted(boolean inverted) { * @return true if the motor is inverted */ public boolean getInverted() { - return motor.getDirection() == DcMotorSimple.Direction.REVERSE ? true : false; + return motor.getDirection() == DcMotorSimple.Direction.REVERSE; } } From cc5c746754534dbe854602ad5058f54bce646c0e Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Wed, 23 May 2018 11:25:39 -0400 Subject: [PATCH 15/54] Implemented motor group and test example for intake --- .../alloy/components/InputComponent.java | 7 +- .../montclairrobotics/alloy/core/Alloy.java | 10 ++ .../alloy/drive/DTInput.java | 9 ++ .../alloy/drive/DTMapper.java | 8 +- .../alloy/drive/DriveModule.java | 25 ++++ .../alloy/drive/DriveTrain.java | 4 +- .../alloy/ftc/FTCJoystick.java | 10 +- .../montclairrobotics/alloy/ftc/FTCMotor.java | 12 ++ .../alloy/ftc/FTCTargetMotor.java | 22 +-- .../alloy/motor/DefaultMapper.java | 18 +++ .../montclairrobotics/alloy/motor/Mapper.java | 4 +- .../alloy/motor/MotorGroup.java | 42 +++++- .../alloy/motor/MotorModule.java | 126 +++++++++++++++++- .../alloy/motor/steps/Deadzone.java | 21 +++ .../alloy/motor/steps/VectorDeadzone.java | 17 +++ .../montclairrobotics/alloy/test/Control.java | 5 + .../alloy/test/Hardware.java | 40 ++++++ .../montclairrobotics/alloy/test/Shooter.java | 49 ------- .../alloy/test/ShooterMapper.java | 20 +++ .../alloy/test/TestRobot.java | 47 +++++-- .../alloy/utils/BangBang.java | 17 ++- .../alloy/utils/BooleanToggle.java | 22 +++ .../alloy/utils/ErrorCorrection.java | 9 +- .../alloy/utils/Initializeable.java | 12 ++ .../montclairrobotics/alloy/utils/PID.java | 14 +- .../montclairrobotics/alloy/utils/Utils.java | 22 +++ .../alloy/vector/Vector.java | 5 +- 27 files changed, 504 insertions(+), 93 deletions(-) create mode 100644 src/main/java/org/montclairrobotics/alloy/drive/DTInput.java create mode 100644 src/main/java/org/montclairrobotics/alloy/drive/DriveModule.java create mode 100644 src/main/java/org/montclairrobotics/alloy/motor/DefaultMapper.java create mode 100644 src/main/java/org/montclairrobotics/alloy/motor/steps/Deadzone.java create mode 100644 src/main/java/org/montclairrobotics/alloy/motor/steps/VectorDeadzone.java create mode 100644 src/main/java/org/montclairrobotics/alloy/test/Control.java create mode 100644 src/main/java/org/montclairrobotics/alloy/test/Hardware.java delete mode 100644 src/main/java/org/montclairrobotics/alloy/test/Shooter.java create mode 100644 src/main/java/org/montclairrobotics/alloy/test/ShooterMapper.java create mode 100644 src/main/java/org/montclairrobotics/alloy/utils/BooleanToggle.java create mode 100644 src/main/java/org/montclairrobotics/alloy/utils/Initializeable.java diff --git a/src/main/java/org/montclairrobotics/alloy/components/InputComponent.java b/src/main/java/org/montclairrobotics/alloy/components/InputComponent.java index 03b7f45..4115b3b 100644 --- a/src/main/java/org/montclairrobotics/alloy/components/InputComponent.java +++ b/src/main/java/org/montclairrobotics/alloy/components/InputComponent.java @@ -49,7 +49,12 @@ public void applySteps() { output = calculation; } - public void setInput(Input input) { + public InputComponent addStep(Step s){ + steps.add(s); + return this; + } + public InputComponent setInput(Input input) { this.input = input; + return this; } } diff --git a/src/main/java/org/montclairrobotics/alloy/core/Alloy.java b/src/main/java/org/montclairrobotics/alloy/core/Alloy.java index f351778..8729cfe 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/Alloy.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Alloy.java @@ -27,6 +27,9 @@ of this software and associated documentation files (the "Software"), to deal import org.montclairrobotics.alloy.components.Component; import org.montclairrobotics.alloy.ftc.FTCDebugger; import org.montclairrobotics.alloy.update.Updater; +import org.montclairrobotics.alloy.utils.Initializeable; + +import java.util.ArrayList; /** * Created by MHS Robotics on 11/13/2017. @@ -40,6 +43,8 @@ of this software and associated documentation files (the "Software"), to deal */ public abstract class Alloy extends OpMode { + public static ArrayList initObjects = new ArrayList<>(); + /** * The robotSetup is where all code specific to robot setup is placed If you only have one * teleop this can be done in the initialization Method. robotSetup is called right after the @@ -65,6 +70,11 @@ public void init() { // Set Up the core robot components, This allows them to be accessed throughout the project new RobotCore(telemetry, hardwareMap, gamepad1, gamepad2); Component.debugger = new FTCDebugger(); + + for(Initializeable i : initObjects){ + i.init(); + } + robotSetup(); initialization(); } diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DTInput.java b/src/main/java/org/montclairrobotics/alloy/drive/DTInput.java new file mode 100644 index 0000000..d3eec8d --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/drive/DTInput.java @@ -0,0 +1,9 @@ +package org.montclairrobotics.alloy.drive; + +import org.montclairrobotics.alloy.vector.Angle; +import org.montclairrobotics.alloy.vector.Vector; + +public class DTInput { + public Vector translation; + public Angle rotation; +} diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java b/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java index babe125..65872f6 100644 --- a/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java +++ b/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java @@ -23,12 +23,16 @@ of this software and associated documentation files (the "Software"), to deal */ package org.montclairrobotics.alloy.drive; +import org.montclairrobotics.alloy.motor.Mapper; +import org.montclairrobotics.alloy.motor.MotorModule; +import org.montclairrobotics.alloy.utils.Input; + /** * Created by MHS Robotics on 12/16/2017. * * @author Garrett Burroughs * @since 0.1 */ -public interface DTMapper { - public void map(); +public interface DTMapper extends Mapper { + public void map(Input input, MotorModule ... modules); } diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DriveModule.java b/src/main/java/org/montclairrobotics/alloy/drive/DriveModule.java new file mode 100644 index 0000000..8b5ee0a --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/drive/DriveModule.java @@ -0,0 +1,25 @@ +package org.montclairrobotics.alloy.drive; + +import org.montclairrobotics.alloy.core.Encoder; +import org.montclairrobotics.alloy.core.Motor; +import org.montclairrobotics.alloy.motor.MotorModule; +import org.montclairrobotics.alloy.utils.ErrorCorrection; +import org.montclairrobotics.alloy.vector.Vector; + +public class DriveModule extends MotorModule { + /** + * Create a fully functioning motor module + *

+ * Modules created like this will be able to adjust + * their speed based on an error correction to + * maintain a more accurate speed. + * + * @param direction the direction that the module runs (for use in motor groups) + * @param encoder the encoder that keeps track of the motors position + * @param powerControl an error correction to adjust the speed of the module + * @param motors the motors that the module controls + */ + public DriveModule(Vector direction, Encoder encoder, ErrorCorrection powerControl, Motor... motors) { + super(direction, encoder, powerControl, motors); + } +} diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java b/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java index d71e835..c8694f1 100644 --- a/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java +++ b/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java @@ -29,4 +29,6 @@ of this software and associated documentation files (the "Software"), to deal * @author Garrett Burroughs * @since 0.1 */ -public class DriveTrain {} +public class DriveTrain { + +} diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java index 8ae8819..c6c45c1 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java @@ -24,7 +24,9 @@ of this software and associated documentation files (the "Software"), to deal package org.montclairrobotics.alloy.ftc; import com.qualcomm.robotcore.hardware.Gamepad; +import org.montclairrobotics.alloy.components.InputComponent; import org.montclairrobotics.alloy.core.Joystick; +import org.montclairrobotics.alloy.update.Update; import org.montclairrobotics.alloy.utils.Input; import org.montclairrobotics.alloy.vector.Vector; import org.montclairrobotics.alloy.vector.XY; @@ -41,7 +43,7 @@ of this software and associated documentation files (the "Software"), to deal * @author Garrett Burroughs * @since 0.1 */ -public class FTCJoystick implements Joystick, Input { +public class FTCJoystick extends InputComponent implements Joystick { /** * The side in a FTCJoystick is referring to the side of the controller is on, there are 2 @@ -91,8 +93,8 @@ public Vector getValue() { } } - @Override - public Vector get() { - return getValue(); + @Update + public void updateControls(){ + output = getValue(); } } diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java index 9835694..8cf86c0 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java @@ -99,6 +99,16 @@ public boolean getInverted() { return motor.getDirection() == DcMotorSimple.Direction.REVERSE ? true : false; } + public Encoder getEncoder(){ + return new Encoder() { + @Override + public int getTicks() { + return motor.getCurrentPosition(); + } + }; + } + + @Update public void updateMotor() { @@ -114,4 +124,6 @@ public void updateMotor() { public void disableAction() { motor.setPower(0); } + + } diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java index ceac7cc..e67d9f3 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java @@ -28,8 +28,8 @@ of this software and associated documentation files (the "Software"), to deal import org.montclairrobotics.alloy.core.Encoder; import org.montclairrobotics.alloy.core.TargetMotor; import org.montclairrobotics.alloy.update.Update; +import org.montclairrobotics.alloy.utils.ErrorCorrection; import org.montclairrobotics.alloy.utils.Input; -import org.montclairrobotics.alloy.utils.PID; /** * Created by MHS Robotics on 2/24/2018. @@ -76,7 +76,7 @@ enum Mode { } /** PID being used to control the motor in custom mode */ - private PID pid; + private ErrorCorrection correction; /** Current target motor runmode NOTE: not equal to the DCMotor runmode */ private Mode runmode = Mode.DEFAULT; @@ -92,7 +92,7 @@ public void setPosition(int position) { motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); motor.setTargetPosition(position); } else { - pid.setTarget((double) position); + correction.setTarget((double) position); } } @@ -130,16 +130,16 @@ public double getTargetPower() { /** * Set the motor to run using a custom PID * - * @param pid the PID that the motor will be controlled with + * @param correction the PID that the motor will be controlled with */ - public void setPID(PID pid) { - this.pid = pid; + public void setErrorCorrection(ErrorCorrection correction) { + this.correction = correction.copy(); runmode = runmode.CUSTOM; } /** Stop using the custom PID and return to using the default mode */ - public void disablePID() { - this.pid = null; + public void disableErrorCorrection() { + this.correction = null; runmode = Mode.DEFAULT; } @@ -152,7 +152,7 @@ public void update() { if (motor.getMode() == DcMotor.RunMode.RUN_TO_POSITION) { if (runmode == Mode.CUSTOM) { setTargetPower( - pid.get()); // If running using custom PID mode, set power to PID output + correction.getCorrection()); // If running using custom PID mode, set power to PID output } else { motor.setPower( targetPower); // If running in default target mode, set the target power @@ -166,8 +166,8 @@ public void update() { } /** @return the PID being used to control the motor */ - public PID getPid() { - return pid; + public ErrorCorrection getErrorCorrection() { + return correction; } /** @return the motor being controlled */ diff --git a/src/main/java/org/montclairrobotics/alloy/motor/DefaultMapper.java b/src/main/java/org/montclairrobotics/alloy/motor/DefaultMapper.java new file mode 100644 index 0000000..047ce40 --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/motor/DefaultMapper.java @@ -0,0 +1,18 @@ +package org.montclairrobotics.alloy.motor; + +import org.montclairrobotics.alloy.utils.Input; +import org.montclairrobotics.alloy.utils.Utils; + +/** + * A simple default mapper + * + * This mapper will run all of the motors in the group in the same direction + */ +public class DefaultMapper implements Mapper> { + @Override + public void map(Input input, MotorModule... modules) { + for(MotorModule m : modules){ + m.setPower(input.get() * Utils.sign(m.getDirection().getManitude())); + } + } +} diff --git a/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java b/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java index 1f844df..53650cc 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java @@ -23,6 +23,8 @@ of this software and associated documentation files (the "Software"), to deal */ package org.montclairrobotics.alloy.motor; +import org.montclairrobotics.alloy.components.InputComponent; + public interface Mapper { - public void map(T input, MotorModule modules); + public void map(T input, MotorModule ... modules); } diff --git a/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java b/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java index 71154fd..56cb514 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java @@ -24,7 +24,14 @@ of this software and associated documentation files (the "Software"), to deal package org.montclairrobotics.alloy.motor; import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import org.montclairrobotics.alloy.components.Component; +import org.montclairrobotics.alloy.components.InputComponent; +import org.montclairrobotics.alloy.core.Motor; +import org.montclairrobotics.alloy.update.Update; +import org.montclairrobotics.alloy.utils.Input; /** * A motor group is a group of motor modules that run together @@ -37,8 +44,41 @@ of this software and associated documentation files (the "Software"), to deal * lift. This could work with other things like an intake, shooter or other manipulator that * requires multiple motors running together from one input */ -public class MotorGroup extends Component { +public class MotorGroup extends Component { + /** + * The mapper that will be used for power assignment and calculation + */ public Mapper mapper; + + /** + * The modules contained in the motor group + */ public ArrayList modules; + + /** + * The control input for the motor group + */ + public InputComponent input; + + public MotorGroup(InputComponent input, Mapper mapper, MotorModule ... modules){ + this.input = input; + this.mapper = mapper; + this.modules = (ArrayList)Arrays.asList(modules); + } + + /** + * Creates a motor group with a default mapper that simply + * @param input + * @param modules + */ + public MotorGroup(InputComponent input, MotorModule ... modules){ + this(input, new DefaultMapper(), modules); + } + + @Update + public void controlPower(){ + mapper.map(input, modules.toArray(new MotorModule[modules.size()])); + } + } diff --git a/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java b/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java index 59698d1..630b5e5 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java @@ -26,6 +26,8 @@ of this software and associated documentation files (the "Software"), to deal import java.util.ArrayList; import java.util.Arrays; import org.montclairrobotics.alloy.components.Component; +import org.montclairrobotics.alloy.components.InputComponent; +import org.montclairrobotics.alloy.components.Step; import org.montclairrobotics.alloy.core.Encoder; import org.montclairrobotics.alloy.core.Motor; import org.montclairrobotics.alloy.update.Update; @@ -39,24 +41,55 @@ of this software and associated documentation files (the "Software"), to deal *

A motor module consists of multiple motors that run together in the same direction. Modules * are aware of what direction the run in so they can be used in MoroGroups to be run together with * other modules. Modules can also be controlled with an encoder and a ErrorCorrection to ensure - * that the are going the right speed. @Author Garrett Burroughs @Version 0.1 @Since 0.1 + * that the are going the right speed. + * + * You can also add steps to the Module that can alter the amount of power that the + * module will receive. This can be useful for modules that are being controlled by + * a separate entity such as a motor group. + * + * @author Garrett Burroughs + * @version 0.1 + * @since 0.1 */ public class MotorModule extends Component { /** The motors that the module will control */ public ArrayList motors; /** - * The direction that the modules run This is for use in a motor group running with different - * modules + * The direction that the modules run for use in a motor group */ public Vector direction; + public Vector offset; + /** An error correction that will control the power */ public ErrorCorrection powerControl; + /** + * The encoder that keeps track of the position and controls the motors + */ public Encoder encoder; + + /** + * how fast the module should be running + */ public double targetPower; + + public InputComponent modifier; + + /** + * Create a fully functioning motor module + * + * Modules created like this will be able to adjust + * their speed based on an error correction to + * maintain a more accurate speed. + * + * @param direction the direction that the module runs (for use in motor groups) + * @param encoder the encoder that keeps track of the motors position + * @param powerControl an error correction to adjust the speed of the module + * @param motors the motors that the module controls + */ public MotorModule( Vector direction, Encoder encoder, @@ -69,19 +102,41 @@ public MotorModule( try { powerControl.setInput(() -> encoder.getScaledVelocity()); } catch (NullPointerException e) { - powerControl.setInput(new ConstantInput(0.0)); + powerControl.setInput(new ConstantInput<>(0.0)); } + + modifier = new InputComponent(){}; } + /** + * Create motor module without the use of an encoder + * + * Modules created like this will not be abe to monitor or + * adjust their speed to maintain a constant and more exact + * speed. + * + * @param direction what direction the module runs + * @param motors the motors the module controls + */ public MotorModule(Vector direction, Motor... motors) { this(direction, null, null, motors); } + /** + * Set an encoder for the module + * + * @param encoder the encoder that keeps track of the position of the module + */ public MotorModule setEncoder(Encoder encoder) { this.encoder = encoder; return this; } + /** + * set the power control for the module + * + * @param powerControl an error correction to adjust the speed of the module + */ public MotorModule setErrorCorrection(ErrorCorrection powerControl) { this.powerControl = powerControl; return this; @@ -104,9 +159,26 @@ public void powerCorrection() { } } + /** + * Set the target power of the module + * + * @param power how fast the module will go (-1 to 1) + */ public void setPower(double power) { - targetPower = power; - powerControl.setTarget(power); + modifier.setInput(new ConstantInput<>(power)); + modifier.applySteps(); + targetPower = modifier.get(); + powerControl.setTarget(modifier.get()); + } + + public MotorModule setPowerModifier(InputComponent modifier){ + this.modifier = modifier; + return this; + } + + public MotorModule addStep(Step s){ + modifier.addStep(s); + return this; } /** Method to be called when the toggleable is disabled */ @@ -116,4 +188,46 @@ public void disableAction() { m.setMotorPower(0); } } + + /** + * @return the motor arraylist in the module + */ + public ArrayList getMotors() { + return motors; + } + + /** + * @return the direction the module runs in + */ + public Vector getDirection() { + return direction; + } + + /** + * @return the error correction used for the module + */ + public ErrorCorrection getPowerControl() { + return powerControl; + } + + /** + * @return the encoder that monitors the position of the monitor + */ + public Encoder getEncoder() { + return encoder; + } + + /** + * @return the current target power of the module + */ + public double getTargetPower() { + return targetPower; + } + + /** + * @return the power modifier of the motor + */ + public InputComponent getModifier() { + return modifier; + } } diff --git a/src/main/java/org/montclairrobotics/alloy/motor/steps/Deadzone.java b/src/main/java/org/montclairrobotics/alloy/motor/steps/Deadzone.java new file mode 100644 index 0000000..4ec022a --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/motor/steps/Deadzone.java @@ -0,0 +1,21 @@ +package org.montclairrobotics.alloy.motor.steps; + +import org.montclairrobotics.alloy.components.Step; +import org.montclairrobotics.alloy.vector.Vector; + +public class Deadzone implements Step { + double tolerance; + + public Deadzone(double tolerance){ + this.tolerance = tolerance; + } + + public Deadzone(){ + this(0.05); + } + + @Override + public Double getOutput(Double input) { + return (double)input < tolerance ? 0 : input; + } +} diff --git a/src/main/java/org/montclairrobotics/alloy/motor/steps/VectorDeadzone.java b/src/main/java/org/montclairrobotics/alloy/motor/steps/VectorDeadzone.java new file mode 100644 index 0000000..6fcfa9a --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/motor/steps/VectorDeadzone.java @@ -0,0 +1,17 @@ +package org.montclairrobotics.alloy.motor.steps; + +import org.montclairrobotics.alloy.components.Step; +import org.montclairrobotics.alloy.vector.Vector; + +public class VectorDeadzone implements Step { + double tolerance; + + public VectorDeadzone(double tolerance){ + this.tolerance = tolerance; + } + + @Override + public Vector getOutput(Vector input) { + return input.getManitude() < tolerance ? Vector.ZERO : input; + } +} diff --git a/src/main/java/org/montclairrobotics/alloy/test/Control.java b/src/main/java/org/montclairrobotics/alloy/test/Control.java new file mode 100644 index 0000000..40849d9 --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/test/Control.java @@ -0,0 +1,5 @@ +package org.montclairrobotics.alloy.test; + +public class Control { + +} diff --git a/src/main/java/org/montclairrobotics/alloy/test/Hardware.java b/src/main/java/org/montclairrobotics/alloy/test/Hardware.java new file mode 100644 index 0000000..e09a3a9 --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/test/Hardware.java @@ -0,0 +1,40 @@ +package org.montclairrobotics.alloy.test; + +import com.qualcomm.robotcore.hardware.DcMotor; +import org.montclairrobotics.alloy.core.RobotCore; +import org.montclairrobotics.alloy.utils.Initializeable; + +public class Hardware { + + // ============ + // IDS + // ============ + + static class DeviceID{ + public static final String shooterMotorRight = "shoot_right"; + public static final String shooterMotorLeft = "shoot_left"; + + public static final String intakeMotorRight = "intake_right"; + public static final String intakeMotorLeft = "intake_left"; + } + + // ============ + // Devices + // ============ + + // Shooter + static DcMotor shooterMotorRight; + static DcMotor shooterMotorLeft; + + // Intake + static DcMotor intakeMotorRight; + static DcMotor intakeMotorLeft; + + public static void init() { + shooterMotorRight = RobotCore.getHardwareMap().dcMotor.get(DeviceID.shooterMotorRight); + shooterMotorLeft = RobotCore.getHardwareMap().dcMotor.get(DeviceID.shooterMotorLeft); + + intakeMotorRight = RobotCore.getHardwareMap().dcMotor.get(DeviceID.intakeMotorRight); + intakeMotorLeft = RobotCore.getHardwareMap().dcMotor.get(DeviceID.intakeMotorLeft); + } +} diff --git a/src/main/java/org/montclairrobotics/alloy/test/Shooter.java b/src/main/java/org/montclairrobotics/alloy/test/Shooter.java deleted file mode 100644 index e5278e2..0000000 --- a/src/main/java/org/montclairrobotics/alloy/test/Shooter.java +++ /dev/null @@ -1,49 +0,0 @@ -/* -MIT License - -Copyright (c) 2018 Garrett Burroughs - -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 org.montclairrobotics.alloy.test; - -import org.montclairrobotics.alloy.components.Component; -import org.montclairrobotics.alloy.core.Motor; -import org.montclairrobotics.alloy.ftc.FTCMotor; - -public class Shooter extends Component { - Motor motorR = new FTCMotor("Right Motor"); - Motor motorL = new FTCMotor("Left Motor"); - - public Shooter() { - super(); - } - - @Override - public void enableAction() { - motorR.setMotorPower(1); - motorL.setMotorPower(1); - } - - @Override - public void disableAction() { - motorR.setMotorPower(0); - motorL.setMotorPower(0); - } -} diff --git a/src/main/java/org/montclairrobotics/alloy/test/ShooterMapper.java b/src/main/java/org/montclairrobotics/alloy/test/ShooterMapper.java new file mode 100644 index 0000000..055092a --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/test/ShooterMapper.java @@ -0,0 +1,20 @@ +package org.montclairrobotics.alloy.test; + +import org.montclairrobotics.alloy.components.InputComponent; +import org.montclairrobotics.alloy.motor.Mapper; +import org.montclairrobotics.alloy.motor.MotorModule; +import org.montclairrobotics.alloy.utils.Utils; +import org.montclairrobotics.alloy.vector.Vector; + +public class ShooterMapper implements Mapper { + @Override + public void map(Vector input, MotorModule... modules) { + for(MotorModule m : modules){ + if(m.offset.getX() > 0){ + m.setPower((input.getY() + input.getX()) * Utils.sign(m.direction.getY())); + }else{ + m.setPower((input.getY() - input.getX()) * Utils.sign(m.direction.getY())); + } + } + } +} diff --git a/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java b/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java index e52ba87..e0e6152 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java +++ b/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java @@ -26,17 +26,50 @@ of this software and associated documentation files (the "Software"), to deal import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import org.montclairrobotics.alloy.control.ToggleButton; import org.montclairrobotics.alloy.core.Alloy; +import org.montclairrobotics.alloy.core.Button; +import org.montclairrobotics.alloy.core.Motor; import org.montclairrobotics.alloy.ftc.FTCButton; +import org.montclairrobotics.alloy.ftc.FTCJoystick; +import org.montclairrobotics.alloy.ftc.FTCMotor; +import org.montclairrobotics.alloy.motor.MotorGroup; +import org.montclairrobotics.alloy.motor.MotorModule; +import org.montclairrobotics.alloy.motor.steps.Deadzone; import org.montclairrobotics.alloy.utils.Input; +import org.montclairrobotics.alloy.utils.PID; +import org.montclairrobotics.alloy.vector.Vector; +import org.montclairrobotics.alloy.vector.XY; @TeleOp public class TestRobot extends Alloy { + // Lower level hardware abstractions + FTCMotor rightIntakeMotor; + FTCMotor leftIntakeMotor; - Shooter shooter; + // High Level Hardware abstractions + MotorGroup shooter; + MotorGroup intake; + + PID motorCorrection; @Override public void robotSetup() { - shooter = new Shooter(); + + rightIntakeMotor = new FTCMotor(Hardware.DeviceID.intakeMotorRight); + leftIntakeMotor = new FTCMotor(Hardware.DeviceID.intakeMotorLeft); + + motorCorrection = new PID(1, 0, 0); + + intake = new MotorGroup( + new FTCJoystick(gamepad1, FTCJoystick.Side.RIGHT).addStep(new Deadzone()), + new ShooterMapper(), + new MotorModule(new XY(0, 1), + rightIntakeMotor.getEncoder().setMaxSpeed(100).setDistancePerTick(30), + motorCorrection, + rightIntakeMotor), + new MotorModule(new XY(0, -1), + leftIntakeMotor.getEncoder().setMaxSpeed(100).setDistancePerTick(30), + motorCorrection, + leftIntakeMotor)); } @Override @@ -44,14 +77,6 @@ public void initialization() {} @Override public void periodic() { - Input shooterButton = - new Input() { - @Override - public Boolean get() { - return gamepad1.a; - } - }; - - new ToggleButton(new FTCButton(shooterButton), shooter); + Button shooterButton = FTCButton.getAButton(gamepad1); } } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java b/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java index 362c394..6e094f1 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java @@ -48,8 +48,15 @@ public BangBang(double correction) { * @param target the goal of the error correction */ @Override - public void setTarget(Double target) { + public BangBang setTarget(Double target) { this.target = target; + return this; + } + + @Override + public BangBang setInput(Input input){ + this.input = input; + return this; } /** @@ -62,6 +69,14 @@ public Double getCorrection() { return output; } + /** + * @return A copy of the error correction + */ + @Override + public BangBang copy() { + return new BangBang(lowOut, highOut).setTarget(target).setInput(input); + } + @Update public void calculateCorrection() { if (input.get() > target) { diff --git a/src/main/java/org/montclairrobotics/alloy/utils/BooleanToggle.java b/src/main/java/org/montclairrobotics/alloy/utils/BooleanToggle.java new file mode 100644 index 0000000..6b71ae3 --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/utils/BooleanToggle.java @@ -0,0 +1,22 @@ +package org.montclairrobotics.alloy.utils; + +public class BooleanToggle extends Toggleable implements Input{ + + + @Override + public Boolean get() { + return status.booleanValue(); + } + + /** + * Method to be called when the toggleable is enabled + */ + @Override + public void enableAction() {} + + /** + * Method to be called when the toggleable is disabled + */ + @Override + public void disableAction() {} +} diff --git a/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java b/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java index eb5d471..ea4a364 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java @@ -47,14 +47,14 @@ public interface ErrorCorrection { * * @param input the input to the error correction */ - public void setInput(Input input); + public ErrorCorrection setInput(Input input); /** * Set the target for the correction When the input is equal to the target the error is 0 * * @param target the goal of the error correction */ - public void setTarget(T target); + public ErrorCorrection setTarget(T target); /** * Get the value to apply the correction @@ -62,4 +62,9 @@ public interface ErrorCorrection { * @return the correction */ public T getCorrection(); + + /** + * @return A copy of the error correction + */ + public ErrorCorrection copy(); } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Initializeable.java b/src/main/java/org/montclairrobotics/alloy/utils/Initializeable.java new file mode 100644 index 0000000..50beacf --- /dev/null +++ b/src/main/java/org/montclairrobotics/alloy/utils/Initializeable.java @@ -0,0 +1,12 @@ +package org.montclairrobotics.alloy.utils; + +import org.montclairrobotics.alloy.core.Alloy; + +public abstract class Initializeable { + + public Initializeable(){ + Alloy.initObjects.add(this); + } + + public abstract void init(); +} diff --git a/src/main/java/org/montclairrobotics/alloy/utils/PID.java b/src/main/java/org/montclairrobotics/alloy/utils/PID.java index 8c5749b..d78e2a7 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/PID.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/PID.java @@ -103,13 +103,15 @@ public PID(double p, double i, double d, Input input, double target) { } @Override - public void setTarget(Double target) { + public PID setTarget(Double target) { this.target = target; + return this; } @Override - public void setInput(Input input) { + public PID setInput(Input input) { this.input = input; + return this; } @Update @@ -153,4 +155,12 @@ public void update() { public Double getCorrection() { return output; } + + /** + * @return A copy of the error correction + */ + @Override + public ErrorCorrection copy() { + return new PID(p, i, d).setTarget(target).setInput(input); + } } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Utils.java b/src/main/java/org/montclairrobotics/alloy/utils/Utils.java index 27e7f8e..5fd7b64 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/Utils.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/Utils.java @@ -73,4 +73,26 @@ public static double map( + outputMin; // adjust the scaled value to fit the output return output; } + + /** + * Returns the sign of a number + * + * @param in the number whose sign will be calculated + * @return 1 if the number is positive and -1 if it is negative + */ + public static int sign(double in){ + return in > 0 ? 1 : -1; + } + + /** + * A modified power function that conserves the sign + * + * @param in the number to be raised to a power + * @param pow the power the number will be raised to + * @return in^pow while keeping the sign of in + */ + public static double pow2(double in, int pow){ + double regularResult = Math.pow(in, pow); + return pow % 2 == 0 ? regularResult * sign(in) : regularResult; + } } diff --git a/src/main/java/org/montclairrobotics/alloy/vector/Vector.java b/src/main/java/org/montclairrobotics/alloy/vector/Vector.java index 28916cf..8352b8e 100644 --- a/src/main/java/org/montclairrobotics/alloy/vector/Vector.java +++ b/src/main/java/org/montclairrobotics/alloy/vector/Vector.java @@ -48,7 +48,10 @@ of this software and associated documentation files (the "Software"), to deal * @version 0.1 * @since 0.1 */ -public interface Vector { +public interface Vector extends Comparable{ + + Vector ZERO = new XY(0, 0); + /** * Gets the X component of the vector * From 93ac1e92b48ae7d09f941b19bd9b00778543afc3 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Mon, 28 May 2018 19:36:18 -0400 Subject: [PATCH 16/54] Updated hyperlinks --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 714b424..2cee1fa 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,11 @@ with expandibility in mind. FRC implementation is possible and will be coming in Alloy is based off the FRC robot framework [Sprocket](https://github.com/MontclairRobotics/Sprocket), but redesigned to abstract away the more complex ideas but still allow for advanced robot functionality. Any information regarding Alloy, including how it works, project structure, as well as in-depth explanation on how to use all of the components -can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) as well as a [quick start guide](). +can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) as well as a [quick start guide](https://github.com/GarrettBurroughs/Alloy/wiki/Getting-Started). ## Formatting -Alloy uses the [Spotless]() code formatter to ensure that +Alloy uses the [Spotless](https://github.com/diffplug/spotless/tree/master/plugin-gradle) code formatter to ensure that all of the code follows a specific format. It is added as a build step for a gradle build so this means that all code in alloy must be compliant to be merged. Spotless allows for automatic code formatting, just run: From ee849c478aabd398159c92ca5d5b4f4e05721fac Mon Sep 17 00:00:00 2001 From: GarrettBurroughs Date: Mon, 6 Aug 2018 08:53:03 -0400 Subject: [PATCH 17/54] fixed formatting --- .../alloy/components/InputComponent.java | 3 +- .../montclairrobotics/alloy/core/Alloy.java | 5 +- .../alloy/drive/DTInput.java | 23 ++++++++ .../alloy/drive/DTMapper.java | 2 +- .../alloy/drive/DriveModule.java | 42 ++++++++++--- .../alloy/drive/DriveTrain.java | 4 +- .../alloy/ftc/FTCJoystick.java | 3 +- .../montclairrobotics/alloy/ftc/FTCMotor.java | 5 +- .../alloy/ftc/FTCTargetMotor.java | 3 +- .../alloy/motor/DefaultMapper.java | 27 ++++++++- .../montclairrobotics/alloy/motor/Mapper.java | 4 +- .../alloy/motor/MotorGroup.java | 26 +++----- .../alloy/motor/MotorModule.java | 59 ++++++------------- .../alloy/motor/steps/Deadzone.java | 30 ++++++++-- .../alloy/motor/steps/VectorDeadzone.java | 25 +++++++- .../montclairrobotics/alloy/test/Control.java | 27 ++++++++- .../alloy/test/Hardware.java | 26 +++++++- .../alloy/test/ShooterMapper.java | 30 ++++++++-- .../alloy/test/TestRobot.java | 39 ++++++------ .../alloy/utils/BangBang.java | 6 +- .../alloy/utils/BooleanToggle.java | 34 ++++++++--- .../alloy/utils/ErrorCorrection.java | 4 +- .../alloy/utils/Initializeable.java | 25 +++++++- .../montclairrobotics/alloy/utils/PID.java | 4 +- .../montclairrobotics/alloy/utils/Utils.java | 4 +- .../alloy/vector/Vector.java | 2 +- 26 files changed, 323 insertions(+), 139 deletions(-) diff --git a/src/main/java/org/montclairrobotics/alloy/components/InputComponent.java b/src/main/java/org/montclairrobotics/alloy/components/InputComponent.java index 4115b3b..35c3a98 100644 --- a/src/main/java/org/montclairrobotics/alloy/components/InputComponent.java +++ b/src/main/java/org/montclairrobotics/alloy/components/InputComponent.java @@ -49,10 +49,11 @@ public void applySteps() { output = calculation; } - public InputComponent addStep(Step s){ + public InputComponent addStep(Step s) { steps.add(s); return this; } + public InputComponent setInput(Input input) { this.input = input; return this; diff --git a/src/main/java/org/montclairrobotics/alloy/core/Alloy.java b/src/main/java/org/montclairrobotics/alloy/core/Alloy.java index 8729cfe..e997fba 100644 --- a/src/main/java/org/montclairrobotics/alloy/core/Alloy.java +++ b/src/main/java/org/montclairrobotics/alloy/core/Alloy.java @@ -24,13 +24,12 @@ of this software and associated documentation files (the "Software"), to deal package org.montclairrobotics.alloy.core; import com.qualcomm.robotcore.eventloop.opmode.OpMode; +import java.util.ArrayList; import org.montclairrobotics.alloy.components.Component; import org.montclairrobotics.alloy.ftc.FTCDebugger; import org.montclairrobotics.alloy.update.Updater; import org.montclairrobotics.alloy.utils.Initializeable; -import java.util.ArrayList; - /** * Created by MHS Robotics on 11/13/2017. * @@ -71,7 +70,7 @@ public void init() { new RobotCore(telemetry, hardwareMap, gamepad1, gamepad2); Component.debugger = new FTCDebugger(); - for(Initializeable i : initObjects){ + for (Initializeable i : initObjects) { i.init(); } diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DTInput.java b/src/main/java/org/montclairrobotics/alloy/drive/DTInput.java index d3eec8d..ebd5c15 100644 --- a/src/main/java/org/montclairrobotics/alloy/drive/DTInput.java +++ b/src/main/java/org/montclairrobotics/alloy/drive/DTInput.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.drive; import org.montclairrobotics.alloy.vector.Angle; diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java b/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java index 65872f6..097c843 100644 --- a/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java +++ b/src/main/java/org/montclairrobotics/alloy/drive/DTMapper.java @@ -34,5 +34,5 @@ of this software and associated documentation files (the "Software"), to deal * @since 0.1 */ public interface DTMapper extends Mapper { - public void map(Input input, MotorModule ... modules); + public void map(Input input, MotorModule... modules); } diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DriveModule.java b/src/main/java/org/montclairrobotics/alloy/drive/DriveModule.java index 8b5ee0a..b5dc42c 100644 --- a/src/main/java/org/montclairrobotics/alloy/drive/DriveModule.java +++ b/src/main/java/org/montclairrobotics/alloy/drive/DriveModule.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.drive; import org.montclairrobotics.alloy.core.Encoder; @@ -9,17 +32,20 @@ public class DriveModule extends MotorModule { /** * Create a fully functioning motor module - *

- * Modules created like this will be able to adjust - * their speed based on an error correction to - * maintain a more accurate speed. * - * @param direction the direction that the module runs (for use in motor groups) - * @param encoder the encoder that keeps track of the motors position + *

Modules created like this will be able to adjust their speed based on an error correction + * to maintain a more accurate speed. + * + * @param direction the direction that the module runs (for use in motor groups) + * @param encoder the encoder that keeps track of the motors position * @param powerControl an error correction to adjust the speed of the module - * @param motors the motors that the module controls + * @param motors the motors that the module controls */ - public DriveModule(Vector direction, Encoder encoder, ErrorCorrection powerControl, Motor... motors) { + public DriveModule( + Vector direction, + Encoder encoder, + ErrorCorrection powerControl, + Motor... motors) { super(direction, encoder, powerControl, motors); } } diff --git a/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java b/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java index c8694f1..d71e835 100644 --- a/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java +++ b/src/main/java/org/montclairrobotics/alloy/drive/DriveTrain.java @@ -29,6 +29,4 @@ of this software and associated documentation files (the "Software"), to deal * @author Garrett Burroughs * @since 0.1 */ -public class DriveTrain { - -} +public class DriveTrain {} diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java index c6c45c1..ebb2b03 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCJoystick.java @@ -27,7 +27,6 @@ of this software and associated documentation files (the "Software"), to deal import org.montclairrobotics.alloy.components.InputComponent; import org.montclairrobotics.alloy.core.Joystick; import org.montclairrobotics.alloy.update.Update; -import org.montclairrobotics.alloy.utils.Input; import org.montclairrobotics.alloy.vector.Vector; import org.montclairrobotics.alloy.vector.XY; @@ -94,7 +93,7 @@ public Vector getValue() { } @Update - public void updateControls(){ + public void updateControls() { output = getValue(); } } diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java index 8cf86c0..690f7b9 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCMotor.java @@ -99,7 +99,7 @@ public boolean getInverted() { return motor.getDirection() == DcMotorSimple.Direction.REVERSE ? true : false; } - public Encoder getEncoder(){ + public Encoder getEncoder() { return new Encoder() { @Override public int getTicks() { @@ -108,7 +108,6 @@ public int getTicks() { }; } - @Update public void updateMotor() { @@ -124,6 +123,4 @@ public void updateMotor() { public void disableAction() { motor.setPower(0); } - - } diff --git a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java index e67d9f3..1d25799 100644 --- a/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java +++ b/src/main/java/org/montclairrobotics/alloy/ftc/FTCTargetMotor.java @@ -152,7 +152,8 @@ public void update() { if (motor.getMode() == DcMotor.RunMode.RUN_TO_POSITION) { if (runmode == Mode.CUSTOM) { setTargetPower( - correction.getCorrection()); // If running using custom PID mode, set power to PID output + correction + .getCorrection()); // If running using custom PID mode, set power to PID output } else { motor.setPower( targetPower); // If running in default target mode, set the target power diff --git a/src/main/java/org/montclairrobotics/alloy/motor/DefaultMapper.java b/src/main/java/org/montclairrobotics/alloy/motor/DefaultMapper.java index 047ce40..19ef8ed 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/DefaultMapper.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/DefaultMapper.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.motor; import org.montclairrobotics.alloy.utils.Input; @@ -6,12 +29,12 @@ /** * A simple default mapper * - * This mapper will run all of the motors in the group in the same direction + *

This mapper will run all of the motors in the group in the same direction */ public class DefaultMapper implements Mapper> { @Override public void map(Input input, MotorModule... modules) { - for(MotorModule m : modules){ + for (MotorModule m : modules) { m.setPower(input.get() * Utils.sign(m.getDirection().getManitude())); } } diff --git a/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java b/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java index 53650cc..e834700 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/Mapper.java @@ -23,8 +23,6 @@ of this software and associated documentation files (the "Software"), to deal */ package org.montclairrobotics.alloy.motor; -import org.montclairrobotics.alloy.components.InputComponent; - public interface Mapper { - public void map(T input, MotorModule ... modules); + public void map(T input, MotorModule... modules); } diff --git a/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java b/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java index 56cb514..840a5b1 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/MotorGroup.java @@ -25,13 +25,9 @@ of this software and associated documentation files (the "Software"), to deal import java.util.ArrayList; import java.util.Arrays; -import java.util.List; - import org.montclairrobotics.alloy.components.Component; import org.montclairrobotics.alloy.components.InputComponent; -import org.montclairrobotics.alloy.core.Motor; import org.montclairrobotics.alloy.update.Update; -import org.montclairrobotics.alloy.utils.Input; /** * A motor group is a group of motor modules that run together @@ -46,39 +42,33 @@ of this software and associated documentation files (the "Software"), to deal */ public class MotorGroup extends Component { - /** - * The mapper that will be used for power assignment and calculation - */ + /** The mapper that will be used for power assignment and calculation */ public Mapper mapper; - /** - * The modules contained in the motor group - */ + /** The modules contained in the motor group */ public ArrayList modules; - /** - * The control input for the motor group - */ + /** The control input for the motor group */ public InputComponent input; - public MotorGroup(InputComponent input, Mapper mapper, MotorModule ... modules){ + public MotorGroup(InputComponent input, Mapper mapper, MotorModule... modules) { this.input = input; this.mapper = mapper; - this.modules = (ArrayList)Arrays.asList(modules); + this.modules = (ArrayList) Arrays.asList(modules); } /** * Creates a motor group with a default mapper that simply + * * @param input * @param modules */ - public MotorGroup(InputComponent input, MotorModule ... modules){ + public MotorGroup(InputComponent input, MotorModule... modules) { this(input, new DefaultMapper(), modules); } @Update - public void controlPower(){ + public void controlPower() { mapper.map(input, modules.toArray(new MotorModule[modules.size()])); } - } diff --git a/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java b/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java index 630b5e5..8ac765d 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/MotorModule.java @@ -43,9 +43,9 @@ of this software and associated documentation files (the "Software"), to deal * other modules. Modules can also be controlled with an encoder and a ErrorCorrection to ensure * that the are going the right speed. * - * You can also add steps to the Module that can alter the amount of power that the - * module will receive. This can be useful for modules that are being controlled by - * a separate entity such as a motor group. + *

You can also add steps to the Module that can alter the amount of power that the module will + * receive. This can be useful for modules that are being controlled by a separate entity such as a + * motor group. * * @author Garrett Burroughs * @version 0.1 @@ -55,9 +55,7 @@ public class MotorModule extends Component { /** The motors that the module will control */ public ArrayList motors; - /** - * The direction that the modules run for use in a motor group - */ + /** The direction that the modules run for use in a motor group */ public Vector direction; public Vector offset; @@ -65,25 +63,19 @@ public class MotorModule extends Component { /** An error correction that will control the power */ public ErrorCorrection powerControl; - /** - * The encoder that keeps track of the position and controls the motors - */ + /** The encoder that keeps track of the position and controls the motors */ public Encoder encoder; - /** - * how fast the module should be running - */ + /** how fast the module should be running */ public double targetPower; - public InputComponent modifier; /** * Create a fully functioning motor module * - * Modules created like this will be able to adjust - * their speed based on an error correction to - * maintain a more accurate speed. + *

Modules created like this will be able to adjust their speed based on an error correction + * to maintain a more accurate speed. * * @param direction the direction that the module runs (for use in motor groups) * @param encoder the encoder that keeps track of the motors position @@ -105,15 +97,14 @@ public MotorModule( powerControl.setInput(new ConstantInput<>(0.0)); } - modifier = new InputComponent(){}; + modifier = new InputComponent() {}; } /** * Create motor module without the use of an encoder * - * Modules created like this will not be abe to monitor or - * adjust their speed to maintain a constant and more exact - * speed. + *

Modules created like this will not be abe to monitor or adjust their speed to maintain a + * constant and more exact speed. * * @param direction what direction the module runs * @param motors the motors the module controls @@ -171,12 +162,12 @@ public void setPower(double power) { powerControl.setTarget(modifier.get()); } - public MotorModule setPowerModifier(InputComponent modifier){ + public MotorModule setPowerModifier(InputComponent modifier) { this.modifier = modifier; return this; } - public MotorModule addStep(Step s){ + public MotorModule addStep(Step s) { modifier.addStep(s); return this; } @@ -189,44 +180,32 @@ public void disableAction() { } } - /** - * @return the motor arraylist in the module - */ + /** @return the motor arraylist in the module */ public ArrayList getMotors() { return motors; } - /** - * @return the direction the module runs in - */ + /** @return the direction the module runs in */ public Vector getDirection() { return direction; } - /** - * @return the error correction used for the module - */ + /** @return the error correction used for the module */ public ErrorCorrection getPowerControl() { return powerControl; } - /** - * @return the encoder that monitors the position of the monitor - */ + /** @return the encoder that monitors the position of the monitor */ public Encoder getEncoder() { return encoder; } - /** - * @return the current target power of the module - */ + /** @return the current target power of the module */ public double getTargetPower() { return targetPower; } - /** - * @return the power modifier of the motor - */ + /** @return the power modifier of the motor */ public InputComponent getModifier() { return modifier; } diff --git a/src/main/java/org/montclairrobotics/alloy/motor/steps/Deadzone.java b/src/main/java/org/montclairrobotics/alloy/motor/steps/Deadzone.java index 4ec022a..0dc40ae 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/steps/Deadzone.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/steps/Deadzone.java @@ -1,21 +1,43 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.motor.steps; import org.montclairrobotics.alloy.components.Step; -import org.montclairrobotics.alloy.vector.Vector; public class Deadzone implements Step { double tolerance; - public Deadzone(double tolerance){ + public Deadzone(double tolerance) { this.tolerance = tolerance; } - public Deadzone(){ + public Deadzone() { this(0.05); } @Override public Double getOutput(Double input) { - return (double)input < tolerance ? 0 : input; + return (double) input < tolerance ? 0 : input; } } diff --git a/src/main/java/org/montclairrobotics/alloy/motor/steps/VectorDeadzone.java b/src/main/java/org/montclairrobotics/alloy/motor/steps/VectorDeadzone.java index 6fcfa9a..619624c 100644 --- a/src/main/java/org/montclairrobotics/alloy/motor/steps/VectorDeadzone.java +++ b/src/main/java/org/montclairrobotics/alloy/motor/steps/VectorDeadzone.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.motor.steps; import org.montclairrobotics.alloy.components.Step; @@ -6,7 +29,7 @@ public class VectorDeadzone implements Step { double tolerance; - public VectorDeadzone(double tolerance){ + public VectorDeadzone(double tolerance) { this.tolerance = tolerance; } diff --git a/src/main/java/org/montclairrobotics/alloy/test/Control.java b/src/main/java/org/montclairrobotics/alloy/test/Control.java index 40849d9..6611e1c 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/Control.java +++ b/src/main/java/org/montclairrobotics/alloy/test/Control.java @@ -1,5 +1,26 @@ -package org.montclairrobotics.alloy.test; +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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: -public class Control { +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 org.montclairrobotics.alloy.test; -} +public class Control {} diff --git a/src/main/java/org/montclairrobotics/alloy/test/Hardware.java b/src/main/java/org/montclairrobotics/alloy/test/Hardware.java index e09a3a9..0068241 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/Hardware.java +++ b/src/main/java/org/montclairrobotics/alloy/test/Hardware.java @@ -1,8 +1,30 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.test; import com.qualcomm.robotcore.hardware.DcMotor; import org.montclairrobotics.alloy.core.RobotCore; -import org.montclairrobotics.alloy.utils.Initializeable; public class Hardware { @@ -10,7 +32,7 @@ public class Hardware { // IDS // ============ - static class DeviceID{ + static class DeviceID { public static final String shooterMotorRight = "shoot_right"; public static final String shooterMotorLeft = "shoot_left"; diff --git a/src/main/java/org/montclairrobotics/alloy/test/ShooterMapper.java b/src/main/java/org/montclairrobotics/alloy/test/ShooterMapper.java index 055092a..5ff71ea 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/ShooterMapper.java +++ b/src/main/java/org/montclairrobotics/alloy/test/ShooterMapper.java @@ -1,6 +1,28 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.test; -import org.montclairrobotics.alloy.components.InputComponent; import org.montclairrobotics.alloy.motor.Mapper; import org.montclairrobotics.alloy.motor.MotorModule; import org.montclairrobotics.alloy.utils.Utils; @@ -9,10 +31,10 @@ public class ShooterMapper implements Mapper { @Override public void map(Vector input, MotorModule... modules) { - for(MotorModule m : modules){ - if(m.offset.getX() > 0){ + for (MotorModule m : modules) { + if (m.offset.getX() > 0) { m.setPower((input.getY() + input.getX()) * Utils.sign(m.direction.getY())); - }else{ + } else { m.setPower((input.getY() - input.getX()) * Utils.sign(m.direction.getY())); } } diff --git a/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java b/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java index e0e6152..14112b7 100644 --- a/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java +++ b/src/main/java/org/montclairrobotics/alloy/test/TestRobot.java @@ -24,19 +24,15 @@ of this software and associated documentation files (the "Software"), to deal package org.montclairrobotics.alloy.test; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; -import org.montclairrobotics.alloy.control.ToggleButton; import org.montclairrobotics.alloy.core.Alloy; import org.montclairrobotics.alloy.core.Button; -import org.montclairrobotics.alloy.core.Motor; import org.montclairrobotics.alloy.ftc.FTCButton; import org.montclairrobotics.alloy.ftc.FTCJoystick; import org.montclairrobotics.alloy.ftc.FTCMotor; import org.montclairrobotics.alloy.motor.MotorGroup; import org.montclairrobotics.alloy.motor.MotorModule; import org.montclairrobotics.alloy.motor.steps.Deadzone; -import org.montclairrobotics.alloy.utils.Input; import org.montclairrobotics.alloy.utils.PID; -import org.montclairrobotics.alloy.vector.Vector; import org.montclairrobotics.alloy.vector.XY; @TeleOp @@ -54,22 +50,31 @@ public class TestRobot extends Alloy { @Override public void robotSetup() { - rightIntakeMotor = new FTCMotor(Hardware.DeviceID.intakeMotorRight); - leftIntakeMotor = new FTCMotor(Hardware.DeviceID.intakeMotorLeft); + rightIntakeMotor = new FTCMotor(Hardware.DeviceID.intakeMotorRight); + leftIntakeMotor = new FTCMotor(Hardware.DeviceID.intakeMotorLeft); motorCorrection = new PID(1, 0, 0); - intake = new MotorGroup( - new FTCJoystick(gamepad1, FTCJoystick.Side.RIGHT).addStep(new Deadzone()), - new ShooterMapper(), - new MotorModule(new XY(0, 1), - rightIntakeMotor.getEncoder().setMaxSpeed(100).setDistancePerTick(30), - motorCorrection, - rightIntakeMotor), - new MotorModule(new XY(0, -1), - leftIntakeMotor.getEncoder().setMaxSpeed(100).setDistancePerTick(30), - motorCorrection, - leftIntakeMotor)); + intake = + new MotorGroup( + new FTCJoystick(gamepad1, FTCJoystick.Side.RIGHT).addStep(new Deadzone()), + new ShooterMapper(), + new MotorModule( + new XY(0, 1), + rightIntakeMotor + .getEncoder() + .setMaxSpeed(100) + .setDistancePerTick(30), + motorCorrection, + rightIntakeMotor), + new MotorModule( + new XY(0, -1), + leftIntakeMotor + .getEncoder() + .setMaxSpeed(100) + .setDistancePerTick(30), + motorCorrection, + leftIntakeMotor)); } @Override diff --git a/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java b/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java index 6e094f1..0585405 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/BangBang.java @@ -54,7 +54,7 @@ public BangBang setTarget(Double target) { } @Override - public BangBang setInput(Input input){ + public BangBang setInput(Input input) { this.input = input; return this; } @@ -69,9 +69,7 @@ public Double getCorrection() { return output; } - /** - * @return A copy of the error correction - */ + /** @return A copy of the error correction */ @Override public BangBang copy() { return new BangBang(lowOut, highOut).setTarget(target).setInput(input); diff --git a/src/main/java/org/montclairrobotics/alloy/utils/BooleanToggle.java b/src/main/java/org/montclairrobotics/alloy/utils/BooleanToggle.java index 6b71ae3..4e0cbaa 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/BooleanToggle.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/BooleanToggle.java @@ -1,22 +1,40 @@ -package org.montclairrobotics.alloy.utils; +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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: -public class BooleanToggle extends Toggleable implements Input{ +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 org.montclairrobotics.alloy.utils; +public class BooleanToggle extends Toggleable implements Input { @Override public Boolean get() { return status.booleanValue(); } - /** - * Method to be called when the toggleable is enabled - */ + /** Method to be called when the toggleable is enabled */ @Override public void enableAction() {} - /** - * Method to be called when the toggleable is disabled - */ + /** Method to be called when the toggleable is disabled */ @Override public void disableAction() {} } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java b/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java index ea4a364..8733651 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/ErrorCorrection.java @@ -63,8 +63,6 @@ public interface ErrorCorrection { */ public T getCorrection(); - /** - * @return A copy of the error correction - */ + /** @return A copy of the error correction */ public ErrorCorrection copy(); } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Initializeable.java b/src/main/java/org/montclairrobotics/alloy/utils/Initializeable.java index 50beacf..5517d3d 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/Initializeable.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/Initializeable.java @@ -1,10 +1,33 @@ +/* +MIT License + +Copyright (c) 2018 Garrett Burroughs + +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 org.montclairrobotics.alloy.utils; import org.montclairrobotics.alloy.core.Alloy; public abstract class Initializeable { - public Initializeable(){ + public Initializeable() { Alloy.initObjects.add(this); } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/PID.java b/src/main/java/org/montclairrobotics/alloy/utils/PID.java index d78e2a7..464420e 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/PID.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/PID.java @@ -156,9 +156,7 @@ public Double getCorrection() { return output; } - /** - * @return A copy of the error correction - */ + /** @return A copy of the error correction */ @Override public ErrorCorrection copy() { return new PID(p, i, d).setTarget(target).setInput(input); diff --git a/src/main/java/org/montclairrobotics/alloy/utils/Utils.java b/src/main/java/org/montclairrobotics/alloy/utils/Utils.java index 5fd7b64..56269cb 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/Utils.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/Utils.java @@ -80,7 +80,7 @@ public static double map( * @param in the number whose sign will be calculated * @return 1 if the number is positive and -1 if it is negative */ - public static int sign(double in){ + public static int sign(double in) { return in > 0 ? 1 : -1; } @@ -91,7 +91,7 @@ public static int sign(double in){ * @param pow the power the number will be raised to * @return in^pow while keeping the sign of in */ - public static double pow2(double in, int pow){ + public static double pow2(double in, int pow) { double regularResult = Math.pow(in, pow); return pow % 2 == 0 ? regularResult * sign(in) : regularResult; } diff --git a/src/main/java/org/montclairrobotics/alloy/vector/Vector.java b/src/main/java/org/montclairrobotics/alloy/vector/Vector.java index 8352b8e..f6cbdd6 100644 --- a/src/main/java/org/montclairrobotics/alloy/vector/Vector.java +++ b/src/main/java/org/montclairrobotics/alloy/vector/Vector.java @@ -48,7 +48,7 @@ of this software and associated documentation files (the "Software"), to deal * @version 0.1 * @since 0.1 */ -public interface Vector extends Comparable{ +public interface Vector extends Comparable { Vector ZERO = new XY(0, 0); From bf1aa380cb31fbec26361af523f0b9694d980e78 Mon Sep 17 00:00:00 2001 From: GarrettBurroughs Date: Mon, 6 Aug 2018 17:06:56 -0400 Subject: [PATCH 18/54] updated docs --- .idea/misc.xml | 14 +- .idea/modules/Alloy_main.iml | 20 - .idea/modules/Alloy_test.iml | 21 - docs/javadoc/allclasses-frame.html | 52 ++ docs/javadoc/allclasses-noframe.html | 52 ++ docs/javadoc/constant-values.html | 124 +++ docs/javadoc/deprecated-list.html | 124 +++ docs/javadoc/help-doc.html | 229 ++++++ docs/javadoc/index-files/index-1.html | 177 +++++ docs/javadoc/index-files/index-10.html | 131 ++++ docs/javadoc/index-files/index-11.html | 137 ++++ docs/javadoc/index-files/index-12.html | 143 ++++ docs/javadoc/index-files/index-13.html | 139 ++++ docs/javadoc/index-files/index-14.html | 161 ++++ docs/javadoc/index-files/index-15.html | 153 ++++ docs/javadoc/index-files/index-16.html | 162 ++++ docs/javadoc/index-files/index-17.html | 279 +++++++ docs/javadoc/index-files/index-18.html | 165 ++++ docs/javadoc/index-files/index-19.html | 152 ++++ docs/javadoc/index-files/index-2.html | 139 ++++ docs/javadoc/index-files/index-20.html | 149 ++++ docs/javadoc/index-files/index-21.html | 145 ++++ docs/javadoc/index-files/index-22.html | 135 ++++ docs/javadoc/index-files/index-23.html | 129 +++ docs/javadoc/index-files/index-3.html | 155 ++++ docs/javadoc/index-files/index-4.html | 167 ++++ docs/javadoc/index-files/index-5.html | 137 ++++ docs/javadoc/index-files/index-6.html | 161 ++++ docs/javadoc/index-files/index-7.html | 291 +++++++ docs/javadoc/index-files/index-8.html | 132 ++++ docs/javadoc/index-files/index-9.html | 147 ++++ docs/javadoc/index.html | 75 ++ .../alloy/auto/AlloyAutonomous.html | 324 ++++++++ .../montclairrobotics/alloy/auto/State.html | 358 +++++++++ .../alloy/auto/StateMachine.html | 382 +++++++++ .../alloy/auto/class-use/AlloyAutonomous.html | 124 +++ .../alloy/auto/class-use/State.html | 190 +++++ .../alloy/auto/class-use/StateMachine.html | 124 +++ .../alloy/auto/package-frame.html | 22 + .../alloy/auto/package-summary.html | 156 ++++ .../alloy/auto/package-tree.html | 146 ++++ .../alloy/auto/package-use.html | 159 ++++ .../alloy/control/ButtonAction.html | 398 ++++++++++ .../alloy/control/ToggleButton.html | 380 +++++++++ .../alloy/control/class-use/ButtonAction.html | 166 ++++ .../alloy/control/class-use/ToggleButton.html | 124 +++ .../alloy/control/package-frame.html | 21 + .../alloy/control/package-summary.html | 150 ++++ .../alloy/control/package-tree.html | 141 ++++ .../alloy/control/package-use.html | 159 ++++ .../montclairrobotics/alloy/core/Alloy.html | 391 +++++++++ .../montclairrobotics/alloy/core/Button.html | 244 ++++++ .../montclairrobotics/alloy/core/Debug.html | 268 +++++++ .../alloy/core/Joystick.html | 243 ++++++ .../montclairrobotics/alloy/core/Mode.html | 358 +++++++++ .../montclairrobotics/alloy/core/Motor.html | 305 +++++++ .../alloy/core/RobotCore.html | 458 +++++++++++ .../alloy/core/TargetMotor.html | 306 ++++++++ .../alloy/core/class-use/Alloy.html | 164 ++++ .../alloy/core/class-use/Button.html | 203 +++++ .../alloy/core/class-use/Debug.html | 166 ++++ .../alloy/core/class-use/Joystick.html | 166 ++++ .../alloy/core/class-use/Mode.html | 173 ++++ .../alloy/core/class-use/Motor.html | 196 +++++ .../alloy/core/class-use/RobotCore.html | 124 +++ .../alloy/core/class-use/TargetMotor.html | 166 ++++ .../alloy/core/package-frame.html | 33 + .../alloy/core/package-summary.html | 208 +++++ .../alloy/core/package-tree.html | 165 ++++ .../alloy/core/package-use.html | 247 ++++++ .../alloy/drive/DTMapper.html | 228 ++++++ .../alloy/drive/DriveTrain.html | 244 ++++++ .../alloy/drive/class-use/DTMapper.html | 124 +++ .../alloy/drive/class-use/DriveTrain.html | 124 +++ .../alloy/drive/package-frame.html | 24 + .../alloy/drive/package-summary.html | 161 ++++ .../alloy/drive/package-tree.html | 141 ++++ .../alloy/drive/package-use.html | 124 +++ .../alloy/ftc/FTCButton.html | 465 +++++++++++ .../montclairrobotics/alloy/ftc/FTCDebug.html | 322 ++++++++ .../alloy/ftc/FTCJoystick.Side.html | 345 ++++++++ .../alloy/ftc/FTCJoystick.html | 314 ++++++++ .../montclairrobotics/alloy/ftc/FTCMotor.html | 368 +++++++++ .../alloy/ftc/FTCTargetMotor.html | 489 ++++++++++++ .../alloy/ftc/class-use/FTCButton.html | 208 +++++ .../alloy/ftc/class-use/FTCDebug.html | 124 +++ .../alloy/ftc/class-use/FTCJoystick.Side.html | 185 +++++ .../alloy/ftc/class-use/FTCJoystick.html | 124 +++ .../alloy/ftc/class-use/FTCMotor.html | 166 ++++ .../alloy/ftc/class-use/FTCTargetMotor.html | 124 +++ .../alloy/ftc/package-frame.html | 28 + .../alloy/ftc/package-summary.html | 183 +++++ .../alloy/ftc/package-tree.html | 156 ++++ .../alloy/ftc/package-use.html | 167 ++++ .../montclairrobotics/alloy/test/Shooter.html | 312 ++++++++ .../alloy/test/TestRobot.html | 369 +++++++++ .../alloy/test/class-use/Shooter.html | 124 +++ .../alloy/test/class-use/TestRobot.html | 124 +++ .../alloy/test/package-frame.html | 21 + .../alloy/test/package-summary.html | 146 ++++ .../alloy/test/package-tree.html | 150 ++++ .../alloy/test/package-use.html | 124 +++ .../alloy/update/Updatable.html | 257 ++++++ .../alloy/update/Update.html | 237 ++++++ .../alloy/update/Updater.html | 291 +++++++ .../alloy/update/class-use/Updatable.html | 124 +++ .../alloy/update/class-use/Update.html | 213 +++++ .../alloy/update/class-use/Updater.html | 124 +++ .../alloy/update/package-frame.html | 25 + .../alloy/update/package-summary.html | 165 ++++ .../alloy/update/package-tree.html | 142 ++++ .../alloy/update/package-use.html | 195 +++++ .../montclairrobotics/alloy/utils/Input.html | 232 ++++++ .../montclairrobotics/alloy/utils/PID.html | 387 +++++++++ .../alloy/utils/Toggleable.html | 357 +++++++++ .../alloy/utils/TuneablePID.html | 237 ++++++ .../alloy/utils/class-use/Input.html | 220 ++++++ .../alloy/utils/class-use/PID.html | 205 +++++ .../alloy/utils/class-use/Toggleable.html | 185 +++++ .../alloy/utils/class-use/TuneablePID.html | 124 +++ .../alloy/utils/package-frame.html | 26 + .../alloy/utils/package-summary.html | 171 ++++ .../alloy/utils/package-tree.html | 143 ++++ .../alloy/utils/package-use.html | 232 ++++++ .../montclairrobotics/alloy/vector/Angle.html | 476 +++++++++++ .../montclairrobotics/alloy/vector/Polar.html | 729 +++++++++++++++++ .../alloy/vector/Vector.html | 641 +++++++++++++++ .../montclairrobotics/alloy/vector/XY.html | 741 ++++++++++++++++++ .../alloy/vector/class-use/Angle.html | 266 +++++++ .../alloy/vector/class-use/Polar.html | 124 +++ .../alloy/vector/class-use/Vector.html | 434 ++++++++++ .../alloy/vector/class-use/XY.html | 162 ++++ .../alloy/vector/package-frame.html | 26 + .../alloy/vector/package-summary.html | 173 ++++ .../alloy/vector/package-tree.html | 143 ++++ .../alloy/vector/package-use.html | 211 +++++ docs/javadoc/overview-frame.html | 29 + docs/javadoc/overview-summary.html | 167 ++++ docs/javadoc/overview-tree.html | 217 +++++ docs/javadoc/package-list | 9 + docs/javadoc/script.js | 30 + docs/javadoc/stylesheet.css | 574 ++++++++++++++ docs/readme.md | 21 + 143 files changed, 28224 insertions(+), 54 deletions(-) create mode 100644 docs/javadoc/allclasses-frame.html create mode 100644 docs/javadoc/allclasses-noframe.html create mode 100644 docs/javadoc/constant-values.html create mode 100644 docs/javadoc/deprecated-list.html create mode 100644 docs/javadoc/help-doc.html create mode 100644 docs/javadoc/index-files/index-1.html create mode 100644 docs/javadoc/index-files/index-10.html create mode 100644 docs/javadoc/index-files/index-11.html create mode 100644 docs/javadoc/index-files/index-12.html create mode 100644 docs/javadoc/index-files/index-13.html create mode 100644 docs/javadoc/index-files/index-14.html create mode 100644 docs/javadoc/index-files/index-15.html create mode 100644 docs/javadoc/index-files/index-16.html create mode 100644 docs/javadoc/index-files/index-17.html create mode 100644 docs/javadoc/index-files/index-18.html create mode 100644 docs/javadoc/index-files/index-19.html create mode 100644 docs/javadoc/index-files/index-2.html create mode 100644 docs/javadoc/index-files/index-20.html create mode 100644 docs/javadoc/index-files/index-21.html create mode 100644 docs/javadoc/index-files/index-22.html create mode 100644 docs/javadoc/index-files/index-23.html create mode 100644 docs/javadoc/index-files/index-3.html create mode 100644 docs/javadoc/index-files/index-4.html create mode 100644 docs/javadoc/index-files/index-5.html create mode 100644 docs/javadoc/index-files/index-6.html create mode 100644 docs/javadoc/index-files/index-7.html create mode 100644 docs/javadoc/index-files/index-8.html create mode 100644 docs/javadoc/index-files/index-9.html create mode 100644 docs/javadoc/index.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/AlloyAutonomous.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/State.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/StateMachine.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/class-use/AlloyAutonomous.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/class-use/State.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/class-use/StateMachine.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/auto/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/control/ButtonAction.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/control/ToggleButton.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/control/class-use/ButtonAction.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/control/class-use/ToggleButton.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/control/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/control/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/control/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/control/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/Alloy.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/Button.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/Debug.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/Joystick.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/Mode.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/Motor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/RobotCore.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/TargetMotor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/Alloy.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/Button.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/Debug.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/Joystick.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/Mode.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/Motor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/RobotCore.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/TargetMotor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/DTMapper.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/DriveTrain.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DTMapper.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DriveTrain.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/FTCButton.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/FTCDebug.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/FTCJoystick.Side.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/FTCJoystick.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/FTCMotor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/FTCTargetMotor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCButton.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCDebug.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCJoystick.Side.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCJoystick.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCMotor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCTargetMotor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/Shooter.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/TestRobot.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/class-use/Shooter.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/class-use/TestRobot.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/Updatable.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/Update.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/Updater.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/class-use/Updatable.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/class-use/Update.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/class-use/Updater.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/Input.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/PID.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/Toggleable.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/TuneablePID.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Input.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/PID.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Toggleable.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/TuneablePID.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/Angle.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/Polar.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/Vector.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/XY.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Angle.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Polar.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Vector.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/class-use/XY.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/vector/package-use.html create mode 100644 docs/javadoc/overview-frame.html create mode 100644 docs/javadoc/overview-summary.html create mode 100644 docs/javadoc/overview-tree.html create mode 100644 docs/javadoc/package-list create mode 100644 docs/javadoc/script.js create mode 100644 docs/javadoc/stylesheet.css create mode 100644 docs/readme.md diff --git a/.idea/misc.xml b/.idea/misc.xml index 2a6099a..65dab8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,22 +1,10 @@ - diff --git a/.idea/modules/Alloy_main.iml b/.idea/modules/Alloy_main.iml index ff3d097..795b244 100644 --- a/.idea/modules/Alloy_main.iml +++ b/.idea/modules/Alloy_main.iml @@ -1,24 +1,4 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/Alloy_test.iml b/.idea/modules/Alloy_test.iml index 2fc9ec6..cae3221 100644 --- a/.idea/modules/Alloy_test.iml +++ b/.idea/modules/Alloy_test.iml @@ -1,25 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/javadoc/allclasses-frame.html b/docs/javadoc/allclasses-frame.html new file mode 100644 index 0000000..9719412 --- /dev/null +++ b/docs/javadoc/allclasses-frame.html @@ -0,0 +1,52 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/docs/javadoc/allclasses-noframe.html b/docs/javadoc/allclasses-noframe.html new file mode 100644 index 0000000..3dfc0de --- /dev/null +++ b/docs/javadoc/allclasses-noframe.html @@ -0,0 +1,52 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/docs/javadoc/constant-values.html b/docs/javadoc/constant-values.html new file mode 100644 index 0000000..85e7268 --- /dev/null +++ b/docs/javadoc/constant-values.html @@ -0,0 +1,124 @@ + + + + + +Constant Field Values + + + + + + + + +
+ + + + + + + +
+ + +
+

Constant Field Values

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/deprecated-list.html b/docs/javadoc/deprecated-list.html new file mode 100644 index 0000000..a64be8f --- /dev/null +++ b/docs/javadoc/deprecated-list.html @@ -0,0 +1,124 @@ + + + + + +Deprecated List + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/help-doc.html b/docs/javadoc/help-doc.html new file mode 100644 index 0000000..8b75052 --- /dev/null +++ b/docs/javadoc/help-doc.html @@ -0,0 +1,229 @@ + + + + + +API Help + + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-1.html b/docs/javadoc/index-files/index-1.html new file mode 100644 index 0000000..ef83dbf --- /dev/null +++ b/docs/javadoc/index-files/index-1.html @@ -0,0 +1,177 @@ + + + + + +A-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

A

+
+
add(Vector) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Adds two vectors together and returns the result
+
+
add(Vector) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Adds two vectors together and returns the result
+
+
add(Vector) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Adds two vectors together and returns the result
+
+
addState(State) - Method in class org.montclairrobotics.alloy.auto.StateMachine
+
 
+
Alloy - Class in org.montclairrobotics.alloy.core
+
+
Created by MHS Robotics on 11/13/2017.
+
+
Alloy() - Constructor for class org.montclairrobotics.alloy.core.Alloy
+
 
+
AlloyAutonomous - Class in org.montclairrobotics.alloy.auto
+
+
Created by MHS Robotics on 12/5/2017.
+
+
AlloyAutonomous() - Constructor for class org.montclairrobotics.alloy.auto.AlloyAutonomous
+
 
+
Angle - Class in org.montclairrobotics.alloy.vector
+
+
Created by MHS Robotics on 11/13/2017.
+
+
Angle(Angle.AngleMeasure, double) - Constructor for class org.montclairrobotics.alloy.vector.Angle
+
+
Creating a new angle with an angle measure unit and the measure of the angle itself
+
+
Angle(double) - Constructor for class org.montclairrobotics.alloy.vector.Angle
+
+
Creating an angle with degrees
+
+
angleBetween(Vector) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
gets the angle between two vectors
+
+
angleBetween(Vector) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
gets the angle between two vectors
+
+
angleBetween(Vector) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
gets the angle between two vectors
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-10.html b/docs/javadoc/index-files/index-10.html new file mode 100644 index 0000000..0d83334 --- /dev/null +++ b/docs/javadoc/index-files/index-10.html @@ -0,0 +1,131 @@ + + + + + +J-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

J

+
+
Joystick - Interface in org.montclairrobotics.alloy.core
+
+
Created by MHS Robotics on 11/14/2017.
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-11.html b/docs/javadoc/index-files/index-11.html new file mode 100644 index 0000000..a7d06d6 --- /dev/null +++ b/docs/javadoc/index-files/index-11.html @@ -0,0 +1,137 @@ + + + + + +L-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

L

+
+
log(String, Object) - Method in interface org.montclairrobotics.alloy.core.Debug
+
+
Debugs a value with a Key(Identifier)
+
+
log(String, Object) - Method in class org.montclairrobotics.alloy.ftc.FTCDebug
+
 
+
loop() - Method in class org.montclairrobotics.alloy.auto.AlloyAutonomous
+
 
+
loop() - Method in class org.montclairrobotics.alloy.core.Alloy
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-12.html b/docs/javadoc/index-files/index-12.html new file mode 100644 index 0000000..eee2391 --- /dev/null +++ b/docs/javadoc/index-files/index-12.html @@ -0,0 +1,143 @@ + + + + + +M-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

M

+
+
map() - Method in interface org.montclairrobotics.alloy.drive.DTMapper
+
 
+
Mode - Enum in org.montclairrobotics.alloy.core
+
+
Created by MHS Robotics on 11/14/2017.
+
+
Motor - Interface in org.montclairrobotics.alloy.core
+
+
Created by MHS Robotics on 11/13/2017.
+
+
msg(Object) - Method in interface org.montclairrobotics.alloy.core.Debug
+
+
Debugs any value or message(note) to the user with a default key
+
+
msg(Object) - Method in class org.montclairrobotics.alloy.ftc.FTCDebug
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-13.html b/docs/javadoc/index-files/index-13.html new file mode 100644 index 0000000..dab611d --- /dev/null +++ b/docs/javadoc/index-files/index-13.html @@ -0,0 +1,139 @@ + + + + + +N-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

N

+
+
normalize() - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Normalizes a vector and returns the result
+
+
normalize() - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Normalizes a vector and returns the result
+
+
normalize() - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Normalizes a vector and returns the result
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-14.html b/docs/javadoc/index-files/index-14.html new file mode 100644 index 0000000..4266be2 --- /dev/null +++ b/docs/javadoc/index-files/index-14.html @@ -0,0 +1,161 @@ + + + + + +O-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

O

+
+
onPressed() - Method in class org.montclairrobotics.alloy.control.ButtonAction
+
+
On pressed is called once, when the button goes from being unpressed, to pressed
+
+
onPressed() - Method in class org.montclairrobotics.alloy.control.ToggleButton
+
+
On pressed is called once, when the button goes from being unpressed, to pressed
+
+
onReleased() - Method in class org.montclairrobotics.alloy.control.ButtonAction
+
+
On released is called once, when the button goes from being pressed, to unpressed
+
+
onReleased() - Method in class org.montclairrobotics.alloy.control.ToggleButton
+
+
On released is called once, when the button goes from being pressed, to unpressed
+
+
org.montclairrobotics.alloy.auto - package org.montclairrobotics.alloy.auto
+
 
+
org.montclairrobotics.alloy.control - package org.montclairrobotics.alloy.control
+
 
+
org.montclairrobotics.alloy.core - package org.montclairrobotics.alloy.core
+
 
+
org.montclairrobotics.alloy.drive - package org.montclairrobotics.alloy.drive
+
 
+
org.montclairrobotics.alloy.ftc - package org.montclairrobotics.alloy.ftc
+
 
+
org.montclairrobotics.alloy.test - package org.montclairrobotics.alloy.test
+
 
+
org.montclairrobotics.alloy.update - package org.montclairrobotics.alloy.update
+
 
+
org.montclairrobotics.alloy.utils - package org.montclairrobotics.alloy.utils
+
 
+
org.montclairrobotics.alloy.vector - package org.montclairrobotics.alloy.vector
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-15.html b/docs/javadoc/index-files/index-15.html new file mode 100644 index 0000000..820e912 --- /dev/null +++ b/docs/javadoc/index-files/index-15.html @@ -0,0 +1,153 @@ + + + + + +P-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

P

+
+
periodic() - Method in class org.montclairrobotics.alloy.core.Alloy
+
+
Although most of the periodic actions are taken care by the updater, the user may want to add + their own methods and code that need to be updated or run periodically, this can be done in + the periodic() method periodic will be run every loop.
+
+
periodic() - Method in class org.montclairrobotics.alloy.test.TestRobot
+
 
+
PID - Class in org.montclairrobotics.alloy.utils
+
+
Created by Montclair robotics on 2/27/2018
+
+
PID(double, double, double) - Constructor for class org.montclairrobotics.alloy.utils.PID
+
+
Create a new PID
+
+
PID(double, double, double, Input<Double>, double) - Constructor for class org.montclairrobotics.alloy.utils.PID
+
+
Create a new PID with the input and target defined
+
+
Polar - Class in org.montclairrobotics.alloy.vector
+
+
Created by MHS Robotics on 11/14/2017.
+
+
Polar(double, Angle) - Constructor for class org.montclairrobotics.alloy.vector.Polar
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-16.html b/docs/javadoc/index-files/index-16.html new file mode 100644 index 0000000..b2c54a0 --- /dev/null +++ b/docs/javadoc/index-files/index-16.html @@ -0,0 +1,162 @@ + + + + + +R-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

R

+
+
registerUpdatables() - Static method in class org.montclairrobotics.alloy.update.Updater
+
 
+
RobotCore - Class in org.montclairrobotics.alloy.core
+
+
Created by MHS Robotics on 12/5/2017.
+
+
RobotCore(Telemetry, HardwareMap, Gamepad, Gamepad) - Constructor for class org.montclairrobotics.alloy.core.RobotCore
+
 
+
robotSetup() - Method in class org.montclairrobotics.alloy.core.Alloy
+
+
The robotSetup is where all code specific to robot setup is placed If you only have one + teleop this can be done in the initialization Method.
+
+
robotSetup() - Method in class org.montclairrobotics.alloy.test.TestRobot
+
 
+
rotate(Angle) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
returns a vector rotated by a given angle
+
+
rotate(Angle) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
returns a vector rotated by a given angle
+
+
rotate(Angle) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
returns a vector rotated by a given angle
+
+
run() - Method in class org.montclairrobotics.alloy.auto.State
+
+
The run method is called every loop while the state is running
+
+
run() - Method in class org.montclairrobotics.alloy.auto.StateMachine
+
 
+
run() - Method in class org.montclairrobotics.alloy.update.Updatable
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-17.html b/docs/javadoc/index-files/index-17.html new file mode 100644 index 0000000..07e4c9f --- /dev/null +++ b/docs/javadoc/index-files/index-17.html @@ -0,0 +1,279 @@ + + + + + +S-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

S

+
+
scale(double) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Scales the vectors magnitude by a scalar value
+
+
scale(double) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Scales the vectors magnitude by a scalar value
+
+
scale(double) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Scales the vectors magnitude by a scalar value
+
+
setAngle(Angle) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Sets the angle in standard position of the vector
+
+
setAngle(Angle) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Sets the angle in standard position of the vector
+
+
setAngle(Angle) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Sets the angle in standard position of the vector
+
+
setDegrees(double) - Method in class org.montclairrobotics.alloy.vector.Angle
+
+
set the angle in degrees
+
+
setInput(Input<Double>) - Method in class org.montclairrobotics.alloy.utils.PID
+
 
+
setInverted(boolean) - Method in interface org.montclairrobotics.alloy.core.Motor
+
+
Sets weather the motor runs the default way , or inverted
+
+
setInverted(boolean) - Method in class org.montclairrobotics.alloy.ftc.FTCMotor
+
+
Sets weather the motor runs the default way , or inverted
+
+
setMagnitude(double) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Sets the magnitude of the vector
+
+
setMagnitude(double) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Sets the magnitude of the vector
+
+
setMagnitude(double) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Sets the magnitude of the vector
+
+
setMotorPower(double) - Method in interface org.montclairrobotics.alloy.core.Motor
+
+
Sets the motor Power
+
+
setMotorPower(double) - Method in class org.montclairrobotics.alloy.ftc.FTCMotor
+
+
Sets the motor Power
+
+
setPID(PID) - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
+
Set the motor to run using a custom PID
+
+
setPosition(int) - Method in interface org.montclairrobotics.alloy.core.TargetMotor
+
+
Sets the motor position
+
+
setPosition(int) - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
+
Sets the motor position
+
+
setRadians(double) - Method in class org.montclairrobotics.alloy.vector.Angle
+
+
set the angle in radians
+
+
setTarget(double) - Method in class org.montclairrobotics.alloy.utils.PID
+
 
+
setTargetPower(double) - Method in interface org.montclairrobotics.alloy.core.TargetMotor
+
+
Sets the motor Power
+
+
setTargetPower(double) - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
+
Sets the motor Power
+
+
setX(double) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Sets the x component of the vector
+
+
setX(double) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Sets the x component of the vector
+
+
setX(double) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Sets the x component of the vector
+
+
setY(double) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Sets the y component of the vector
+
+
setY(double) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Sets the y component of the vector
+
+
setY(double) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Sets the y component of the vector
+
+
Shooter - Class in org.montclairrobotics.alloy.test
+
 
+
Shooter() - Constructor for class org.montclairrobotics.alloy.test.Shooter
+
 
+
sin() - Method in class org.montclairrobotics.alloy.vector.Angle
+
+
get the sine of the angle
+
+
start() - Method in class org.montclairrobotics.alloy.auto.State
+
+
The start method is the first thing called when the state is run
+
+
start() - Method in class org.montclairrobotics.alloy.auto.StateMachine
+
 
+
State - Class in org.montclairrobotics.alloy.auto
+
+
Created by MHS Robotics on 12/16/2017.
+
+
State() - Constructor for class org.montclairrobotics.alloy.auto.State
+
 
+
StateMachine - Class in org.montclairrobotics.alloy.auto
+
+
Created by MHS Robotics on 12/16/2017.
+
+
StateMachine(State...) - Constructor for class org.montclairrobotics.alloy.auto.StateMachine
+
 
+
stop() - Method in class org.montclairrobotics.alloy.auto.State
+
+
The Stop method is the last thing called once the state is done
+
+
stop() - Method in class org.montclairrobotics.alloy.auto.StateMachine
+
 
+
subtract(Vector) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Subtracts a vector and returns the result
+
+
subtract(Vector) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Subtracts a vector and returns the result
+
+
subtract(Vector) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Subtracts a vector and returns the result
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-18.html b/docs/javadoc/index-files/index-18.html new file mode 100644 index 0000000..3a38f81 --- /dev/null +++ b/docs/javadoc/index-files/index-18.html @@ -0,0 +1,165 @@ + + + + + +T-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

T

+
+
tan() - Method in class org.montclairrobotics.alloy.vector.Angle
+
+
get the tangent of the angle
+
+
TargetMotor - Interface in org.montclairrobotics.alloy.core
+
+
Target motor is a motor interface for motors that have encoders.
+
+
telemetry - Static variable in class org.montclairrobotics.alloy.core.RobotCore
+
+
Telemetry is used for reading out information on the phones and is useful for debugging, The + telemetry is also used in Debug
+
+
TestRobot - Class in org.montclairrobotics.alloy.test
+
 
+
TestRobot() - Constructor for class org.montclairrobotics.alloy.test.TestRobot
+
 
+
toggle() - Method in class org.montclairrobotics.alloy.utils.Toggleable
+
+
Switches(Toggles), between the two states, If the toggleable is disabled, enable it If the + toggleable is enabled, disable it
+
+
Toggleable - Class in org.montclairrobotics.alloy.utils
+
+
Created by MHS Robotics on 2/11/2018.
+
+
Toggleable() - Constructor for class org.montclairrobotics.alloy.utils.Toggleable
+
 
+
ToggleButton - Class in org.montclairrobotics.alloy.control
+
+
Created by MHS Robotics on 2/11/2018.
+
+
ToggleButton(Button, Toggleable) - Constructor for class org.montclairrobotics.alloy.control.ToggleButton
+
 
+
TuneablePID - Class in org.montclairrobotics.alloy.utils
+
 
+
TuneablePID() - Constructor for class org.montclairrobotics.alloy.utils.TuneablePID
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-19.html b/docs/javadoc/index-files/index-19.html new file mode 100644 index 0000000..9ffa376 --- /dev/null +++ b/docs/javadoc/index-files/index-19.html @@ -0,0 +1,152 @@ + + + + + +U-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

U

+
+
Updatable - Class in org.montclairrobotics.alloy.update
+
+
Created by MHS Robotics on 2/11/2018.
+
+
update() - Method in class org.montclairrobotics.alloy.control.ButtonAction
+
 
+
update() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
+
If the mode is custom, then the update method will set the motor power using the custom PID
+
+
Update - Annotation Type in org.montclairrobotics.alloy.update
+
 
+
update() - Static method in class org.montclairrobotics.alloy.update.Updater
+
 
+
update() - Method in class org.montclairrobotics.alloy.utils.PID
+
+
The update method should be defined for every updatable, and is called every loop if added to + the updater
+
+
Updater - Class in org.montclairrobotics.alloy.update
+
+
Created by MHS Robotics on 12/5/2017.
+
+
Updater() - Constructor for class org.montclairrobotics.alloy.update.Updater
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-2.html b/docs/javadoc/index-files/index-2.html new file mode 100644 index 0000000..b9da2ff --- /dev/null +++ b/docs/javadoc/index-files/index-2.html @@ -0,0 +1,139 @@ + + + + + +B-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

B

+
+
button - Variable in class org.montclairrobotics.alloy.control.ButtonAction
+
 
+
Button - Interface in org.montclairrobotics.alloy.core
+
+
Created by MHS Robotics on 11/13/2017.
+
+
ButtonAction - Class in org.montclairrobotics.alloy.control
+
+
Created by MHS Robotics on 2/11/2018.
+
+
ButtonAction(Button) - Constructor for class org.montclairrobotics.alloy.control.ButtonAction
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-20.html b/docs/javadoc/index-files/index-20.html new file mode 100644 index 0000000..b66554d --- /dev/null +++ b/docs/javadoc/index-files/index-20.html @@ -0,0 +1,149 @@ + + + + + +V-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

V

+
+
valueOf(String) - Static method in enum org.montclairrobotics.alloy.core.Mode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.montclairrobotics.alloy.ftc.FTCJoystick.Side
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum org.montclairrobotics.alloy.core.Mode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.montclairrobotics.alloy.ftc.FTCJoystick.Side
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
Vector - Interface in org.montclairrobotics.alloy.vector
+
+
Created by MHS Robotics on 11/14/2017.
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-21.html b/docs/javadoc/index-files/index-21.html new file mode 100644 index 0000000..d0910e9 --- /dev/null +++ b/docs/javadoc/index-files/index-21.html @@ -0,0 +1,145 @@ + + + + + +W-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

W

+
+
wasPressed - Variable in class org.montclairrobotics.alloy.control.ButtonAction
+
 
+
whilePressed() - Method in class org.montclairrobotics.alloy.control.ButtonAction
+
+
While pressed is called every loop while the button is pressed
+
+
whilePressed() - Method in class org.montclairrobotics.alloy.control.ToggleButton
+
+
While pressed is called every loop while the button is pressed
+
+
whileReleased() - Method in class org.montclairrobotics.alloy.control.ButtonAction
+
+
While released is called every loop while the button is unpressed
+
+
whileReleased() - Method in class org.montclairrobotics.alloy.control.ToggleButton
+
+
While released is called every loop while the button is unpressed
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-22.html b/docs/javadoc/index-files/index-22.html new file mode 100644 index 0000000..d06f0d8 --- /dev/null +++ b/docs/javadoc/index-files/index-22.html @@ -0,0 +1,135 @@ + + + + + +X-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

X

+
+
XY - Class in org.montclairrobotics.alloy.vector
+
+
Created by MHS Robotics on 11/14/2017.
+
+
XY(double, double) - Constructor for class org.montclairrobotics.alloy.vector.XY
+
 
+
XY(XY) - Constructor for class org.montclairrobotics.alloy.vector.XY
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-23.html b/docs/javadoc/index-files/index-23.html new file mode 100644 index 0000000..eaf7977 --- /dev/null +++ b/docs/javadoc/index-files/index-23.html @@ -0,0 +1,129 @@ + + + + + +Z-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

Z

+
+
ZERO - Variable in class org.montclairrobotics.alloy.vector.Angle
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-3.html b/docs/javadoc/index-files/index-3.html new file mode 100644 index 0000000..2af8faf --- /dev/null +++ b/docs/javadoc/index-files/index-3.html @@ -0,0 +1,155 @@ + + + + + +C-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

C

+
+
copy() - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Creates a copy of the vector
+
+
copy() - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Creates a copy of the vector
+
+
copy() - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Creates a copy of the vector
+
+
cos() - Method in class org.montclairrobotics.alloy.vector.Angle
+
+
get the cosine of the angle
+
+
cross(Vector) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Returns the product of two vectors that have been crossed
+
+
cross(Vector) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Returns the product of two vectors that have been crossed
+
+
cross(Vector) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Returns the product of two vectors that have been crossed
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-4.html b/docs/javadoc/index-files/index-4.html new file mode 100644 index 0000000..6ae4e43 --- /dev/null +++ b/docs/javadoc/index-files/index-4.html @@ -0,0 +1,167 @@ + + + + + +D-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

D

+
+
Debug - Interface in org.montclairrobotics.alloy.core
+
+
Created by MHS Robotics on 11/13/2017.
+
+
disable() - Method in class org.montclairrobotics.alloy.utils.Toggleable
+
+
Disables the toggleable
+
+
disableAction() - Method in class org.montclairrobotics.alloy.test.Shooter
+
 
+
disableAction() - Method in class org.montclairrobotics.alloy.utils.Toggleable
+
+
Method to be called when the toggleable is disabled
+
+
disablePID() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
+
Stop using the custom PID and return to using the default mode
+
+
dot(Vector) - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Returns the dot product of two vectors
+
+
dot(Vector) - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Returns the dot product of two vectors
+
+
dot(Vector) - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Returns the dot product of two vectors
+
+
DriveTrain - Class in org.montclairrobotics.alloy.drive
+
+
Created by MHS Robotics on 12/16/2017.
+
+
DriveTrain() - Constructor for class org.montclairrobotics.alloy.drive.DriveTrain
+
 
+
DTMapper - Interface in org.montclairrobotics.alloy.drive
+
+
Created by MHS Robotics on 12/16/2017.
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-5.html b/docs/javadoc/index-files/index-5.html new file mode 100644 index 0000000..d56f1d0 --- /dev/null +++ b/docs/javadoc/index-files/index-5.html @@ -0,0 +1,137 @@ + + + + + +E-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

E

+
+
enable() - Method in class org.montclairrobotics.alloy.utils.Toggleable
+
+
Enables the toggleable
+
+
enableAction() - Method in class org.montclairrobotics.alloy.test.Shooter
+
 
+
enableAction() - Method in class org.montclairrobotics.alloy.utils.Toggleable
+
+
Method to be called when the toggleable is enabled
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-6.html b/docs/javadoc/index-files/index-6.html new file mode 100644 index 0000000..b52beef --- /dev/null +++ b/docs/javadoc/index-files/index-6.html @@ -0,0 +1,161 @@ + + + + + +F-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

F

+
+
FTCButton - Class in org.montclairrobotics.alloy.ftc
+
+
Created by MHS Robotics on 11/14/2017.
+
+
FTCButton(Input<Boolean>) - Constructor for class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
FTCButton(Input<Boolean>, boolean) - Constructor for class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
FTCDebug - Class in org.montclairrobotics.alloy.ftc
+
+
Created by MHS Robotics on 11/14/2017.
+
+
FTCDebug() - Constructor for class org.montclairrobotics.alloy.ftc.FTCDebug
+
 
+
FTCJoystick - Class in org.montclairrobotics.alloy.ftc
+
+
Created by MHS Robotics on 11/14/2017.
+
+
FTCJoystick(Gamepad, FTCJoystick.Side) - Constructor for class org.montclairrobotics.alloy.ftc.FTCJoystick
+
 
+
FTCJoystick.Side - Enum in org.montclairrobotics.alloy.ftc
+
 
+
FTCMotor - Class in org.montclairrobotics.alloy.ftc
+
+
Created by MHS Robotics on 11/14/2017.
+
+
FTCMotor(String) - Constructor for class org.montclairrobotics.alloy.ftc.FTCMotor
+
 
+
FTCTargetMotor - Class in org.montclairrobotics.alloy.ftc
+
+
Created by MHS Robotics on 2/24/2018.
+
+
FTCTargetMotor(String) - Constructor for class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-7.html b/docs/javadoc/index-files/index-7.html new file mode 100644 index 0000000..1869dee --- /dev/null +++ b/docs/javadoc/index-files/index-7.html @@ -0,0 +1,291 @@ + + + + + +G-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

G

+
+
gamepad1 - Static variable in class org.montclairrobotics.alloy.core.RobotCore
+
+
The first gamepad, generated by pressing start + 'a' on the controller
+
+
gamepad2 - Static variable in class org.montclairrobotics.alloy.core.RobotCore
+
+
The second gamepad, generated by pressing start + 'b' on the controller
+
+
get() - Method in interface org.montclairrobotics.alloy.utils.Input
+
 
+
get() - Method in class org.montclairrobotics.alloy.utils.PID
+
 
+
getAButton(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getAngle() - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Gets the angle in standard position that the vector makes
+
+
getAngle() - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Gets the angle in standard position that the vector makes
+
+
getAngle() - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Gets the angle in standard position that the vector makes
+
+
getBButton(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getDegrees() - Method in class org.montclairrobotics.alloy.vector.Angle
+
+
Get the angle measure in degrees
+
+
getDPADDown(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getDPADLeft(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getDPADUp(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getGamepad1() - Static method in class org.montclairrobotics.alloy.core.RobotCore
+
+
Gets the first gamepad
+
+
getGamepad2() - Static method in class org.montclairrobotics.alloy.core.RobotCore
+
+
Gets the second gamepad
+
+
getHardwareMap() - Static method in class org.montclairrobotics.alloy.core.RobotCore
+
+
Gets the hardware map of the robot
+
+
getInverted() - Method in interface org.montclairrobotics.alloy.core.Motor
+
+
Gets weather the motor is inverted
+
+
getInverted() - Method in class org.montclairrobotics.alloy.ftc.FTCMotor
+
+
Gets weather the motor is inverted
+
+
getLeftBumper(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getLeftTrigger(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getManitude() - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Gets the magnitude of the vector
+
+
getManitude() - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Gets the magnitude of the vector
+
+
getManitude() - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Gets the magnitude of the vector
+
+
getMotor() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
 
+
getMotorPower() - Method in interface org.montclairrobotics.alloy.core.Motor
+
+
Gets the motor power
+
+
getMotorPower() - Method in class org.montclairrobotics.alloy.ftc.FTCMotor
+
+
Gets the motor power
+
+
getNextState(int) - Method in class org.montclairrobotics.alloy.auto.State
+
 
+
getPid() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
 
+
getPosition() - Method in interface org.montclairrobotics.alloy.core.TargetMotor
+
+
Gets the motors position
+
+
getPosition() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
+
Gets the motors position
+
+
getRadians() - Method in class org.montclairrobotics.alloy.vector.Angle
+
+
Get the angle measure in radians
+
+
getRightBumper(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getRightTrigger(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getRunmode() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
+
NOTE: this is not the same as the DCMotor runmode
+
+
getTargetPower() - Method in interface org.montclairrobotics.alloy.core.TargetMotor
+
+
Gets the motor power
+
+
getTargetPower() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
+
Gets the motor power
+
+
getTelemetry() - Static method in class org.montclairrobotics.alloy.core.RobotCore
+
+
Gets the telemetry object of the robot
+
+
getUpdateRate() - Method in class org.montclairrobotics.alloy.update.Updatable
+
 
+
getValue() - Method in interface org.montclairrobotics.alloy.core.Button
+
+
Gets the value of a button
+
+
getValue() - Method in interface org.montclairrobotics.alloy.core.Joystick
+
+
Gets the position of the joystick
+
+
getValue() - Method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getValue() - Method in class org.montclairrobotics.alloy.ftc.FTCJoystick
+
 
+
getX() - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Gets the X component of the vector
+
+
getX() - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Gets the X component of the vector
+
+
getX() - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Gets the X component of the vector
+
+
getXButton(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getY() - Method in class org.montclairrobotics.alloy.vector.Polar
+
+
Gets the Y component of the vector
+
+
getY() - Method in interface org.montclairrobotics.alloy.vector.Vector
+
+
Gets the Y component of the vector
+
+
getY() - Method in class org.montclairrobotics.alloy.vector.XY
+
+
Gets the Y component of the vector
+
+
getYButton(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
getYDPADRight(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-8.html b/docs/javadoc/index-files/index-8.html new file mode 100644 index 0000000..22d2ebe --- /dev/null +++ b/docs/javadoc/index-files/index-8.html @@ -0,0 +1,132 @@ + + + + + +H-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

H

+
+
hardwareMap - Static variable in class org.montclairrobotics.alloy.core.RobotCore
+
+
The hardware map is essential to any robot and is how the ftc core interacts with the + hardware devices on the phones
+
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-9.html b/docs/javadoc/index-files/index-9.html new file mode 100644 index 0000000..92ac158 --- /dev/null +++ b/docs/javadoc/index-files/index-9.html @@ -0,0 +1,147 @@ + + + + + +I-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W X Z  + + +

I

+
+
init() - Method in class org.montclairrobotics.alloy.auto.AlloyAutonomous
+
 
+
init() - Method in class org.montclairrobotics.alloy.core.Alloy
+
 
+
initialization() - Method in class org.montclairrobotics.alloy.core.Alloy
+
+
The initialization method is were everything specific to the OpMode Should be set up.
+
+
initialization() - Method in class org.montclairrobotics.alloy.test.TestRobot
+
 
+
Input<T> - Interface in org.montclairrobotics.alloy.utils
+
+
Created by MHS Robotics on 2/2/2018.
+
+
isDone() - Method in class org.montclairrobotics.alloy.auto.State
+
+
IsDone should return true when the state is finished
+
+
isDone() - Method in class org.montclairrobotics.alloy.auto.StateMachine
+
 
+
+A B C D E F G H I J L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index.html b/docs/javadoc/index.html new file mode 100644 index 0000000..02909bb --- /dev/null +++ b/docs/javadoc/index.html @@ -0,0 +1,75 @@ + + + + + +Generated Documentation (Untitled) + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/AlloyAutonomous.html b/docs/javadoc/org/montclairrobotics/alloy/auto/AlloyAutonomous.html new file mode 100644 index 0000000..9b4d666 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/AlloyAutonomous.html @@ -0,0 +1,324 @@ + + + + + +AlloyAutonomous + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.auto
+

Class AlloyAutonomous

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.qualcomm.robotcore.eventloop.opmode.OpMode
    • +
    • +
        +
      • org.montclairrobotics.alloy.auto.AlloyAutonomous
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public abstract class AlloyAutonomous
    +extends com.qualcomm.robotcore.eventloop.opmode.OpMode
    +
    Created by MHS Robotics on 12/5/2017.
    +
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

        +gamepad1, gamepad2, hardwareMap, internalOpModeServices, msStuckDetectInit, msStuckDetectInitLoop, msStuckDetectLoop, msStuckDetectStart, msStuckDetectStop, telemetry, time
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      AlloyAutonomous() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidinit() 
      voidloop() 
      +
        +
      • + + +

        Methods inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

        +getRuntime, init_loop, internalPostInitLoop, internalPostLoop, internalPreInit, internalUpdateTelemetryNow, requestOpModeStop, resetStartTime, start, stop, updateTelemetry
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AlloyAutonomous

        +
        public AlloyAutonomous()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        init

        +
        public void init()
        +
        +
        Specified by:
        +
        init in class com.qualcomm.robotcore.eventloop.opmode.OpMode
        +
        +
      • +
      + + + +
        +
      • +

        loop

        +
        public void loop()
        +
        +
        Specified by:
        +
        loop in class com.qualcomm.robotcore.eventloop.opmode.OpMode
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/State.html b/docs/javadoc/org/montclairrobotics/alloy/auto/State.html new file mode 100644 index 0000000..13a8028 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/State.html @@ -0,0 +1,358 @@ + + + + + +State + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.auto
+

Class State

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.auto.State
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    StateMachine
    +
    +
    +
    +
    public abstract class State
    +extends java.lang.Object
    +
    Created by MHS Robotics on 12/16/2017. + +

    States are designed to be passed in and run in a state machine. States can be used for + Autonomous modes as well as autonomously doing actions in teleop.

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    See Also:
    +
    StateMachine, +AlloyAutonomous
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      State() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intgetNextState(int currentState) 
      abstract booleanisDone() +
      IsDone should return true when the state is finished
      +
      abstract voidrun() +
      The run method is called every loop while the state is running
      +
      abstract voidstart() +
      The start method is the first thing called when the state is run
      +
      abstract voidstop() +
      The Stop method is the last thing called once the state is done
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        State

        +
        public State()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public abstract void start()
        +
        The start method is the first thing called when the state is run
        +
      • +
      + + + +
        +
      • +

        run

        +
        public abstract void run()
        +
        The run method is called every loop while the state is running
        +
      • +
      + + + +
        +
      • +

        stop

        +
        public abstract void stop()
        +
        The Stop method is the last thing called once the state is done
        +
      • +
      + + + +
        +
      • +

        isDone

        +
        public abstract boolean isDone()
        +
        IsDone should return true when the state is finished
        +
        +
        Returns:
        +
        true if the state is done
        +
        +
      • +
      + + + +
        +
      • +

        getNextState

        +
        public int getNextState(int currentState)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/StateMachine.html b/docs/javadoc/org/montclairrobotics/alloy/auto/StateMachine.html new file mode 100644 index 0000000..c2d926b --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/StateMachine.html @@ -0,0 +1,382 @@ + + + + + +StateMachine + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.auto
+

Class StateMachine

+
+
+ +
+
    +
  • +
    +
    +
    public class StateMachine
    +extends State
    +
    Created by MHS Robotics on 12/16/2017. + +

    A state machine takes in states and runs them in a controlled order.
    + By default the states will run in a linear fashion and the next state will start when the + previous state has finished.
    +
    + State machines can be used for controlling auto modes, but can also be ran in teleop modes for + pre coded instructions that make driving easier.

    +
    +
    Since:
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      StateMachine(State... states) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddState(State state) 
      booleanisDone() +
      IsDone should return true when the state is finished
      +
      voidrun() +
      The run method is called every loop while the state is running
      +
      voidstart() +
      The start method is the first thing called when the state is run
      +
      voidstop() +
      The Stop method is the last thing called once the state is done
      +
      + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        StateMachine

        +
        public StateMachine(State... states)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public void start()
        +
        Description copied from class: State
        +
        The start method is the first thing called when the state is run
        +
        +
        Specified by:
        +
        start in class State
        +
        +
      • +
      + + + +
        +
      • +

        run

        +
        public void run()
        +
        Description copied from class: State
        +
        The run method is called every loop while the state is running
        +
        +
        Specified by:
        +
        run in class State
        +
        +
      • +
      + + + +
        +
      • +

        stop

        +
        public void stop()
        +
        Description copied from class: State
        +
        The Stop method is the last thing called once the state is done
        +
        +
        Specified by:
        +
        stop in class State
        +
        +
      • +
      + + + +
        +
      • +

        isDone

        +
        public boolean isDone()
        +
        Description copied from class: State
        +
        IsDone should return true when the state is finished
        +
        +
        Specified by:
        +
        isDone in class State
        +
        Returns:
        +
        true if the state is done
        +
        +
      • +
      + + + +
        +
      • +

        addState

        +
        public void addState(State state)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/AlloyAutonomous.html b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/AlloyAutonomous.html new file mode 100644 index 0000000..03b7bf4 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/AlloyAutonomous.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.auto.AlloyAutonomous + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.auto.AlloyAutonomous

+
+
No usage of org.montclairrobotics.alloy.auto.AlloyAutonomous
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/State.html b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/State.html new file mode 100644 index 0000000..73834b9 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/State.html @@ -0,0 +1,190 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.auto.State + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.auto.State

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/StateMachine.html b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/StateMachine.html new file mode 100644 index 0000000..14222a9 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/StateMachine.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.auto.StateMachine + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.auto.StateMachine

+
+
No usage of org.montclairrobotics.alloy.auto.StateMachine
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/auto/package-frame.html new file mode 100644 index 0000000..5cb0502 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/package-frame.html @@ -0,0 +1,22 @@ + + + + + +org.montclairrobotics.alloy.auto + + + + + +

org.montclairrobotics.alloy.auto

+ + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/auto/package-summary.html new file mode 100644 index 0000000..aacbc03 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/package-summary.html @@ -0,0 +1,156 @@ + + + + + +org.montclairrobotics.alloy.auto + + + + + + + + + + + +
+

Package org.montclairrobotics.alloy.auto

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    AlloyAutonomous +
    Created by MHS Robotics on 12/5/2017.
    +
    State +
    Created by MHS Robotics on 12/16/2017.
    +
    StateMachine +
    Created by MHS Robotics on 12/16/2017.
    +
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/package-tree.html b/docs/javadoc/org/montclairrobotics/alloy/auto/package-tree.html new file mode 100644 index 0000000..0749515 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/package-tree.html @@ -0,0 +1,146 @@ + + + + + +org.montclairrobotics.alloy.auto Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.montclairrobotics.alloy.auto

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.qualcomm.robotcore.eventloop.opmode.OpMode + +
    • +
    • org.montclairrobotics.alloy.auto.State + +
    • +
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/package-use.html b/docs/javadoc/org/montclairrobotics/alloy/auto/package-use.html new file mode 100644 index 0000000..1324ed2 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/package-use.html @@ -0,0 +1,159 @@ + + + + + +Uses of Package org.montclairrobotics.alloy.auto + + + + + + + + + + + +
+

Uses of Package
org.montclairrobotics.alloy.auto

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/control/ButtonAction.html b/docs/javadoc/org/montclairrobotics/alloy/control/ButtonAction.html new file mode 100644 index 0000000..82bb76c --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/control/ButtonAction.html @@ -0,0 +1,398 @@ + + + + + +ButtonAction + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.control
+

Class ButtonAction

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.control.ButtonAction
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    ToggleButton
    +
    +
    +
    +
    public abstract class ButtonAction
    +extends java.lang.Object
    +
    Created by MHS Robotics on 2/11/2018. + +

    Every Button action is tied to a button, and controls what happens when the button is pressed, + held, unpressed, and released

    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      Buttonbutton 
      booleanwasPressed 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      ButtonAction(Button button) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      abstract voidonPressed() +
      On pressed is called once, when the button goes from being unpressed, to pressed
      +
      abstract voidonReleased() +
      On released is called once, when the button goes from being pressed, to unpressed
      +
      voidupdate() 
      abstract voidwhilePressed() +
      While pressed is called every loop while the button is pressed
      +
      abstract voidwhileReleased() +
      While released is called every loop while the button is unpressed
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        button

        +
        public Button button
        +
      • +
      + + + +
        +
      • +

        wasPressed

        +
        public boolean wasPressed
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ButtonAction

        +
        public ButtonAction(Button button)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        onPressed

        +
        public abstract void onPressed()
        +
        On pressed is called once, when the button goes from being unpressed, to pressed
        +
      • +
      + + + +
        +
      • +

        onReleased

        +
        public abstract void onReleased()
        +
        On released is called once, when the button goes from being pressed, to unpressed
        +
      • +
      + + + +
        +
      • +

        whilePressed

        +
        public abstract void whilePressed()
        +
        While pressed is called every loop while the button is pressed
        +
      • +
      + + + +
        +
      • +

        whileReleased

        +
        public abstract void whileReleased()
        +
        While released is called every loop while the button is unpressed
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/control/ToggleButton.html b/docs/javadoc/org/montclairrobotics/alloy/control/ToggleButton.html new file mode 100644 index 0000000..926e752 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/control/ToggleButton.html @@ -0,0 +1,380 @@ + + + + + +ToggleButton + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.control
+

Class ToggleButton

+
+
+ +
+
    +
  • +
    +
    +
    public class ToggleButton
    +extends ButtonAction
    +
    Created by MHS Robotics on 2/11/2018. + +

    A ToggleButton is tied to a button and a toggleable, when the button is pressed the toggleable + will toggle between states

    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    See Also:
    +
    Toggleable, +ButtonAction
    +
    +
  • +
+
+
+
    +
  • + + + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidonPressed() +
      On pressed is called once, when the button goes from being unpressed, to pressed
      +
      voidonReleased() +
      On released is called once, when the button goes from being pressed, to unpressed
      +
      voidwhilePressed() +
      While pressed is called every loop while the button is pressed
      +
      voidwhileReleased() +
      While released is called every loop while the button is unpressed
      +
      + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ToggleButton

        +
        public ToggleButton(Button button,
        +                    Toggleable toggleable)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        onPressed

        +
        public void onPressed()
        +
        On pressed is called once, when the button goes from being unpressed, to pressed
        +
        +
        Specified by:
        +
        onPressed in class ButtonAction
        +
        +
      • +
      + + + +
        +
      • +

        onReleased

        +
        public void onReleased()
        +
        On released is called once, when the button goes from being pressed, to unpressed
        +
        +
        Specified by:
        +
        onReleased in class ButtonAction
        +
        +
      • +
      + + + +
        +
      • +

        whilePressed

        +
        public void whilePressed()
        +
        While pressed is called every loop while the button is pressed
        +
        +
        Specified by:
        +
        whilePressed in class ButtonAction
        +
        +
      • +
      + + + +
        +
      • +

        whileReleased

        +
        public void whileReleased()
        +
        While released is called every loop while the button is unpressed
        +
        +
        Specified by:
        +
        whileReleased in class ButtonAction
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/control/class-use/ButtonAction.html b/docs/javadoc/org/montclairrobotics/alloy/control/class-use/ButtonAction.html new file mode 100644 index 0000000..956c80a --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/control/class-use/ButtonAction.html @@ -0,0 +1,166 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.control.ButtonAction + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.control.ButtonAction

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/control/class-use/ToggleButton.html b/docs/javadoc/org/montclairrobotics/alloy/control/class-use/ToggleButton.html new file mode 100644 index 0000000..15465b3 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/control/class-use/ToggleButton.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.control.ToggleButton + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.control.ToggleButton

+
+
No usage of org.montclairrobotics.alloy.control.ToggleButton
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/control/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/control/package-frame.html new file mode 100644 index 0000000..af5056b --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/control/package-frame.html @@ -0,0 +1,21 @@ + + + + + +org.montclairrobotics.alloy.control + + + + + +

org.montclairrobotics.alloy.control

+
+

Classes

+ +
+ + diff --git a/docs/javadoc/org/montclairrobotics/alloy/control/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/control/package-summary.html new file mode 100644 index 0000000..56e39d6 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/control/package-summary.html @@ -0,0 +1,150 @@ + + + + + +org.montclairrobotics.alloy.control + + + + + + + + + + + +
+

Package org.montclairrobotics.alloy.control

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ButtonAction +
    Created by MHS Robotics on 2/11/2018.
    +
    ToggleButton +
    Created by MHS Robotics on 2/11/2018.
    +
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/control/package-tree.html b/docs/javadoc/org/montclairrobotics/alloy/control/package-tree.html new file mode 100644 index 0000000..77391b5 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/control/package-tree.html @@ -0,0 +1,141 @@ + + + + + +org.montclairrobotics.alloy.control Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.montclairrobotics.alloy.control

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/control/package-use.html b/docs/javadoc/org/montclairrobotics/alloy/control/package-use.html new file mode 100644 index 0000000..d36a84e --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/control/package-use.html @@ -0,0 +1,159 @@ + + + + + +Uses of Package org.montclairrobotics.alloy.control + + + + + + + + + + + +
+

Uses of Package
org.montclairrobotics.alloy.control

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/Alloy.html b/docs/javadoc/org/montclairrobotics/alloy/core/Alloy.html new file mode 100644 index 0000000..7347fe6 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/Alloy.html @@ -0,0 +1,391 @@ + + + + + +Alloy + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.core
+

Class Alloy

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.qualcomm.robotcore.eventloop.opmode.OpMode
    • +
    • +
        +
      • org.montclairrobotics.alloy.core.Alloy
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    TestRobot
    +
    +
    +
    +
    public abstract class Alloy
    +extends com.qualcomm.robotcore.eventloop.opmode.OpMode
    +
    Created by MHS Robotics on 11/13/2017. + +

    The main purpose behind the alloy class is to controll how and when all of the mehotds in + Robot are run as well as initialize all global variables

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

        +gamepad1, gamepad2, hardwareMap, internalOpModeServices, msStuckDetectInit, msStuckDetectInitLoop, msStuckDetectLoop, msStuckDetectStart, msStuckDetectStop, telemetry, time
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Alloy() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidinit() 
      abstract voidinitialization() +
      The initialization method is were everything specific to the OpMode Should be set up.
      +
      voidloop() 
      abstract voidperiodic() +
      Although most of the periodic actions are taken care by the updater, the user may want to add + their own methods and code that need to be updated or run periodically, this can be done in + the periodic() method periodic will be run every loop.
      +
      abstract voidrobotSetup() +
      The robotSetup is where all code specific to robot setup is placed If you only have one + teleop this can be done in the initialization Method.
      +
      +
        +
      • + + +

        Methods inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

        +getRuntime, init_loop, internalPostInitLoop, internalPostLoop, internalPreInit, internalUpdateTelemetryNow, requestOpModeStop, resetStartTime, start, stop, updateTelemetry
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Alloy

        +
        public Alloy()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        robotSetup

        +
        public abstract void robotSetup()
        +
        The robotSetup is where all code specific to robot setup is placed If you only have one + teleop this can be done in the initialization Method. robotSetup is called right after the + robot core is initialized
        +
      • +
      + + + +
        +
      • +

        initialization

        +
        public abstract void initialization()
        +
        The initialization method is were everything specific to the OpMode Should be set up. + Initialization will be the first thing called after The robot setup.
        +
      • +
      + + + +
        +
      • +

        periodic

        +
        public abstract void periodic()
        +
        Although most of the periodic actions are taken care by the updater, the user may want to add + their own methods and code that need to be updated or run periodically, this can be done in + the periodic() method periodic will be run every loop.
        +
      • +
      + + + +
        +
      • +

        init

        +
        public void init()
        +
        +
        Specified by:
        +
        init in class com.qualcomm.robotcore.eventloop.opmode.OpMode
        +
        +
      • +
      + + + +
        +
      • +

        loop

        +
        public void loop()
        +
        +
        Specified by:
        +
        loop in class com.qualcomm.robotcore.eventloop.opmode.OpMode
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/Button.html b/docs/javadoc/org/montclairrobotics/alloy/core/Button.html new file mode 100644 index 0000000..8866232 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/Button.html @@ -0,0 +1,244 @@ + + + + + +Button + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.core
+

Interface Button

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    FTCButton
    +
    +
    +
    +
    public interface Button
    +
    Created by MHS Robotics on 11/13/2017. + +

    The button interface is implemented in ftc button The user can get the value of the button, In + most cases this will be a Boolean (True if pressed, false if not),

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getValue

        +
        boolean getValue()
        +
        Gets the value of a button
        +
        +
        Returns:
        +
        returns the value of the button, in most case True(pressed) or False(unpressed)
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/Debug.html b/docs/javadoc/org/montclairrobotics/alloy/core/Debug.html new file mode 100644 index 0000000..b540542 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/Debug.html @@ -0,0 +1,268 @@ + + + + + +Debug + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.core
+

Interface Debug

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    FTCDebug
    +
    +
    +
    +
    public interface Debug
    +
    Created by MHS Robotics on 11/13/2017. + +

    Debugs are used for debugging information to the user In ftc the debugs use Telemetry to read + an output to the phone The debug allows for easier usage of the telemetry methods That are most + used for debugging.

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidlog(java.lang.String key, + java.lang.Object value) +
      Debugs a value with a Key(Identifier)
      +
      voidmsg(java.lang.Object value) +
      Debugs any value or message(note) to the user with a default key
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        log

        +
        void log(java.lang.String key,
        +         java.lang.Object value)
        +
        Debugs a value with a Key(Identifier)
        +
        +
        Parameters:
        +
        key - Name of the value
        +
        value - Value to be debugged
        +
        +
      • +
      + + + +
        +
      • +

        msg

        +
        void msg(java.lang.Object value)
        +
        Debugs any value or message(note) to the user with a default key
        +
        +
        Parameters:
        +
        value - Value to be debugged
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/Joystick.html b/docs/javadoc/org/montclairrobotics/alloy/core/Joystick.html new file mode 100644 index 0000000..16aeb55 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/Joystick.html @@ -0,0 +1,243 @@ + + + + + +Joystick + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.core
+

Interface Joystick

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    FTCJoystick
    +
    +
    +
    +
    public interface Joystick
    +
    Created by MHS Robotics on 11/14/2017. + +

    Joysticks should return a vector made up of the X and Y values of their position

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getValue

        +
        Vector getValue()
        +
        Gets the position of the joystick
        +
        +
        Returns:
        +
        a vector made up of the X and Y values of the Joysticks Position
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/Mode.html b/docs/javadoc/org/montclairrobotics/alloy/core/Mode.html new file mode 100644 index 0000000..04acd87 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/Mode.html @@ -0,0 +1,358 @@ + + + + + +Mode + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.core
+

Enum Mode

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<Mode>
    • +
    • +
        +
      • org.montclairrobotics.alloy.core.Mode
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Mode>
    +
    +
    +
    +
    public enum Mode
    +extends java.lang.Enum<Mode>
    +
    Created by MHS Robotics on 11/14/2017. + +

    Mode stores all the different run modes that a robot can run in

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      FTCAUTONOMOUS +
      ftc autonomous mode
      +
      FTCTELEOP +
      ftc Telemetry Operated Mode
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static ModevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static Mode[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        FTCTELEOP

        +
        public static final Mode FTCTELEOP
        +
        ftc Telemetry Operated Mode
        +
      • +
      + + + +
        +
      • +

        FTCAUTONOMOUS

        +
        public static final Mode FTCAUTONOMOUS
        +
        ftc autonomous mode
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Mode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Mode c : Mode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Mode valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/Motor.html b/docs/javadoc/org/montclairrobotics/alloy/core/Motor.html new file mode 100644 index 0000000..638fa35 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/Motor.html @@ -0,0 +1,305 @@ + + + + + +Motor + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.core
+

Interface Motor

+
+
+
+
    +
  • +
    +
    All Known Subinterfaces:
    +
    TargetMotor
    +
    +
    +
    All Known Implementing Classes:
    +
    FTCMotor, FTCTargetMotor
    +
    +
    +
    +
    public interface Motor
    +
    Created by MHS Robotics on 11/13/2017.
    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setMotorPower

        +
        void setMotorPower(double power)
        +
        Sets the motor Power
        +
        +
        Parameters:
        +
        power - the power that the motor will be set to (0-1 inclusive )
        +
        +
      • +
      + + + +
        +
      • +

        getMotorPower

        +
        double getMotorPower()
        +
        Gets the motor power
        +
        +
        Returns:
        +
        the current motor power, a value between (0-1)
        +
        +
      • +
      + + + +
        +
      • +

        setInverted

        +
        void setInverted(boolean inverted)
        +
        Sets weather the motor runs the default way , or inverted
        +
        +
        Parameters:
        +
        inverted - true for inverted, false for normal
        +
        +
      • +
      + + + +
        +
      • +

        getInverted

        +
        boolean getInverted()
        +
        Gets weather the motor is inverted
        +
        +
        Returns:
        +
        true if the motor is inverted
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/RobotCore.html b/docs/javadoc/org/montclairrobotics/alloy/core/RobotCore.html new file mode 100644 index 0000000..4d2a412 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/RobotCore.html @@ -0,0 +1,458 @@ + + + + + +RobotCore + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.core
+

Class RobotCore

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.core.RobotCore
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class RobotCore
    +extends java.lang.Object
    +
    Created by MHS Robotics on 12/5/2017. + +

    Since essential parts to the robots operation are stored in OpMode

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    See Also:
    +
    The robot core class creates static instances + of all of the essentail objects on initialization The actual objects are passed in in the + alloy class, +With this, the user can acess all of the objects throughout the project.
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static com.qualcomm.robotcore.hardware.Gamepadgamepad1 +
      The first gamepad, generated by pressing start + 'a' on the controller
      +
      static com.qualcomm.robotcore.hardware.Gamepadgamepad2 +
      The second gamepad, generated by pressing start + 'b' on the controller
      +
      static com.qualcomm.robotcore.hardware.HardwareMaphardwareMap +
      The hardware map is essential to any robot and is how the ftc core interacts with the + hardware devices on the phones
      +
      static org.firstinspires.ftc.robotcore.external.Telemetrytelemetry +
      Telemetry is used for reading out information on the phones and is useful for debugging, The + telemetry is also used in Debug
      +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      RobotCore(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, + com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, + com.qualcomm.robotcore.hardware.Gamepad gamepad1, + com.qualcomm.robotcore.hardware.Gamepad gamepad2) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static com.qualcomm.robotcore.hardware.GamepadgetGamepad1() +
      Gets the first gamepad
      +
      static com.qualcomm.robotcore.hardware.GamepadgetGamepad2() +
      Gets the second gamepad
      +
      static com.qualcomm.robotcore.hardware.HardwareMapgetHardwareMap() +
      Gets the hardware map of the robot
      +
      static org.firstinspires.ftc.robotcore.external.TelemetrygetTelemetry() +
      Gets the telemetry object of the robot
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        telemetry

        +
        public static org.firstinspires.ftc.robotcore.external.Telemetry telemetry
        +
        Telemetry is used for reading out information on the phones and is useful for debugging, The + telemetry is also used in Debug
        +
        +
        See Also:
        +
        Debug
        +
        +
      • +
      + + + +
        +
      • +

        hardwareMap

        +
        public static com.qualcomm.robotcore.hardware.HardwareMap hardwareMap
        +
        The hardware map is essential to any robot and is how the ftc core interacts with the + hardware devices on the phones
        +
      • +
      + + + +
        +
      • +

        gamepad1

        +
        public static com.qualcomm.robotcore.hardware.Gamepad gamepad1
        +
        The first gamepad, generated by pressing start + 'a' on the controller
        +
      • +
      + + + +
        +
      • +

        gamepad2

        +
        public static com.qualcomm.robotcore.hardware.Gamepad gamepad2
        +
        The second gamepad, generated by pressing start + 'b' on the controller
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RobotCore

        +
        public RobotCore(org.firstinspires.ftc.robotcore.external.Telemetry telemetry,
        +                 com.qualcomm.robotcore.hardware.HardwareMap hardwareMap,
        +                 com.qualcomm.robotcore.hardware.Gamepad gamepad1,
        +                 com.qualcomm.robotcore.hardware.Gamepad gamepad2)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getHardwareMap

        +
        public static com.qualcomm.robotcore.hardware.HardwareMap getHardwareMap()
        +
        Gets the hardware map of the robot
        +
        +
        Returns:
        +
        the hardware map
        +
        +
      • +
      + + + +
        +
      • +

        getTelemetry

        +
        public static org.firstinspires.ftc.robotcore.external.Telemetry getTelemetry()
        +                                                                       throws java.lang.NullPointerException
        +
        Gets the telemetry object of the robot
        +
        +
        Returns:
        +
        telemetry
        +
        Throws:
        +
        java.lang.NullPointerException
        +
        +
      • +
      + + + +
        +
      • +

        getGamepad1

        +
        public static com.qualcomm.robotcore.hardware.Gamepad getGamepad1()
        +
        Gets the first gamepad
        +
        +
        Returns:
        +
        gamepad1
        +
        +
      • +
      + + + +
        +
      • +

        getGamepad2

        +
        public static com.qualcomm.robotcore.hardware.Gamepad getGamepad2()
        +
        Gets the second gamepad
        +
        +
        Returns:
        +
        gamepad1
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/TargetMotor.html b/docs/javadoc/org/montclairrobotics/alloy/core/TargetMotor.html new file mode 100644 index 0000000..566465e --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/TargetMotor.html @@ -0,0 +1,306 @@ + + + + + +TargetMotor + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.core
+

Interface TargetMotor

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Motor
    +
    +
    +
    All Known Implementing Classes:
    +
    FTCTargetMotor
    +
    +
    +
    +
    public interface TargetMotor
    +extends Motor
    +
    Target motor is a motor interface for motors that have encoders. Target motors can set encoder + positions using PID control
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setTargetPower

        +
        void setTargetPower(double power)
        +
        Sets the motor Power
        +
        +
        Parameters:
        +
        power - the power that the motor will be set to (0-1 inclusive )
        +
        +
      • +
      + + + +
        +
      • +

        getTargetPower

        +
        double getTargetPower()
        +
        Gets the motor power
        +
        +
        Returns:
        +
        the current motor power, a value between (0-1)
        +
        +
      • +
      + + + +
        +
      • +

        setPosition

        +
        void setPosition(int position)
        +
        Sets the motor position
        +
        +
        Parameters:
        +
        position - the position the motor will be set to (in encoder ticks)
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        double getPosition()
        +
        Gets the motors position
        +
        +
        Returns:
        +
        the position that the motor is at (in encoder ticks)
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Alloy.html b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Alloy.html new file mode 100644 index 0000000..bb50b54 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Alloy.html @@ -0,0 +1,164 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.core.Alloy + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.core.Alloy

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Button.html b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Button.html new file mode 100644 index 0000000..e1484d6 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Button.html @@ -0,0 +1,203 @@ + + + + + +Uses of Interface org.montclairrobotics.alloy.core.Button + + + + + + + + + + + +
+

Uses of Interface
org.montclairrobotics.alloy.core.Button

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Debug.html b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Debug.html new file mode 100644 index 0000000..16de1f5 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Debug.html @@ -0,0 +1,166 @@ + + + + + +Uses of Interface org.montclairrobotics.alloy.core.Debug + + + + + + + + + + + +
+

Uses of Interface
org.montclairrobotics.alloy.core.Debug

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Joystick.html b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Joystick.html new file mode 100644 index 0000000..7df6b9c --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Joystick.html @@ -0,0 +1,166 @@ + + + + + +Uses of Interface org.montclairrobotics.alloy.core.Joystick + + + + + + + + + + + +
+

Uses of Interface
org.montclairrobotics.alloy.core.Joystick

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Mode.html b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Mode.html new file mode 100644 index 0000000..c1a6819 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Mode.html @@ -0,0 +1,173 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.core.Mode + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.core.Mode

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Motor.html b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Motor.html new file mode 100644 index 0000000..740e47a --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/Motor.html @@ -0,0 +1,196 @@ + + + + + +Uses of Interface org.montclairrobotics.alloy.core.Motor + + + + + + + + + + + +
+

Uses of Interface
org.montclairrobotics.alloy.core.Motor

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/class-use/RobotCore.html b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/RobotCore.html new file mode 100644 index 0000000..708e812 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/RobotCore.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.core.RobotCore + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.core.RobotCore

+
+
No usage of org.montclairrobotics.alloy.core.RobotCore
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/class-use/TargetMotor.html b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/TargetMotor.html new file mode 100644 index 0000000..cfbdadc --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/class-use/TargetMotor.html @@ -0,0 +1,166 @@ + + + + + +Uses of Interface org.montclairrobotics.alloy.core.TargetMotor + + + + + + + + + + + +
+

Uses of Interface
org.montclairrobotics.alloy.core.TargetMotor

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/core/package-frame.html new file mode 100644 index 0000000..0954609 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/package-frame.html @@ -0,0 +1,33 @@ + + + + + +org.montclairrobotics.alloy.core + + + + + +

org.montclairrobotics.alloy.core

+
+

Interfaces

+ +

Classes

+ +

Enums

+ +
+ + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/core/package-summary.html new file mode 100644 index 0000000..7d8c746 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/package-summary.html @@ -0,0 +1,208 @@ + + + + + +org.montclairrobotics.alloy.core + + + + + + + + + + + +
+

Package org.montclairrobotics.alloy.core

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    Button +
    Created by MHS Robotics on 11/13/2017.
    +
    Debug +
    Created by MHS Robotics on 11/13/2017.
    +
    Joystick +
    Created by MHS Robotics on 11/14/2017.
    +
    Motor +
    Created by MHS Robotics on 11/13/2017.
    +
    TargetMotor +
    Target motor is a motor interface for motors that have encoders.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Alloy +
    Created by MHS Robotics on 11/13/2017.
    +
    RobotCore +
    Created by MHS Robotics on 12/5/2017.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Mode +
    Created by MHS Robotics on 11/14/2017.
    +
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/package-tree.html b/docs/javadoc/org/montclairrobotics/alloy/core/package-tree.html new file mode 100644 index 0000000..bcf56d5 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/package-tree.html @@ -0,0 +1,165 @@ + + + + + +org.montclairrobotics.alloy.core Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.montclairrobotics.alloy.core

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.qualcomm.robotcore.eventloop.opmode.OpMode +
        +
      • org.montclairrobotics.alloy.core.Alloy
      • +
      +
    • +
    • org.montclairrobotics.alloy.core.RobotCore
    • +
    +
  • +
+

Interface Hierarchy

+
    +
  • org.montclairrobotics.alloy.core.Button
  • +
  • org.montclairrobotics.alloy.core.Debug
  • +
  • org.montclairrobotics.alloy.core.Joystick
  • +
  • org.montclairrobotics.alloy.core.Motor + +
  • +
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) +
        +
      • org.montclairrobotics.alloy.core.Mode
      • +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/core/package-use.html b/docs/javadoc/org/montclairrobotics/alloy/core/package-use.html new file mode 100644 index 0000000..45d588a --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/core/package-use.html @@ -0,0 +1,247 @@ + + + + + +Uses of Package org.montclairrobotics.alloy.core + + + + + + + + + + + +
+

Uses of Package
org.montclairrobotics.alloy.core

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/drive/DTMapper.html b/docs/javadoc/org/montclairrobotics/alloy/drive/DTMapper.html new file mode 100644 index 0000000..8aaf1d5 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/drive/DTMapper.html @@ -0,0 +1,228 @@ + + + + + +DTMapper + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.drive
+

Interface DTMapper

+
+
+
+
    +
  • +
    +
    +
    public interface DTMapper
    +
    Created by MHS Robotics on 12/16/2017.
    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        map

        +
        void map()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/drive/DriveTrain.html b/docs/javadoc/org/montclairrobotics/alloy/drive/DriveTrain.html new file mode 100644 index 0000000..2520af4 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/drive/DriveTrain.html @@ -0,0 +1,244 @@ + + + + + +DriveTrain + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.drive
+

Class DriveTrain

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.drive.DriveTrain
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class DriveTrain
    +extends java.lang.Object
    +
    Created by MHS Robotics on 12/16/2017.
    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      DriveTrain() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DriveTrain

        +
        public DriveTrain()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DTMapper.html b/docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DTMapper.html new file mode 100644 index 0000000..bf1e29a --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DTMapper.html @@ -0,0 +1,124 @@ + + + + + +Uses of Interface org.montclairrobotics.alloy.drive.DTMapper + + + + + + + + + + + +
+

Uses of Interface
org.montclairrobotics.alloy.drive.DTMapper

+
+
No usage of org.montclairrobotics.alloy.drive.DTMapper
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DriveTrain.html b/docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DriveTrain.html new file mode 100644 index 0000000..ac82334 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DriveTrain.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.drive.DriveTrain + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.drive.DriveTrain

+
+
No usage of org.montclairrobotics.alloy.drive.DriveTrain
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/drive/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/drive/package-frame.html new file mode 100644 index 0000000..58e5062 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/drive/package-frame.html @@ -0,0 +1,24 @@ + + + + + +org.montclairrobotics.alloy.drive + + + + + +

org.montclairrobotics.alloy.drive

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/docs/javadoc/org/montclairrobotics/alloy/drive/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/drive/package-summary.html new file mode 100644 index 0000000..3782031 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/drive/package-summary.html @@ -0,0 +1,161 @@ + + + + + +org.montclairrobotics.alloy.drive + + + + + + + + + + + +
+

Package org.montclairrobotics.alloy.drive

+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    DTMapper +
    Created by MHS Robotics on 12/16/2017.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    DriveTrain +
    Created by MHS Robotics on 12/16/2017.
    +
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/drive/package-tree.html b/docs/javadoc/org/montclairrobotics/alloy/drive/package-tree.html new file mode 100644 index 0000000..2a2bf12 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/drive/package-tree.html @@ -0,0 +1,141 @@ + + + + + +org.montclairrobotics.alloy.drive Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.montclairrobotics.alloy.drive

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+

Interface Hierarchy

+
    +
  • org.montclairrobotics.alloy.drive.DTMapper
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/drive/package-use.html b/docs/javadoc/org/montclairrobotics/alloy/drive/package-use.html new file mode 100644 index 0000000..7204afb --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/drive/package-use.html @@ -0,0 +1,124 @@ + + + + + +Uses of Package org.montclairrobotics.alloy.drive + + + + + + + + + + + +
+

Uses of Package
org.montclairrobotics.alloy.drive

+
+
No usage of org.montclairrobotics.alloy.drive
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCButton.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCButton.html new file mode 100644 index 0000000..85a5479 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCButton.html @@ -0,0 +1,465 @@ + + + + + +FTCButton + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.ftc
+

Class FTCButton

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.ftc.FTCButton
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Button
    +
    +
    +
    +
    public class FTCButton
    +extends java.lang.Object
    +implements Button
    +
    Created by MHS Robotics on 11/14/2017. + +

    An FTC button provides implementation for a button used in the FTC competition

    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FTCButton

        +
        public FTCButton(Input<java.lang.Boolean> buttonInput)
        +
      • +
      + + + +
        +
      • +

        FTCButton

        +
        public FTCButton(Input<java.lang.Boolean> buttonInput,
        +                 boolean invert)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getValue

        +
        public boolean getValue()
        +
        Description copied from interface: Button
        +
        Gets the value of a button
        +
        +
        Specified by:
        +
        getValue in interface Button
        +
        Returns:
        +
        returns the value of the button, in most case True(pressed) or False(unpressed)
        +
        +
      • +
      + + + +
        +
      • +

        getAButton

        +
        public static FTCButton getAButton(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getBButton

        +
        public static FTCButton getBButton(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getXButton

        +
        public static FTCButton getXButton(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getYButton

        +
        public static FTCButton getYButton(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getDPADUp

        +
        public static FTCButton getDPADUp(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getDPADDown

        +
        public static FTCButton getDPADDown(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getYDPADRight

        +
        public static FTCButton getYDPADRight(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getDPADLeft

        +
        public static FTCButton getDPADLeft(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getRightBumper

        +
        public static FTCButton getRightBumper(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getLeftBumper

        +
        public static FTCButton getLeftBumper(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getRightTrigger

        +
        public static FTCButton getRightTrigger(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      + + + +
        +
      • +

        getLeftTrigger

        +
        public static FTCButton getLeftTrigger(com.qualcomm.robotcore.hardware.Gamepad gamepad)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCDebug.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCDebug.html new file mode 100644 index 0000000..60f869d --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCDebug.html @@ -0,0 +1,322 @@ + + + + + +FTCDebug + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.ftc
+

Class FTCDebug

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.ftc.FTCDebug
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Debug
    +
    +
    +
    +
    public class FTCDebug
    +extends java.lang.Object
    +implements Debug
    +
    Created by MHS Robotics on 11/14/2017. + +

    The FTCDebug class is a basic wrapper around the ftc telemetry framework and allows telemetry + to be used in any class as well as making debugging information easier

    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FTCDebug() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidlog(java.lang.String key, + java.lang.Object value) +
      Debugs a value with a Key(Identifier)
      +
      voidmsg(java.lang.Object value) +
      Debugs any value or message(note) to the user with a default key
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FTCDebug

        +
        public FTCDebug()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        log

        +
        public void log(java.lang.String key,
        +                java.lang.Object value)
        +
        Description copied from interface: Debug
        +
        Debugs a value with a Key(Identifier)
        +
        +
        Specified by:
        +
        log in interface Debug
        +
        Parameters:
        +
        key - Name of the value
        +
        value - Value to be debugged
        +
        +
      • +
      + + + +
        +
      • +

        msg

        +
        public void msg(java.lang.Object value)
        +
        Description copied from interface: Debug
        +
        Debugs any value or message(note) to the user with a default key
        +
        +
        Specified by:
        +
        msg in interface Debug
        +
        Parameters:
        +
        value - Value to be debugged
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCJoystick.Side.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCJoystick.Side.html new file mode 100644 index 0000000..8873b17 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCJoystick.Side.html @@ -0,0 +1,345 @@ + + + + + +FTCJoystick.Side + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.ftc
+

Enum FTCJoystick.Side

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<FTCJoystick.Side>
    • +
    • +
        +
      • org.montclairrobotics.alloy.ftc.FTCJoystick.Side
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<FTCJoystick.Side>
    +
    +
    +
    Enclosing class:
    +
    FTCJoystick
    +
    +
    +
    +
    public static enum FTCJoystick.Side
    +extends java.lang.Enum<FTCJoystick.Side>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      LEFT 
      RIGHT 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static FTCJoystick.SidevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static FTCJoystick.Side[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static FTCJoystick.Side[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (FTCJoystick.Side c : FTCJoystick.Side.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static FTCJoystick.Side valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCJoystick.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCJoystick.html new file mode 100644 index 0000000..ee4a71b --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCJoystick.html @@ -0,0 +1,314 @@ + + + + + +FTCJoystick + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.ftc
+

Class FTCJoystick

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.ftc.FTCJoystick
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Joystick
    +
    +
    +
    +
    public class FTCJoystick
    +extends java.lang.Object
    +implements Joystick
    +
    Created by MHS Robotics on 11/14/2017.
    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class FTCJoystick.Side 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FTCJoystick(com.qualcomm.robotcore.hardware.Gamepad gamepad, + FTCJoystick.Side side) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      VectorgetValue() +
      Gets the position of the joystick
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FTCJoystick

        +
        public FTCJoystick(com.qualcomm.robotcore.hardware.Gamepad gamepad,
        +                   FTCJoystick.Side side)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getValue

        +
        public Vector getValue()
        +
        Description copied from interface: Joystick
        +
        Gets the position of the joystick
        +
        +
        Specified by:
        +
        getValue in interface Joystick
        +
        Returns:
        +
        a vector made up of the X and Y values of the Joysticks Position
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCMotor.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCMotor.html new file mode 100644 index 0000000..d0fabc0 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCMotor.html @@ -0,0 +1,368 @@ + + + + + +FTCMotor + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.ftc
+

Class FTCMotor

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.ftc.FTCMotor
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Motor
    +
    +
    +
    Direct Known Subclasses:
    +
    FTCTargetMotor
    +
    +
    +
    +
    public class FTCMotor
    +extends java.lang.Object
    +implements Motor
    +
    Created by MHS Robotics on 11/14/2017. + +

    FTCMotor is a basic implementation of a motor used for FTC. Basic FTC motors can be controlled + using motor power but can not have their positions set using encoders. If you wish to set a + motors position

    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    See Also:
    +
    FTCTargetMotor
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FTCMotor(java.lang.String motorConfiguration) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleangetInverted() +
      Gets weather the motor is inverted
      +
      doublegetMotorPower() +
      Gets the motor power
      +
      voidsetInverted(boolean inverted) +
      Sets weather the motor runs the default way , or inverted
      +
      voidsetMotorPower(double power) +
      Sets the motor Power
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FTCMotor

        +
        public FTCMotor(java.lang.String motorConfiguration)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setMotorPower

        +
        public void setMotorPower(double power)
        +
        Sets the motor Power
        +
        +
        Specified by:
        +
        setMotorPower in interface Motor
        +
        Parameters:
        +
        power - the power that the motor will be set to (0-1 inclusive )
        +
        +
      • +
      + + + +
        +
      • +

        getMotorPower

        +
        public double getMotorPower()
        +
        Gets the motor power
        +
        +
        Specified by:
        +
        getMotorPower in interface Motor
        +
        Returns:
        +
        the current motor power, a value between (0-1)
        +
        +
      • +
      + + + +
        +
      • +

        setInverted

        +
        public void setInverted(boolean inverted)
        +
        Sets weather the motor runs the default way , or inverted
        +
        +
        Specified by:
        +
        setInverted in interface Motor
        +
        Parameters:
        +
        inverted - true for inverted, false for normal
        +
        +
      • +
      + + + +
        +
      • +

        getInverted

        +
        public boolean getInverted()
        +
        Gets weather the motor is inverted
        +
        +
        Specified by:
        +
        getInverted in interface Motor
        +
        Returns:
        +
        true if the motor is inverted
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCTargetMotor.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCTargetMotor.html new file mode 100644 index 0000000..43f8411 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/FTCTargetMotor.html @@ -0,0 +1,489 @@ + + + + + +FTCTargetMotor + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.ftc
+

Class FTCTargetMotor

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Motor, TargetMotor
    +
    +
    +
    +
    public class FTCTargetMotor
    +extends FTCMotor
    +implements TargetMotor
    +
    Created by MHS Robotics on 2/24/2018. + +

    A target motor is a motor that can use encoders to be set to a certain position Since FTC + motors have their own PIDs that they are controlled with by default, the user has the ability to + override this and use custom PIDs if need be. By default, the user does not have to worry about + any of this. Do not attempt to change the PID if you do not know what you are doing You can read + more about PIDs here https://en.wikipedia.org/wiki/PID_controller

    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FTCTargetMotor(java.lang.String motorConfiguration) 
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FTCTargetMotor

        +
        public FTCTargetMotor(java.lang.String motorConfiguration)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setPosition

        +
        public void setPosition(int position)
        +
        Sets the motor position
        +
        +
        Specified by:
        +
        setPosition in interface TargetMotor
        +
        Parameters:
        +
        position - the position the motor will be set to (in encoder ticks)
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public double getPosition()
        +
        Gets the motors position
        +
        +
        Specified by:
        +
        getPosition in interface TargetMotor
        +
        Returns:
        +
        the position that the motor is at (in encoder ticks)
        +
        +
      • +
      + + + +
        +
      • +

        setTargetPower

        +
        public void setTargetPower(double power)
        +
        Sets the motor Power
        +
        +
        Specified by:
        +
        setTargetPower in interface TargetMotor
        +
        Parameters:
        +
        power - the power that the motor will be set to (0-1 inclusive )
        +
        +
      • +
      + + + +
        +
      • +

        getTargetPower

        +
        public double getTargetPower()
        +
        Gets the motor power
        +
        +
        Specified by:
        +
        getTargetPower in interface TargetMotor
        +
        Returns:
        +
        the current motor power, a value between (0-1)
        +
        +
      • +
      + + + +
        +
      • +

        setPID

        +
        public void setPID(PID pid)
        +
        Set the motor to run using a custom PID
        +
        +
        Parameters:
        +
        pid - the PID that the motor will be controlled with
        +
        +
      • +
      + + + +
        +
      • +

        disablePID

        +
        public void disablePID()
        +
        Stop using the custom PID and return to using the default mode
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update()
        +
        If the mode is custom, then the update method will set the motor power using the custom PID
        +
      • +
      + + + +
        +
      • +

        getPid

        +
        public PID getPid()
        +
        +
        Returns:
        +
        the PID being used to control the motor
        +
        +
      • +
      + + + +
        +
      • +

        getMotor

        +
        public com.qualcomm.robotcore.hardware.DcMotor getMotor()
        +
        +
        Returns:
        +
        the motor being controlled
        +
        +
      • +
      + + + +
        +
      • +

        getRunmode

        +
        public org.montclairrobotics.alloy.ftc.FTCTargetMotor.Mode getRunmode()
        +
        NOTE: this is not the same as the DCMotor runmode
        +
        +
        Returns:
        +
        the current target motor runmode
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCButton.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCButton.html new file mode 100644 index 0000000..cd19615 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCButton.html @@ -0,0 +1,208 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.ftc.FTCButton + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.ftc.FTCButton

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCDebug.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCDebug.html new file mode 100644 index 0000000..94b5bd2 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCDebug.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.ftc.FTCDebug + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.ftc.FTCDebug

+
+
No usage of org.montclairrobotics.alloy.ftc.FTCDebug
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCJoystick.Side.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCJoystick.Side.html new file mode 100644 index 0000000..ce0cdcb --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCJoystick.Side.html @@ -0,0 +1,185 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.ftc.FTCJoystick.Side + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.ftc.FTCJoystick.Side

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCJoystick.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCJoystick.html new file mode 100644 index 0000000..88754f9 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCJoystick.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.ftc.FTCJoystick + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.ftc.FTCJoystick

+
+
No usage of org.montclairrobotics.alloy.ftc.FTCJoystick
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCMotor.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCMotor.html new file mode 100644 index 0000000..8dc3335 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCMotor.html @@ -0,0 +1,166 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.ftc.FTCMotor + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.ftc.FTCMotor

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCTargetMotor.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCTargetMotor.html new file mode 100644 index 0000000..1f9142f --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCTargetMotor.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.ftc.FTCTargetMotor + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.ftc.FTCTargetMotor

+
+
No usage of org.montclairrobotics.alloy.ftc.FTCTargetMotor
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/package-frame.html new file mode 100644 index 0000000..2e12b66 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/package-frame.html @@ -0,0 +1,28 @@ + + + + + +org.montclairrobotics.alloy.ftc + + + + + +

org.montclairrobotics.alloy.ftc

+ + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/package-summary.html new file mode 100644 index 0000000..f7a2c07 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/package-summary.html @@ -0,0 +1,183 @@ + + + + + +org.montclairrobotics.alloy.ftc + + + + + + + + + + + +
+

Package org.montclairrobotics.alloy.ftc

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    FTCButton +
    Created by MHS Robotics on 11/14/2017.
    +
    FTCDebug +
    Created by MHS Robotics on 11/14/2017.
    +
    FTCJoystick +
    Created by MHS Robotics on 11/14/2017.
    +
    FTCMotor +
    Created by MHS Robotics on 11/14/2017.
    +
    FTCTargetMotor +
    Created by MHS Robotics on 2/24/2018.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    FTCJoystick.Side 
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/package-tree.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/package-tree.html new file mode 100644 index 0000000..0f30054 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/package-tree.html @@ -0,0 +1,156 @@ + + + + + +org.montclairrobotics.alloy.ftc Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.montclairrobotics.alloy.ftc

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • org.montclairrobotics.alloy.ftc.FTCButton (implements org.montclairrobotics.alloy.core.Button)
    • +
    • org.montclairrobotics.alloy.ftc.FTCDebug (implements org.montclairrobotics.alloy.core.Debug)
    • +
    • org.montclairrobotics.alloy.ftc.FTCJoystick (implements org.montclairrobotics.alloy.core.Joystick)
    • +
    • org.montclairrobotics.alloy.ftc.FTCMotor (implements org.montclairrobotics.alloy.core.Motor) + +
    • +
    +
  • +
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/ftc/package-use.html b/docs/javadoc/org/montclairrobotics/alloy/ftc/package-use.html new file mode 100644 index 0000000..b86b5de --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/ftc/package-use.html @@ -0,0 +1,167 @@ + + + + + +Uses of Package org.montclairrobotics.alloy.ftc + + + + + + + + + + + +
+

Uses of Package
org.montclairrobotics.alloy.ftc

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/test/Shooter.html b/docs/javadoc/org/montclairrobotics/alloy/test/Shooter.html new file mode 100644 index 0000000..80025ab --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/test/Shooter.html @@ -0,0 +1,312 @@ + + + + + +Shooter + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.test
+

Class Shooter

+
+
+ +
+
    +
  • +
    +
    +
    public class Shooter
    +extends Toggleable
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Shooter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voiddisableAction() +
      Method to be called when the toggleable is disabled
      +
      voidenableAction() +
      Method to be called when the toggleable is enabled
      +
      + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Shooter

        +
        public Shooter()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        enableAction

        +
        public void enableAction()
        +
        Description copied from class: Toggleable
        +
        Method to be called when the toggleable is enabled
        +
        +
        Specified by:
        +
        enableAction in class Toggleable
        +
        +
      • +
      + + + +
        +
      • +

        disableAction

        +
        public void disableAction()
        +
        Description copied from class: Toggleable
        +
        Method to be called when the toggleable is disabled
        +
        +
        Specified by:
        +
        disableAction in class Toggleable
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/test/TestRobot.html b/docs/javadoc/org/montclairrobotics/alloy/test/TestRobot.html new file mode 100644 index 0000000..78ac494 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/test/TestRobot.html @@ -0,0 +1,369 @@ + + + + + +TestRobot + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.test
+

Class TestRobot

+
+
+ +
+
    +
  • +
    +
    +
    @TeleOp
    +public class TestRobot
    +extends Alloy
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

        +gamepad1, gamepad2, hardwareMap, internalOpModeServices, msStuckDetectInit, msStuckDetectInitLoop, msStuckDetectLoop, msStuckDetectStart, msStuckDetectStop, telemetry, time
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TestRobot() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidinitialization() +
      The initialization method is were everything specific to the OpMode Should be set up.
      +
      voidperiodic() +
      Although most of the periodic actions are taken care by the updater, the user may want to add + their own methods and code that need to be updated or run periodically, this can be done in + the periodic() method periodic will be run every loop.
      +
      voidrobotSetup() +
      The robotSetup is where all code specific to robot setup is placed If you only have one + teleop this can be done in the initialization Method.
      +
      +
        +
      • + + +

        Methods inherited from class org.montclairrobotics.alloy.core.Alloy

        +init, loop
      • +
      +
        +
      • + + +

        Methods inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

        +getRuntime, init_loop, internalPostInitLoop, internalPostLoop, internalPreInit, internalUpdateTelemetryNow, requestOpModeStop, resetStartTime, start, stop, updateTelemetry
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TestRobot

        +
        public TestRobot()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        robotSetup

        +
        public void robotSetup()
        +
        Description copied from class: Alloy
        +
        The robotSetup is where all code specific to robot setup is placed If you only have one + teleop this can be done in the initialization Method. robotSetup is called right after the + robot core is initialized
        +
        +
        Specified by:
        +
        robotSetup in class Alloy
        +
        +
      • +
      + + + +
        +
      • +

        initialization

        +
        public void initialization()
        +
        Description copied from class: Alloy
        +
        The initialization method is were everything specific to the OpMode Should be set up. + Initialization will be the first thing called after The robot setup.
        +
        +
        Specified by:
        +
        initialization in class Alloy
        +
        +
      • +
      + + + +
        +
      • +

        periodic

        +
        public void periodic()
        +
        Description copied from class: Alloy
        +
        Although most of the periodic actions are taken care by the updater, the user may want to add + their own methods and code that need to be updated or run periodically, this can be done in + the periodic() method periodic will be run every loop.
        +
        +
        Specified by:
        +
        periodic in class Alloy
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/test/class-use/Shooter.html b/docs/javadoc/org/montclairrobotics/alloy/test/class-use/Shooter.html new file mode 100644 index 0000000..3d6d004 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/test/class-use/Shooter.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.test.Shooter + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.test.Shooter

+
+
No usage of org.montclairrobotics.alloy.test.Shooter
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/test/class-use/TestRobot.html b/docs/javadoc/org/montclairrobotics/alloy/test/class-use/TestRobot.html new file mode 100644 index 0000000..47f5509 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/test/class-use/TestRobot.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.test.TestRobot + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.test.TestRobot

+
+
No usage of org.montclairrobotics.alloy.test.TestRobot
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/test/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/test/package-frame.html new file mode 100644 index 0000000..0062311 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/test/package-frame.html @@ -0,0 +1,21 @@ + + + + + +org.montclairrobotics.alloy.test + + + + + +

org.montclairrobotics.alloy.test

+
+

Classes

+ +
+ + diff --git a/docs/javadoc/org/montclairrobotics/alloy/test/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/test/package-summary.html new file mode 100644 index 0000000..40f5a1a --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/test/package-summary.html @@ -0,0 +1,146 @@ + + + + + +org.montclairrobotics.alloy.test + + + + + + + + + + + +
+

Package org.montclairrobotics.alloy.test

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Shooter 
    TestRobot 
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/test/package-tree.html b/docs/javadoc/org/montclairrobotics/alloy/test/package-tree.html new file mode 100644 index 0000000..9b09786 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/test/package-tree.html @@ -0,0 +1,150 @@ + + + + + +org.montclairrobotics.alloy.test Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.montclairrobotics.alloy.test

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.qualcomm.robotcore.eventloop.opmode.OpMode +
        +
      • org.montclairrobotics.alloy.core.Alloy +
          +
        • org.montclairrobotics.alloy.test.TestRobot
        • +
        +
      • +
      +
    • +
    • org.montclairrobotics.alloy.utils.Toggleable +
        +
      • org.montclairrobotics.alloy.test.Shooter
      • +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/test/package-use.html b/docs/javadoc/org/montclairrobotics/alloy/test/package-use.html new file mode 100644 index 0000000..7d9f726 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/test/package-use.html @@ -0,0 +1,124 @@ + + + + + +Uses of Package org.montclairrobotics.alloy.test + + + + + + + + + + + +
+

Uses of Package
org.montclairrobotics.alloy.test

+
+
No usage of org.montclairrobotics.alloy.test
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/Updatable.html b/docs/javadoc/org/montclairrobotics/alloy/update/Updatable.html new file mode 100644 index 0000000..3a7449b --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/Updatable.html @@ -0,0 +1,257 @@ + + + + + +Updatable + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.update
+

Class Updatable

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.update.Updatable
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class Updatable
    +extends java.lang.Object
    +
    Created by MHS Robotics on 2/11/2018.
    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intgetUpdateRate() 
      voidrun() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        run

        +
        public void run()
        +
      • +
      + + + +
        +
      • +

        getUpdateRate

        +
        public int getUpdateRate()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/Update.html b/docs/javadoc/org/montclairrobotics/alloy/update/Update.html new file mode 100644 index 0000000..efa5ee1 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/Update.html @@ -0,0 +1,237 @@ + + + + + +Update + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.update
+

Annotation Type Update

+
+
+
+
    +
  • +
    +
    +
    @Retention(value=RUNTIME)
    + @Target(value=METHOD)
    +public @interface Update
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      intpriority 
      intupdateRate 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        updateRate

        +
        public abstract int updateRate
        +
        +
        Default:
        +
        1
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        priority

        +
        public abstract int priority
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/Updater.html b/docs/javadoc/org/montclairrobotics/alloy/update/Updater.html new file mode 100644 index 0000000..3388f70 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/Updater.html @@ -0,0 +1,291 @@ + + + + + +Updater + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.update
+

Class Updater

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.update.Updater
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class Updater
    +extends java.lang.Object
    +
    Created by MHS Robotics on 12/5/2017.
    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Updater() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidregisterUpdatables() 
      static voidupdate() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Updater

        +
        public Updater()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        registerUpdatables

        +
        public static void registerUpdatables()
        +
      • +
      + + + +
        +
      • +

        update

        +
        public static void update()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/class-use/Updatable.html b/docs/javadoc/org/montclairrobotics/alloy/update/class-use/Updatable.html new file mode 100644 index 0000000..4a8955d --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/class-use/Updatable.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.update.Updatable + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.update.Updatable

+
+
No usage of org.montclairrobotics.alloy.update.Updatable
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/class-use/Update.html b/docs/javadoc/org/montclairrobotics/alloy/update/class-use/Update.html new file mode 100644 index 0000000..f70cd4d --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/class-use/Update.html @@ -0,0 +1,213 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.update.Update + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.update.Update

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/class-use/Updater.html b/docs/javadoc/org/montclairrobotics/alloy/update/class-use/Updater.html new file mode 100644 index 0000000..61fba53 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/class-use/Updater.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.update.Updater + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.update.Updater

+
+
No usage of org.montclairrobotics.alloy.update.Updater
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/update/package-frame.html new file mode 100644 index 0000000..d04ccb0 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/package-frame.html @@ -0,0 +1,25 @@ + + + + + +org.montclairrobotics.alloy.update + + + + + +

org.montclairrobotics.alloy.update

+
+

Classes

+ +

Annotation Types

+ +
+ + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/update/package-summary.html new file mode 100644 index 0000000..2b1fa0a --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/package-summary.html @@ -0,0 +1,165 @@ + + + + + +org.montclairrobotics.alloy.update + + + + + + + + + + + +
+

Package org.montclairrobotics.alloy.update

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Updatable +
    Created by MHS Robotics on 2/11/2018.
    +
    Updater +
    Created by MHS Robotics on 12/5/2017.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Annotation Types Summary 
    Annotation TypeDescription
    Update 
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/package-tree.html b/docs/javadoc/org/montclairrobotics/alloy/update/package-tree.html new file mode 100644 index 0000000..d06c2f3 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/package-tree.html @@ -0,0 +1,142 @@ + + + + + +org.montclairrobotics.alloy.update Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.montclairrobotics.alloy.update

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • org.montclairrobotics.alloy.update.Updatable
    • +
    • org.montclairrobotics.alloy.update.Updater
    • +
    +
  • +
+

Annotation Type Hierarchy

+
    +
  • org.montclairrobotics.alloy.update.Update (implements java.lang.annotation.Annotation)
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/update/package-use.html b/docs/javadoc/org/montclairrobotics/alloy/update/package-use.html new file mode 100644 index 0000000..fd742cf --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/update/package-use.html @@ -0,0 +1,195 @@ + + + + + +Uses of Package org.montclairrobotics.alloy.update + + + + + + + + + + + +
+

Uses of Package
org.montclairrobotics.alloy.update

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/Input.html b/docs/javadoc/org/montclairrobotics/alloy/utils/Input.html new file mode 100644 index 0000000..b44d481 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/Input.html @@ -0,0 +1,232 @@ + + + + + +Input + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.utils
+

Interface Input<T>

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    PID
    +
    +
    +
    +
    public interface Input<T>
    +
    Created by MHS Robotics on 2/2/2018.
    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get

        +
        T get()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/PID.html b/docs/javadoc/org/montclairrobotics/alloy/utils/PID.html new file mode 100644 index 0000000..d0fbcf0 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/PID.html @@ -0,0 +1,387 @@ + + + + + +PID + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.utils
+

Class PID

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.utils.PID
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Input<java.lang.Double>
    +
    +
    +
    +
    public class PID
    +extends java.lang.Object
    +implements Input<java.lang.Double>
    +
    Created by Montclair robotics on 2/27/2018 + +

    A PID controller is able to control a component that has a target, current state, and can be + controlled for example: - A robots heading using a Gryo - A motors position using encoders + +

    PID stands for Proportion, Integral and Derivative control. It uses the error of a component + and then calculates the correction the PID values must be tuned in order to have a working PID + loop A properly tuned implementation of a PID controller should result in a correction that goes + fast, and accurate to its target, and does not overshoot it. + +

    You can read more about implementing PID control here + https://github.com/GarrettBurroughs/Alloy/wiki/Using-PID-control You can read more + about how PID works here https://en.wikipedia.org/wiki/PID_controller

    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      PID(double p, + double i, + double d) +
      Create a new PID
      +
      PID(double p, + double i, + double d, + Input<java.lang.Double> input, + double target) +
      Create a new PID with the input and target defined
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Doubleget() 
      PIDsetInput(Input<java.lang.Double> input) 
      PIDsetTarget(double target) 
      voidupdate() +
      The update method should be defined for every updatable, and is called every loop if added to + the updater
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PID

        +
        public PID(double p,
        +           double i,
        +           double d)
        +
        Create a new PID
        +
        +
        Parameters:
        +
        p - proportional constant
        +
        i - integral constant
        +
        d - derivative constant
        +
        +
      • +
      + + + +
        +
      • +

        PID

        +
        public PID(double p,
        +           double i,
        +           double d,
        +           Input<java.lang.Double> input,
        +           double target)
        +
        Create a new PID with the input and target defined
        +
        +
        Parameters:
        +
        p - proportional constan
        +
        i - integral constant
        +
        d - derivative constant
        +
        input - the input of the component being controlled (current status)
        +
        target - the desired target (status) of the component being controlled
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setTarget

        +
        public PID setTarget(double target)
        +
      • +
      + + + +
        +
      • +

        setInput

        +
        public PID setInput(Input<java.lang.Double> input)
        +
      • +
      + + + +
        +
      • +

        get

        +
        public java.lang.Double get()
        +
        +
        Specified by:
        +
        get in interface Input<java.lang.Double>
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update()
        +
        The update method should be defined for every updatable, and is called every loop if added to + the updater
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/Toggleable.html b/docs/javadoc/org/montclairrobotics/alloy/utils/Toggleable.html new file mode 100644 index 0000000..1f9a1e1 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/Toggleable.html @@ -0,0 +1,357 @@ + + + + + +Toggleable + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.utils
+

Class Toggleable

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.utils.Toggleable
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    Shooter
    +
    +
    +
    +
    public abstract class Toggleable
    +extends java.lang.Object
    +
    Created by MHS Robotics on 2/11/2018. + +

    Toggleables are used for objects of mechanisms that can either be on (Enabled), or off + toggleables can have actions defined for when they are enabled and disabled, as well as be tied + to different parts of alloy like buttons and auto states

    +
    +
    Since:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    See Also:
    +
    ToggleButton
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Toggleable() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voiddisable() +
      Disables the toggleable
      +
      abstract voiddisableAction() +
      Method to be called when the toggleable is disabled
      +
      voidenable() +
      Enables the toggleable
      +
      abstract voidenableAction() +
      Method to be called when the toggleable is enabled
      +
      voidtoggle() +
      Switches(Toggles), between the two states, If the toggleable is disabled, enable it If the + toggleable is enabled, disable it
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Toggleable

        +
        public Toggleable()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        enableAction

        +
        public abstract void enableAction()
        +
        Method to be called when the toggleable is enabled
        +
      • +
      + + + +
        +
      • +

        disableAction

        +
        public abstract void disableAction()
        +
        Method to be called when the toggleable is disabled
        +
      • +
      + + + +
        +
      • +

        enable

        +
        public void enable()
        +
        Enables the toggleable
        +
      • +
      + + + +
        +
      • +

        disable

        +
        public void disable()
        +
        Disables the toggleable
        +
      • +
      + + + +
        +
      • +

        toggle

        +
        public void toggle()
        +
        Switches(Toggles), between the two states, If the toggleable is disabled, enable it If the + toggleable is enabled, disable it
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/TuneablePID.html b/docs/javadoc/org/montclairrobotics/alloy/utils/TuneablePID.html new file mode 100644 index 0000000..0bc6c7a --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/TuneablePID.html @@ -0,0 +1,237 @@ + + + + + +TuneablePID + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.utils
+

Class TuneablePID

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.utils.TuneablePID
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class TuneablePID
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TuneablePID() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TuneablePID

        +
        public TuneablePID()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Input.html b/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Input.html new file mode 100644 index 0000000..afa87c9 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Input.html @@ -0,0 +1,220 @@ + + + + + +Uses of Interface org.montclairrobotics.alloy.utils.Input + + + + + + + + + + + +
+

Uses of Interface
org.montclairrobotics.alloy.utils.Input

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/PID.html b/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/PID.html new file mode 100644 index 0000000..e2b4b77 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/PID.html @@ -0,0 +1,205 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.utils.PID + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.utils.PID

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Toggleable.html b/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Toggleable.html new file mode 100644 index 0000000..4457077 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Toggleable.html @@ -0,0 +1,185 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.utils.Toggleable + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.utils.Toggleable

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/TuneablePID.html b/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/TuneablePID.html new file mode 100644 index 0000000..52eef58 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/class-use/TuneablePID.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.utils.TuneablePID + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.utils.TuneablePID

+
+
No usage of org.montclairrobotics.alloy.utils.TuneablePID
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/utils/package-frame.html new file mode 100644 index 0000000..cf78a75 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/package-frame.html @@ -0,0 +1,26 @@ + + + + + +org.montclairrobotics.alloy.utils + + + + + +

org.montclairrobotics.alloy.utils

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/utils/package-summary.html new file mode 100644 index 0000000..efcd9ab --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/package-summary.html @@ -0,0 +1,171 @@ + + + + + +org.montclairrobotics.alloy.utils + + + + + + + + + + + +
+

Package org.montclairrobotics.alloy.utils

+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    Input<T> +
    Created by MHS Robotics on 2/2/2018.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    PID +
    Created by Montclair robotics on 2/27/2018
    +
    Toggleable +
    Created by MHS Robotics on 2/11/2018.
    +
    TuneablePID 
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/package-tree.html b/docs/javadoc/org/montclairrobotics/alloy/utils/package-tree.html new file mode 100644 index 0000000..1cfc4ee --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/package-tree.html @@ -0,0 +1,143 @@ + + + + + +org.montclairrobotics.alloy.utils Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.montclairrobotics.alloy.utils

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • org.montclairrobotics.alloy.utils.PID (implements org.montclairrobotics.alloy.utils.Input<T>)
    • +
    • org.montclairrobotics.alloy.utils.Toggleable
    • +
    • org.montclairrobotics.alloy.utils.TuneablePID
    • +
    +
  • +
+

Interface Hierarchy

+
    +
  • org.montclairrobotics.alloy.utils.Input<T>
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/utils/package-use.html b/docs/javadoc/org/montclairrobotics/alloy/utils/package-use.html new file mode 100644 index 0000000..fd5f27a --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/utils/package-use.html @@ -0,0 +1,232 @@ + + + + + +Uses of Package org.montclairrobotics.alloy.utils + + + + + + + + + + + +
+

Uses of Package
org.montclairrobotics.alloy.utils

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/Angle.html b/docs/javadoc/org/montclairrobotics/alloy/vector/Angle.html new file mode 100644 index 0000000..c744c04 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/Angle.html @@ -0,0 +1,476 @@ + + + + + +Angle + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.vector
+

Class Angle

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.vector.Angle
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class Angle
    +extends java.lang.Object
    +
    Created by MHS Robotics on 11/13/2017. + +

    The angle class allows for easy management of angles as well as easy conversion between degree + and radian angle measure The class keeps track of the angle in degrees but can easily be + converted to radians

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      AngleZERO 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      Angle(org.montclairrobotics.alloy.vector.Angle.AngleMeasure angleMeasure, + double angle) +
      Creating a new angle with an angle measure unit and the measure of the angle itself
      +
      Angle(double degrees) +
      Creating an angle with degrees
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      doublecos() +
      get the cosine of the angle
      +
      doublegetDegrees() +
      Get the angle measure in degrees
      +
      doublegetRadians() +
      Get the angle measure in radians
      +
      voidsetDegrees(double degrees) +
      set the angle in degrees
      +
      voidsetRadians(double radians) +
      set the angle in radians
      +
      doublesin() +
      get the sine of the angle
      +
      doubletan() +
      get the tangent of the angle
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        ZERO

        +
        public final Angle ZERO
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Angle

        +
        public Angle(org.montclairrobotics.alloy.vector.Angle.AngleMeasure angleMeasure,
        +             double angle)
        +
        Creating a new angle with an angle measure unit and the measure of the angle itself
        +
        +
        Parameters:
        +
        angleMeasure - What unit to be used for the angle measure
        +
        angle - The angle
        +
        +
      • +
      + + + +
        +
      • +

        Angle

        +
        public Angle(double degrees)
        +
        Creating an angle with degrees
        +
        +
        Parameters:
        +
        degrees - Degree angle measure
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDegrees

        +
        public double getDegrees()
        +
        Get the angle measure in degrees
        +
        +
        Returns:
        +
        the degree angle measure
        +
        +
      • +
      + + + +
        +
      • +

        getRadians

        +
        public double getRadians()
        +
        Get the angle measure in radians
        +
        +
        Returns:
        +
        the radian angle measure
        +
        +
      • +
      + + + +
        +
      • +

        setDegrees

        +
        public void setDegrees(double degrees)
        +
        set the angle in degrees
        +
        +
        Parameters:
        +
        degrees - the degree angle measure
        +
        +
      • +
      + + + +
        +
      • +

        setRadians

        +
        public void setRadians(double radians)
        +
        set the angle in radians
        +
        +
        Parameters:
        +
        radians - the degree angle measure
        +
        +
      • +
      + + + +
        +
      • +

        sin

        +
        public double sin()
        +
        get the sine of the angle
        +
        +
        Returns:
        +
        the sine of the angle
        +
        +
      • +
      + + + +
        +
      • +

        cos

        +
        public double cos()
        +
        get the cosine of the angle
        +
        +
        Returns:
        +
        the cosine of the angle
        +
        +
      • +
      + + + +
        +
      • +

        tan

        +
        public double tan()
        +
        get the tangent of the angle
        +
        +
        Returns:
        +
        the tangent of the angle
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/Polar.html b/docs/javadoc/org/montclairrobotics/alloy/vector/Polar.html new file mode 100644 index 0000000..4cd55a8 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/Polar.html @@ -0,0 +1,729 @@ + + + + + +Polar + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.vector
+

Class Polar

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.vector.Polar
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Vector
    +
    +
    +
    +
    public class Polar
    +extends java.lang.Object
    +implements Vector
    +
    Created by MHS Robotics on 11/14/2017. + +

    A vector can be defined in rectangular(XY), or polar form.
    + This class is implementation for vectors in Polar form
    + It controls the conversions from rectangular to polar and vice versa + +

    https://en.wikipedia.org/wiki/Vector_notation

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    See Also:
    +
    Vector
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Polar(double magnitude, + Angle angle) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      Vectoradd(Vector vector) +
      Adds two vectors together and returns the result
      +
      AngleangleBetween(Vector vector) +
      gets the angle between two vectors
      +
      Vectorcopy() +
      Creates a copy of the vector
      +
      doublecross(Vector vector) +
      Returns the product of two vectors that have been crossed
      +
      doubledot(Vector vector) +
      Returns the dot product of two vectors
      +
      AnglegetAngle() +
      Gets the angle in standard position that the vector makes
      +
      doublegetManitude() +
      Gets the magnitude of the vector
      +
      doublegetX() +
      Gets the X component of the vector
      +
      doublegetY() +
      Gets the Y component of the vector
      +
      Vectornormalize() +
      Normalizes a vector and returns the result
      +
      Vectorrotate(Angle angle) +
      returns a vector rotated by a given angle
      +
      Vectorscale(double scalar) +
      Scales the vectors magnitude by a scalar value
      +
      voidsetAngle(Angle angle) +
      Sets the angle in standard position of the vector
      +
      voidsetMagnitude(double magnitude) +
      Sets the magnitude of the vector
      +
      voidsetX(double x) +
      Sets the x component of the vector
      +
      voidsetY(double y) +
      Sets the y component of the vector
      +
      Vectorsubtract(Vector vector) +
      Subtracts a vector and returns the result
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Polar

        +
        public Polar(double magnitude,
        +             Angle angle)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getX

        +
        public double getX()
        +
        Gets the X component of the vector
        +
        +
        Specified by:
        +
        getX in interface Vector
        +
        Returns:
        +
        the X component of the vector
        +
        +
      • +
      + + + +
        +
      • +

        setX

        +
        public void setX(double x)
        +
        Sets the x component of the vector
        +
        +
        Specified by:
        +
        setX in interface Vector
        +
        Parameters:
        +
        x - what the x value will be set to
        +
        +
      • +
      + + + +
        +
      • +

        getY

        +
        public double getY()
        +
        Gets the Y component of the vector
        +
        +
        Specified by:
        +
        getY in interface Vector
        +
        Returns:
        +
        the Y component of the vector
        +
        +
      • +
      + + + +
        +
      • +

        setY

        +
        public void setY(double y)
        +
        Sets the y component of the vector
        +
        +
        Specified by:
        +
        setY in interface Vector
        +
        Parameters:
        +
        y - what the y value will be set to
        +
        +
      • +
      + + + +
        +
      • +

        getManitude

        +
        public double getManitude()
        +
        Gets the magnitude of the vector
        +
        +
        Specified by:
        +
        getManitude in interface Vector
        +
        Returns:
        +
        the magnitude of the vector
        +
        +
      • +
      + + + +
        +
      • +

        setMagnitude

        +
        public void setMagnitude(double magnitude)
        +
        Sets the magnitude of the vector
        +
        +
        Specified by:
        +
        setMagnitude in interface Vector
        +
        Parameters:
        +
        magnitude - what the magnitude will be set to
        +
        +
      • +
      + + + +
        +
      • +

        getAngle

        +
        public Angle getAngle()
        +
        Gets the angle in standard position that the vector makes
        +
        +
        Specified by:
        +
        getAngle in interface Vector
        +
        Returns:
        +
        the angle in standard position that the vector makes
        +
        +
      • +
      + + + +
        +
      • +

        setAngle

        +
        public void setAngle(Angle angle)
        +
        Sets the angle in standard position of the vector
        +
        +
        Specified by:
        +
        setAngle in interface Vector
        +
        Parameters:
        +
        angle - what the angle will be set to
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public Vector add(Vector vector)
        +
        Adds two vectors together and returns the result + +

        + +

        The result of a vector addition will be another vector, One way of adding two vectors + together is splitting it up into it's x and y components and adding them together and making + a new vector out of those components
        + EX:
        + V1 = 3i + 4j
        + V2 = 7i + 5j
        +
        + V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
        + Geometric Visualization:
        + Vectors can also be added in a geometric way through the "Tip-To-Tail" method, In this method + both the vectors are drawn using arrow vector notation + https://en.wikipedia.org/wiki/Vector_notation one vector is then drawn at the + edge of the first vector. The resultant vector is then drawn from the start of the first + vector to the tip of the second vector This is where the name tip to tail comes from + +

        +
        +
        Specified by:
        +
        add in interface Vector
        +
        Parameters:
        +
        vector - The vector to be added
        +
        Returns:
        +
        The result of the two vectors being added
        +
        +
      • +
      + + + +
        +
      • +

        subtract

        +
        public Vector subtract(Vector vector)
        +
        Subtracts a vector and returns the result + +

        + +

        vector subtraction is similar to vector addition but the direction of the vector being + subtracted is simply reversed
        + EX:
        + V1 = 3i + 4j
        + V2 = 7i + 5j
        +
        + V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
        + V1 - V2 = 3i + (-7i) + 4j + (-5j) = -4i + -j

        +
        +
        Specified by:
        +
        subtract in interface Vector
        +
        Parameters:
        +
        vector - The vector to be subtracted
        +
        Returns:
        +
        The result of the passed in vector being subtracted from the vector object
        +
        +
      • +
      + + + +
        +
      • +

        scale

        +
        public Vector scale(double scalar)
        +
        Scales the vectors magnitude by a scalar value
        +
        +
        Specified by:
        +
        scale in interface Vector
        +
        Parameters:
        +
        scalar - double to scale the vector by
        +
        Returns:
        +
        The result of the vector being
        +
        +
      • +
      + + + +
        +
      • +

        cross

        +
        public double cross(Vector vector)
        +
        Returns the product of two vectors that have been crossed + +

        + +

        The result of the cross product is a vector, The cross product of a vector is the vector + that is perpendicular to both vectors When crossing two 2dimensional vectors the result will + be a 3dimensional vector Because of this this method only returns the magnitude (Z component) + of the cross product The magnitude of the cross product is same as the area of the + parallelogram that the two vectors make in the X/Y plane.
        + https://en.wikipedia.org/wiki/Cross_product

        +
        +
        Specified by:
        +
        cross in interface Vector
        +
        Parameters:
        +
        vector - the vector to be multiplied using the cross product
        +
        Returns:
        +
        the magnitude of the cross product of the two vectors
        +
        +
      • +
      + + + +
        +
      • +

        dot

        +
        public double dot(Vector vector)
        +
        Returns the dot product of two vectors + +

        + +

        The result of the dot product is a scalar value (number), The dot product can be viewed as + the projection of one vector on to another times the magnitude of the original vector
        + This can be written mathematically as |A||B|cos(theta), where theta is the angle between A + and B Another mathematical representation of the dot product using its components is:
        + A = <a1, a2>
        + B = <b1, b2>
        + A . B = a1*b1 + a2*b2
        + https://en.wikipedia.org/wiki/Dot_product

        +
        +
        Specified by:
        +
        dot in interface Vector
        +
        Parameters:
        +
        vector - The vector to be multiplied using the dot product
        +
        Returns:
        +
        the scalar result of the dot of the two vectors
        +
        +
      • +
      + + + +
        +
      • +

        rotate

        +
        public Vector rotate(Angle angle)
        +
        returns a vector rotated by a given angle
        +
        +
        Specified by:
        +
        rotate in interface Vector
        +
        Parameters:
        +
        angle - the angle that the vector is to be rotated by
        +
        Returns:
        +
        the result of the rotated vector
        +
        +
      • +
      + + + +
        +
      • +

        angleBetween

        +
        public Angle angleBetween(Vector vector)
        +
        gets the angle between two vectors
        +
        +
        Specified by:
        +
        angleBetween in interface Vector
        +
        Parameters:
        +
        vector - the vector that will be used to find the angle between
        +
        Returns:
        +
        the angle between the vectors
        +
        +
      • +
      + + + +
        +
      • +

        normalize

        +
        public Vector normalize()
        +
        Normalizes a vector and returns the result + +

        + +

        A normalized vector is a vector with magnitude 1. Normalized vectors are also called unit + vectors. A normalized vector keeps it's direction as well as the same proportions of its + components. When a vector is defined by its components it can be normalized it can be + expressed as
        + A = <a1, a2>
        + A' = <a1/|A|, a2/|A|>

        +
        +
        Specified by:
        +
        normalize in interface Vector
        +
        Returns:
        +
        the normalized vector
        +
        +
      • +
      + + + +
        +
      • +

        copy

        +
        public Vector copy()
        +
        Creates a copy of the vector
        +
        +
        Specified by:
        +
        copy in interface Vector
        +
        Returns:
        +
        a copy of the vector
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/Vector.html b/docs/javadoc/org/montclairrobotics/alloy/vector/Vector.html new file mode 100644 index 0000000..491799d --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/Vector.html @@ -0,0 +1,641 @@ + + + + + +Vector + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.vector
+

Interface Vector

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    Polar, XY
    +
    +
    +
    +
    public interface Vector
    +
    Created by MHS Robotics on 11/14/2017.
    +
    + Interface for creating vector classes, implemented in vector.XY and vector.Polar
    +
    + Since a 2D vector can be made up of an angle and a Magnitude or it's vector components (XY) The + vector interface contains all functionality that a vector should have and it is then implemented + in each vector subclass
    +
    + NOTE: No mathematical operations are performed on the vector but return a new vector that is the + result of the operation
    +
    + To read more about vectors see here https://en.wikipedia.org/wiki/Euclidean_vector +
    + To read more about dot products see here https://en.wikipedia.org/wiki/Dot_product +
    + To read more about cross products see here + https://en.wikipedia.org/wiki/Cross_product
    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    See Also:
    +
    Polar, +XY
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      Vectoradd(Vector vector) +
      Adds two vectors together and returns the result
      +
      AngleangleBetween(Vector vector) +
      gets the angle between two vectors
      +
      Vectorcopy() +
      Creates a copy of the vector
      +
      doublecross(Vector vector) +
      Returns the product of two vectors that have been crossed
      +
      doubledot(Vector vector) +
      Returns the dot product of two vectors
      +
      AnglegetAngle() +
      Gets the angle in standard position that the vector makes
      +
      doublegetManitude() +
      Gets the magnitude of the vector
      +
      doublegetX() +
      Gets the X component of the vector
      +
      doublegetY() +
      Gets the Y component of the vector
      +
      Vectornormalize() +
      Normalizes a vector and returns the result
      +
      Vectorrotate(Angle angle) +
      returns a vector rotated by a given angle
      +
      Vectorscale(double scalar) +
      Scales the vectors magnitude by a scalar value
      +
      voidsetAngle(Angle angle) +
      Sets the angle in standard position of the vector
      +
      voidsetMagnitude(double magnitude) +
      Sets the magnitude of the vector
      +
      voidsetX(double x) +
      Sets the x component of the vector
      +
      voidsetY(double y) +
      Sets the y component of the vector
      +
      Vectorsubtract(Vector vector) +
      Subtracts a vector and returns the result
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getX

        +
        double getX()
        +
        Gets the X component of the vector
        +
        +
        Returns:
        +
        the X component of the vector
        +
        +
      • +
      + + + +
        +
      • +

        setX

        +
        void setX(double x)
        +
        Sets the x component of the vector
        +
        +
        Parameters:
        +
        x - what the x value will be set to
        +
        +
      • +
      + + + +
        +
      • +

        getY

        +
        double getY()
        +
        Gets the Y component of the vector
        +
        +
        Returns:
        +
        the Y component of the vector
        +
        +
      • +
      + + + +
        +
      • +

        setY

        +
        void setY(double y)
        +
        Sets the y component of the vector
        +
        +
        Parameters:
        +
        y - what the y value will be set to
        +
        +
      • +
      + + + +
        +
      • +

        getManitude

        +
        double getManitude()
        +
        Gets the magnitude of the vector
        +
        +
        Returns:
        +
        the magnitude of the vector
        +
        +
      • +
      + + + +
        +
      • +

        setMagnitude

        +
        void setMagnitude(double magnitude)
        +
        Sets the magnitude of the vector
        +
        +
        Parameters:
        +
        magnitude - what the magnitude will be set to
        +
        +
      • +
      + + + +
        +
      • +

        getAngle

        +
        Angle getAngle()
        +
        Gets the angle in standard position that the vector makes
        +
        +
        Returns:
        +
        the angle in standard position that the vector makes
        +
        +
      • +
      + + + +
        +
      • +

        setAngle

        +
        void setAngle(Angle angle)
        +
        Sets the angle in standard position of the vector
        +
        +
        Parameters:
        +
        angle - what the angle will be set to
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        Vector add(Vector vector)
        +
        Adds two vectors together and returns the result + +

        The result of a vector addition will be another vector, One way of adding two vectors + together is splitting it up into it's x and y components and adding them together and making + a new vector out of those components
        + EX:
        + V1 = 3i + 4j
        + V2 = 7i + 5j
        +
        + V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
        + Geometric Visualization:
        + Vectors can also be added in a geometric way through the "Tip-To-Tail" method, In this method + both the vectors are drawn using arrow vector notation + https://en.wikipedia.org/wiki/Vector_notation one vector is then drawn at the + edge of the first vector. The resultant vector is then drawn from the start of the first + vector to the tip of the second vector This is where the name tip to tail comes from

        +
        +
        Parameters:
        +
        vector - The vector to be added
        +
        Returns:
        +
        The result of the two vectors being added
        +
        +
      • +
      + + + +
        +
      • +

        subtract

        +
        Vector subtract(Vector vector)
        +
        Subtracts a vector and returns the result + +

        vector subtraction is similar to vector addition but the direction of the vector being + subtracted is simply reversed
        + EX:
        + V1 = 3i + 4j
        + V2 = 7i + 5j
        +
        + V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
        + V1 - V2 = 3i + (-7i) + 4j + (-5j) = -4i + -j

        +
        +
        Parameters:
        +
        vector - The vector to be subtracted
        +
        Returns:
        +
        The result of the passed in vector being subtracted from the vector object
        +
        +
      • +
      + + + +
        +
      • +

        scale

        +
        Vector scale(double scalar)
        +
        Scales the vectors magnitude by a scalar value
        +
        +
        Parameters:
        +
        scalar - double to scale the vector by
        +
        Returns:
        +
        The result of the vector being
        +
        +
      • +
      + + + +
        +
      • +

        cross

        +
        double cross(Vector vector)
        +
        Returns the product of two vectors that have been crossed + +

        The result of the cross product is a vector, The cross product of a vector is the vector + that is perpendicular to both vectors When crossing two 2dimensional vectors the result will + be a 3dimensional vector Because of this this method only returns the magnitude (Z component) + of the cross product The magnitude of the cross product is same as the area of the + parallelogram that the two vectors make in the X/Y plane.
        + https://en.wikipedia.org/wiki/Cross_product

        +
        +
        Parameters:
        +
        vector - the vector to be multiplied using the cross product
        +
        Returns:
        +
        the magnitude of the cross product of the two vectors
        +
        +
      • +
      + + + +
        +
      • +

        dot

        +
        double dot(Vector vector)
        +
        Returns the dot product of two vectors + +

        The result of the dot product is a scalar value (number), The dot product can be viewed as + the projection of one vector on to another times the magnitude of the original vector
        + This can be written mathematically as |A||B|cos(theta), where theta is the angle between A + and B Another mathematical representation of the dot product using its components is:
        + A = <a1, a2>
        + B = <b1, b2>
        + A . B = <a1*b1, a2*b2>
        + https://en.wikipedia.org/wiki/Dot_product

        +
        +
        Parameters:
        +
        vector - The vector to be multiplied using the dot product
        +
        Returns:
        +
        the scalar result of the dot of the two vectors
        +
        +
      • +
      + + + +
        +
      • +

        rotate

        +
        Vector rotate(Angle angle)
        +
        returns a vector rotated by a given angle
        +
        +
        Parameters:
        +
        angle - the angle that the vector is to be rotated by
        +
        Returns:
        +
        the result of the rotated vector
        +
        +
      • +
      + + + +
        +
      • +

        angleBetween

        +
        Angle angleBetween(Vector vector)
        +
        gets the angle between two vectors
        +
        +
        Parameters:
        +
        vector - the vector that will be used to find the angle between
        +
        Returns:
        +
        the angle between the vectors
        +
        +
      • +
      + + + +
        +
      • +

        normalize

        +
        Vector normalize()
        +
        Normalizes a vector and returns the result + +

        A normalized vector is a vector with magnitude 1. Normalized vectors are also called unit + vectors. A normalized vector keeps it's direction as well as the same proportions of its + components. When a vector is defined by its components it can be normalized it can be + expressed as
        + A = <a1, a2>
        + A' = <a1/|A|, a2/|A|>

        +
        +
        Returns:
        +
        the normalized vector
        +
        +
      • +
      + + + +
        +
      • +

        copy

        +
        Vector copy()
        +
        Creates a copy of the vector
        +
        +
        Returns:
        +
        a copy of the vector
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/XY.html b/docs/javadoc/org/montclairrobotics/alloy/vector/XY.html new file mode 100644 index 0000000..444da0b --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/XY.html @@ -0,0 +1,741 @@ + + + + + +XY + + + + + + + + + + + + +
+
org.montclairrobotics.alloy.vector
+

Class XY

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.montclairrobotics.alloy.vector.XY
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Vector
    +
    +
    +
    +
    public class XY
    +extends java.lang.Object
    +implements Vector
    +
    Created by MHS Robotics on 11/14/2017. + +

    A vector can be defined in rectangular(XY), or polar form.
    + This class is implementation for vectors in XY form
    + It controls the conversions from rectangular to polar and vice versa + +

    https://en.wikipedia.org/wiki/Vector_notation

    +
    +
    Since:
    +
    0.1
    +
    Version:
    +
    0.1
    +
    Author:
    +
    Garrett Burroughs
    +
    See Also:
    +
    Vector
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      XY(double x, + double y) 
      XY(XY vector) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      Vectoradd(Vector vector) +
      Adds two vectors together and returns the result
      +
      AngleangleBetween(Vector vector) +
      gets the angle between two vectors
      +
      Vectorcopy() +
      Creates a copy of the vector
      +
      doublecross(Vector vector) +
      Returns the product of two vectors that have been crossed
      +
      doubledot(Vector vector) +
      Returns the dot product of two vectors
      +
      AnglegetAngle() +
      Gets the angle in standard position that the vector makes
      +
      doublegetManitude() +
      Gets the magnitude of the vector
      +
      doublegetX() +
      Gets the X component of the vector
      +
      doublegetY() +
      Gets the Y component of the vector
      +
      Vectornormalize() +
      Normalizes a vector and returns the result
      +
      Vectorrotate(Angle angle) +
      returns a vector rotated by a given angle
      +
      Vectorscale(double scalar) +
      Scales the vectors magnitude by a scalar value
      +
      voidsetAngle(Angle angle) +
      Sets the angle in standard position of the vector
      +
      voidsetMagnitude(double magnitude) +
      Sets the magnitude of the vector
      +
      voidsetX(double x) +
      Sets the x component of the vector
      +
      voidsetY(double y) +
      Sets the y component of the vector
      +
      Vectorsubtract(Vector vector) +
      Subtracts a vector and returns the result
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        XY

        +
        public XY(double x,
        +          double y)
        +
      • +
      + + + +
        +
      • +

        XY

        +
        public XY(XY vector)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getX

        +
        public double getX()
        +
        Gets the X component of the vector
        +
        +
        Specified by:
        +
        getX in interface Vector
        +
        Returns:
        +
        the X component of the vector
        +
        +
      • +
      + + + +
        +
      • +

        setX

        +
        public void setX(double x)
        +
        Sets the x component of the vector
        +
        +
        Specified by:
        +
        setX in interface Vector
        +
        Parameters:
        +
        x - what the x value will be set to
        +
        +
      • +
      + + + +
        +
      • +

        getY

        +
        public double getY()
        +
        Gets the Y component of the vector
        +
        +
        Specified by:
        +
        getY in interface Vector
        +
        Returns:
        +
        the Y component of the vector
        +
        +
      • +
      + + + +
        +
      • +

        setY

        +
        public void setY(double y)
        +
        Sets the y component of the vector
        +
        +
        Specified by:
        +
        setY in interface Vector
        +
        Parameters:
        +
        y - what the y value will be set to
        +
        +
      • +
      + + + +
        +
      • +

        getManitude

        +
        public double getManitude()
        +
        Gets the magnitude of the vector
        +
        +
        Specified by:
        +
        getManitude in interface Vector
        +
        Returns:
        +
        the magnitude of the vector
        +
        +
      • +
      + + + +
        +
      • +

        setMagnitude

        +
        public void setMagnitude(double magnitude)
        +
        Sets the magnitude of the vector
        +
        +
        Specified by:
        +
        setMagnitude in interface Vector
        +
        Parameters:
        +
        magnitude - what the magnitude will be set to
        +
        +
      • +
      + + + +
        +
      • +

        getAngle

        +
        public Angle getAngle()
        +
        Gets the angle in standard position that the vector makes
        +
        +
        Specified by:
        +
        getAngle in interface Vector
        +
        Returns:
        +
        the angle in standard position that the vector makes
        +
        +
      • +
      + + + +
        +
      • +

        setAngle

        +
        public void setAngle(Angle angle)
        +
        Sets the angle in standard position of the vector
        +
        +
        Specified by:
        +
        setAngle in interface Vector
        +
        Parameters:
        +
        angle - what the angle will be set to
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public Vector add(Vector vector)
        +
        Adds two vectors together and returns the result + +

        + +

        The result of a vector addition will be another vector, One way of adding two vectors + together is splitting it up into it's x and y components and adding them together and making + a new vector out of those components
        + EX:
        + V1 = 3i + 4j
        + V2 = 7i + 5j
        +
        + V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
        + Geometric Visualization:
        + Vectors can also be added in a geometric way through the "Tip-To-Tail" method, In this method + both the vectors are drawn using arrow vector notation + https://en.wikipedia.org/wiki/Vector_notation one vector is then drawn at the + edge of the first vector. The resultant vector is then drawn from the start of the first + vector to the tip of the second vector This is where the name tip to tail comes from + +

        +
        +
        Specified by:
        +
        add in interface Vector
        +
        Parameters:
        +
        vector - The vector to be added
        +
        Returns:
        +
        The result of the two vectors being added
        +
        +
      • +
      + + + +
        +
      • +

        subtract

        +
        public Vector subtract(Vector vector)
        +
        Subtracts a vector and returns the result + +

        + +

        vector subtraction is similar to vector addition but the direction of the vector being + subtracted is simply reversed
        + EX:
        + V1 = 3i + 4j
        + V2 = 7i + 5j
        +
        + V1 + V2 = 3i + 7i + 4j + 5j = 10i + 9j
        + V1 - V2 = 3i + (-7i) + 4j + (-5j) = -4i + -j

        +
        +
        Specified by:
        +
        subtract in interface Vector
        +
        Parameters:
        +
        vector - The vector to be subtracted
        +
        Returns:
        +
        The result of the passed in vector being subtracted from the vector object
        +
        +
      • +
      + + + +
        +
      • +

        scale

        +
        public Vector scale(double scalar)
        +
        Scales the vectors magnitude by a scalar value
        +
        +
        Specified by:
        +
        scale in interface Vector
        +
        Parameters:
        +
        scalar - double to scale the vector by
        +
        Returns:
        +
        The result of the vector being
        +
        +
      • +
      + + + +
        +
      • +

        cross

        +
        public double cross(Vector vector)
        +
        Returns the product of two vectors that have been crossed + +

        + +

        The result of the cross product is a vector, The cross product of a vector is the vector + that is perpendicular to both vectors When crossing two 2dimensional vectors the result will + be a 3dimensional vector Because of this this method only returns the magnitude (Z component) + of the cross product The magnitude of the cross product is same as the area of the + parallelogram that the two vectors make in the X/Y plane.
        + https://en.wikipedia.org/wiki/Cross_product

        +
        +
        Specified by:
        +
        cross in interface Vector
        +
        Parameters:
        +
        vector - the vector to be multiplied using the cross product
        +
        Returns:
        +
        the magnitude of the cross product of the two vectors
        +
        +
      • +
      + + + +
        +
      • +

        dot

        +
        public double dot(Vector vector)
        +
        Returns the dot product of two vectors + +

        + +

        The result of the dot product is a scalar value (number), The dot product can be viewed as + the projection of one vector on to another times the magnitude of the original vector
        + This can be written mathematically as |A||B|cos(theta), where theta is the angle between A + and B Another mathematical representation of the dot product using its components is:
        + A = <a1, a2>
        + B = <b1, b2>
        + A . B = <a1*b1, a2*b2>
        + https://en.wikipedia.org/wiki/Dot_product

        +
        +
        Specified by:
        +
        dot in interface Vector
        +
        Parameters:
        +
        vector - The vector to be multiplied using the dot product
        +
        Returns:
        +
        the scalar result of the dot of the two vectors
        +
        +
      • +
      + + + +
        +
      • +

        rotate

        +
        public Vector rotate(Angle angle)
        +
        returns a vector rotated by a given angle
        +
        +
        Specified by:
        +
        rotate in interface Vector
        +
        Parameters:
        +
        angle - the angle that the vector is to be rotated by
        +
        Returns:
        +
        the result of the rotated vector
        +
        +
      • +
      + + + +
        +
      • +

        angleBetween

        +
        public Angle angleBetween(Vector vector)
        +
        gets the angle between two vectors
        +
        +
        Specified by:
        +
        angleBetween in interface Vector
        +
        Parameters:
        +
        vector - the vector that will be used to find the angle between
        +
        Returns:
        +
        the angle between the vectors
        +
        +
      • +
      + + + +
        +
      • +

        normalize

        +
        public Vector normalize()
        +
        Normalizes a vector and returns the result + +

        + +

        A normalized vector is a vector with magnitude 1. Normalized vectors are also called unit + vectors. A normalized vector keeps it's direction as well as the same proportions of its + components. When a vector is defined by its components it can be normalized it can be + expressed as
        + A = <a1, a2>
        + A' = <a1/|A|, a2/|A|>

        +
        +
        Specified by:
        +
        normalize in interface Vector
        +
        Returns:
        +
        the normalized vector
        +
        +
      • +
      + + + +
        +
      • +

        copy

        +
        public Vector copy()
        +
        Creates a copy of the vector
        +
        +
        Specified by:
        +
        copy in interface Vector
        +
        Returns:
        +
        a copy of the vector
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Angle.html b/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Angle.html new file mode 100644 index 0000000..f0a4cae --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Angle.html @@ -0,0 +1,266 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.vector.Angle + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.vector.Angle

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Polar.html b/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Polar.html new file mode 100644 index 0000000..d2423fb --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Polar.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.vector.Polar + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.vector.Polar

+
+
No usage of org.montclairrobotics.alloy.vector.Polar
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Vector.html b/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Vector.html new file mode 100644 index 0000000..1792fa7 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/Vector.html @@ -0,0 +1,434 @@ + + + + + +Uses of Interface org.montclairrobotics.alloy.vector.Vector + + + + + + + + + + + +
+

Uses of Interface
org.montclairrobotics.alloy.vector.Vector

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/XY.html b/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/XY.html new file mode 100644 index 0000000..c5fcdfb --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/class-use/XY.html @@ -0,0 +1,162 @@ + + + + + +Uses of Class org.montclairrobotics.alloy.vector.XY + + + + + + + + + + + +
+

Uses of Class
org.montclairrobotics.alloy.vector.XY

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/vector/package-frame.html new file mode 100644 index 0000000..b589994 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/package-frame.html @@ -0,0 +1,26 @@ + + + + + +org.montclairrobotics.alloy.vector + + + + + +

org.montclairrobotics.alloy.vector

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/vector/package-summary.html new file mode 100644 index 0000000..d82bafb --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/package-summary.html @@ -0,0 +1,173 @@ + + + + + +org.montclairrobotics.alloy.vector + + + + + + + + + + + +
+

Package org.montclairrobotics.alloy.vector

+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    Vector +
    Created by MHS Robotics on 11/14/2017.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Angle +
    Created by MHS Robotics on 11/13/2017.
    +
    Polar +
    Created by MHS Robotics on 11/14/2017.
    +
    XY +
    Created by MHS Robotics on 11/14/2017.
    +
    +
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/package-tree.html b/docs/javadoc/org/montclairrobotics/alloy/vector/package-tree.html new file mode 100644 index 0000000..7788a4d --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/package-tree.html @@ -0,0 +1,143 @@ + + + + + +org.montclairrobotics.alloy.vector Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.montclairrobotics.alloy.vector

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • org.montclairrobotics.alloy.vector.Angle
    • +
    • org.montclairrobotics.alloy.vector.Polar (implements org.montclairrobotics.alloy.vector.Vector)
    • +
    • org.montclairrobotics.alloy.vector.XY (implements org.montclairrobotics.alloy.vector.Vector)
    • +
    +
  • +
+

Interface Hierarchy

+
    +
  • org.montclairrobotics.alloy.vector.Vector
  • +
+
+ + + + + + diff --git a/docs/javadoc/org/montclairrobotics/alloy/vector/package-use.html b/docs/javadoc/org/montclairrobotics/alloy/vector/package-use.html new file mode 100644 index 0000000..3aeca28 --- /dev/null +++ b/docs/javadoc/org/montclairrobotics/alloy/vector/package-use.html @@ -0,0 +1,211 @@ + + + + + +Uses of Package org.montclairrobotics.alloy.vector + + + + + + + + + + + +
+

Uses of Package
org.montclairrobotics.alloy.vector

+
+
+ +
+ + + + + + diff --git a/docs/javadoc/overview-frame.html b/docs/javadoc/overview-frame.html new file mode 100644 index 0000000..ebe53c5 --- /dev/null +++ b/docs/javadoc/overview-frame.html @@ -0,0 +1,29 @@ + + + + + +Overview List + + + + + + + +

 

+ + diff --git a/docs/javadoc/overview-summary.html b/docs/javadoc/overview-summary.html new file mode 100644 index 0000000..ffd53a1 --- /dev/null +++ b/docs/javadoc/overview-summary.html @@ -0,0 +1,167 @@ + + + + + +Overview + + + + + + + + +
+ + + + + + + +
+ + + + +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/overview-tree.html b/docs/javadoc/overview-tree.html new file mode 100644 index 0000000..14cb54b --- /dev/null +++ b/docs/javadoc/overview-tree.html @@ -0,0 +1,217 @@ + + + + + +Class Hierarchy + + + + + + + + +
+ + + + + + + +
+ + + +
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • org.montclairrobotics.alloy.vector.Angle
    • +
    • org.montclairrobotics.alloy.control.ButtonAction + +
    • +
    • org.montclairrobotics.alloy.drive.DriveTrain
    • +
    • org.montclairrobotics.alloy.ftc.FTCButton (implements org.montclairrobotics.alloy.core.Button)
    • +
    • org.montclairrobotics.alloy.ftc.FTCDebug (implements org.montclairrobotics.alloy.core.Debug)
    • +
    • org.montclairrobotics.alloy.ftc.FTCJoystick (implements org.montclairrobotics.alloy.core.Joystick)
    • +
    • org.montclairrobotics.alloy.ftc.FTCMotor (implements org.montclairrobotics.alloy.core.Motor) + +
    • +
    • com.qualcomm.robotcore.eventloop.opmode.OpMode + +
    • +
    • org.montclairrobotics.alloy.utils.PID (implements org.montclairrobotics.alloy.utils.Input<T>)
    • +
    • org.montclairrobotics.alloy.vector.Polar (implements org.montclairrobotics.alloy.vector.Vector)
    • +
    • org.montclairrobotics.alloy.core.RobotCore
    • +
    • org.montclairrobotics.alloy.auto.State + +
    • +
    • org.montclairrobotics.alloy.utils.Toggleable +
        +
      • org.montclairrobotics.alloy.test.Shooter
      • +
      +
    • +
    • org.montclairrobotics.alloy.utils.TuneablePID
    • +
    • org.montclairrobotics.alloy.update.Updatable
    • +
    • org.montclairrobotics.alloy.update.Updater
    • +
    • org.montclairrobotics.alloy.vector.XY (implements org.montclairrobotics.alloy.vector.Vector)
    • +
    +
  • +
+

Interface Hierarchy

+
    +
  • org.montclairrobotics.alloy.core.Button
  • +
  • org.montclairrobotics.alloy.core.Debug
  • +
  • org.montclairrobotics.alloy.drive.DTMapper
  • +
  • org.montclairrobotics.alloy.utils.Input<T>
  • +
  • org.montclairrobotics.alloy.core.Joystick
  • +
  • org.montclairrobotics.alloy.core.Motor + +
  • +
  • org.montclairrobotics.alloy.vector.Vector
  • +
+

Annotation Type Hierarchy

+
    +
  • org.montclairrobotics.alloy.update.Update (implements java.lang.annotation.Annotation)
  • +
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/package-list b/docs/javadoc/package-list new file mode 100644 index 0000000..4fe674f --- /dev/null +++ b/docs/javadoc/package-list @@ -0,0 +1,9 @@ +org.montclairrobotics.alloy.auto +org.montclairrobotics.alloy.control +org.montclairrobotics.alloy.core +org.montclairrobotics.alloy.drive +org.montclairrobotics.alloy.ftc +org.montclairrobotics.alloy.test +org.montclairrobotics.alloy.update +org.montclairrobotics.alloy.utils +org.montclairrobotics.alloy.vector diff --git a/docs/javadoc/script.js b/docs/javadoc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/docs/javadoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/docs/javadoc/stylesheet.css b/docs/javadoc/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/docs/javadoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/docs/readme.md b/docs/readme.md new file mode 100644 index 0000000..2b1f5d9 --- /dev/null +++ b/docs/readme.md @@ -0,0 +1,21 @@ +# Alloy + +version: 0.0.1 + + +See the full documentation [Here]() + + +## What is alloy + +## Getting started + +## Essentials + + +## Wiki + +The Wiki contains a large amount of information, examples, +tutorials and explanations about creating a robot with alloy. It +is highly suggested reading it to get the most out of alloy as possible +[Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) \ No newline at end of file From ffa498d648e114785a566de7dd185366c7c25275 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Mon, 6 Aug 2018 17:08:00 -0400 Subject: [PATCH 19/54] Set theme jekyll-theme-merlot --- docs/_config.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/_config.yml diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..c50ff38 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-merlot \ No newline at end of file From 94958181de17e14dcb6b88c6cc7cdb16d9c73b5b Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Mon, 6 Aug 2018 17:11:39 -0400 Subject: [PATCH 20/54] Update readme.md --- docs/readme.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/readme.md b/docs/readme.md index 2b1f5d9..c989d62 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,9 +1,7 @@ -# Alloy - version: 0.0.1 -See the full documentation [Here]() +See the full documentation [Here](https://garrettburroughs.github.io/Alloy/javadoc/) ## What is alloy @@ -18,4 +16,4 @@ See the full documentation [Here]() The Wiki contains a large amount of information, examples, tutorials and explanations about creating a robot with alloy. It is highly suggested reading it to get the most out of alloy as possible -[Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) \ No newline at end of file +[Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) From 5cd0843094b392b215e838513ea7a1261f7873e9 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Mon, 6 Aug 2018 17:14:28 -0400 Subject: [PATCH 21/54] Update readme.md --- docs/readme.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/readme.md b/docs/readme.md index c989d62..b9a0ee9 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -6,8 +6,26 @@ See the full documentation [Here](https://garrettburroughs.github.io/Alloy/javad ## What is alloy +Alloy is a robot framework that redesigns how robot functionality is coded, allowing for more complex systems, while also abstracting +more advanced functionality allowing for easier implementation. + +The goal of Alloy is to provide a robot framework that allows anyone, including new programmers, to be able to implement +high functioning and quality code for their robots. In other terms, Alloy aims to prevent robot code from being a limiting +factor on the performance of the robot. + + +Alloy is a robot framework designed specifically for the First Tech Challenge (FTC), but is also designed +with expandibility in mind. FRC implementation is possible and will be coming in the future. + +Alloy is based off the FRC robot framework [Sprocket](https://github.com/MontclairRobotics/Sprocket), but redesigned to abstract away the more complex ideas but still allow for advanced robot functionality. + +Any information regarding Alloy, including how it works, project structure, as well as in-depth explanation on how to use all of the components +can be found in the project [Wiki](https://github.com/GarrettBurroughs/Alloy/wiki) as well as a [quick start guide](https://github.com/GarrettBurroughs/Alloy/wiki/Getting-Started). + ## Getting started + + ## Essentials From 6963abd71cb5f1ed2efa5046b1a4b8e2e7511944 Mon Sep 17 00:00:00 2001 From: GarrettBurroughs Date: Tue, 7 Aug 2018 16:49:34 -0400 Subject: [PATCH 22/54] fixed bugs --- .../alloy/components/Component.java | 12 +++++++----- .../alloy/utils/TuneablePID.java | 17 +++++++++++++---- .../montclairrobotics/alloy/vector/Vector.java | 2 +- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/montclairrobotics/alloy/components/Component.java b/src/main/java/org/montclairrobotics/alloy/components/Component.java index 4e7b571..fac39f3 100644 --- a/src/main/java/org/montclairrobotics/alloy/components/Component.java +++ b/src/main/java/org/montclairrobotics/alloy/components/Component.java @@ -50,11 +50,15 @@ of this software and associated documentation files (the "Software"), to deal * addint the @Update annotation @Author Garrett Burroughs @Version 0.1 @Since 0.1 */ public abstract class Component extends Toggleable { - + /** The object used for debugging information about all components */ public static Debugger debugger; - private boolean debugMode = true; // - // All components are added to the component arraylist so they can be updated + /** Will debug out information if true */ + private boolean debugMode = true; + /** The debugs that will be printed for this component out each loop */ + private ArrayList debugs; + + /** */ public static ArrayList components; public Component() { @@ -65,8 +69,6 @@ public static ArrayList getComponents() { return components; } - private ArrayList debugs; - public void addDebug(Debug debug) { debugs.add(debug); } diff --git a/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java b/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java index d709d9c..6a119cd 100644 --- a/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java +++ b/src/main/java/org/montclairrobotics/alloy/utils/TuneablePID.java @@ -33,7 +33,7 @@ of this software and associated documentation files (the "Software"), to deal * values at runtime This could be done easily in FRC using smartdashboard or in FTC by using * buttons or joysticks to change values */ -public class TuneablePID extends InputComponent implements ErrorCorrection { +public class TuneablePID extends InputComponent implements ErrorCorrection { /** * Set the input of the error correction the input should be the source of what correction is @@ -42,7 +42,9 @@ public class TuneablePID extends InputComponent implements ErrorCorrecti * @param input the input to the error correction */ @Override - public void setInput(Input input) {} + public TuneablePID setInput(Input input) { + return this; + } /** * Set the target for the correction When the input is equal to the target the error is 0 @@ -50,7 +52,9 @@ public void setInput(Input input) {} * @param target the goal of the error correction */ @Override - public void setTarget(Object target) {} + public TuneablePID setTarget(Double target) { + return this; + } /** * Get the value to apply the correction @@ -58,7 +62,12 @@ public void setTarget(Object target) {} * @return the correction */ @Override - public Object getCorrection() { + public Double getCorrection() { return null; } + + @Override + public ErrorCorrection copy() { + return new TuneablePID(); + } } diff --git a/src/main/java/org/montclairrobotics/alloy/vector/Vector.java b/src/main/java/org/montclairrobotics/alloy/vector/Vector.java index f6cbdd6..de00a6a 100644 --- a/src/main/java/org/montclairrobotics/alloy/vector/Vector.java +++ b/src/main/java/org/montclairrobotics/alloy/vector/Vector.java @@ -48,7 +48,7 @@ of this software and associated documentation files (the "Software"), to deal * @version 0.1 * @since 0.1 */ -public interface Vector extends Comparable { +public interface Vector { Vector ZERO = new XY(0, 0); From 32ae6e432563d68aca5f87245fdaaacaab1b1fc3 Mon Sep 17 00:00:00 2001 From: Garrett Burroughs Date: Fri, 17 Aug 2018 14:45:16 -0400 Subject: [PATCH 23/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2cee1fa..b5d2416 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Alloy  [![Build Status](https://travis-ci.org/GarrettBurroughs/Alloy.svg?branch=master)](https://travis-ci.org/GarrettBurroughs/Alloy) [![CodeFactor](https://www.codefactor.io/repository/github/garrettburroughs/alloy/badge)](https://www.codefactor.io/repository/github/garrettburroughs/alloy) +# Alloy  [![Build Status](https://travis-ci.org/GarrettBurroughs/Alloy.svg?branch=master)](https://travis-ci.org/GarrettBurroughs/Alloy) [![CodeFactor](https://www.codefactor.io/repository/github/garrettburroughs/alloy/badge)](https://www.codefactor.io/repository/github/garrettburroughs/alloy) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f3335dca15a8429ebc50528ca6330411)](https://www.codacy.com/project/garrett_2/Alloy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=GarrettBurroughs/Alloy&utm_campaign=Badge_Grade_Dashboard) ![AlloyLogo](http://gdurl.com/AFl8) From 1836a5c76b31f89c8e18e4055d8582d391a5fb78 Mon Sep 17 00:00:00 2001 From: GarrettBurroughs Date: Fri, 17 Aug 2018 18:13:18 -0400 Subject: [PATCH 24/54] added docs, and improved code quality for codacity's standards --- .idea/compiler.xml | 9 + .idea/modules.xml | 10 + .idea/modules/Alloy.iml | 13 + .idea/modules/Alloy_main.iml | 21 + .idea/modules/Alloy_test.iml | 22 + build.gradle | 2 + docs/javadoc/allclasses-frame.html | 37 +- docs/javadoc/allclasses-noframe.html | 37 +- docs/javadoc/constant-values.html | 4 +- docs/javadoc/deprecated-list.html | 4 +- docs/javadoc/help-doc.html | 4 +- docs/javadoc/index-files/index-1.html | 20 +- docs/javadoc/index-files/index-10.html | 8 +- docs/javadoc/index-files/index-11.html | 24 +- docs/javadoc/index-files/index-12.html | 34 +- docs/javadoc/index-files/index-13.html | 91 ++- docs/javadoc/index-files/index-14.html | 48 +- docs/javadoc/index-files/index-15.html | 64 +- docs/javadoc/index-files/index-16.html | 61 +- docs/javadoc/index-files/index-17.html | 167 +--- docs/javadoc/index-files/index-18.html | 232 +++++- docs/javadoc/index-files/index-19.html | 73 +- docs/javadoc/index-files/index-2.html | 20 +- docs/javadoc/index-files/index-20.html | 52 +- docs/javadoc/index-files/index-21.html | 51 +- docs/javadoc/index-files/index-22.html | 42 +- docs/javadoc/index-files/index-23.html | 26 +- docs/javadoc/index-files/index-24.html | 131 ++++ docs/javadoc/index-files/index-3.html | 44 +- docs/javadoc/index-files/index-4.html | 80 +- docs/javadoc/index-files/index-5.html | 36 +- docs/javadoc/index-files/index-6.html | 33 +- docs/javadoc/index-files/index-7.html | 97 ++- docs/javadoc/index-files/index-8.html | 14 +- docs/javadoc/index-files/index-9.html | 36 +- docs/javadoc/index.html | 2 +- .../alloy/auto/AlloyAutonomous.html | 4 +- .../montclairrobotics/alloy/auto/State.html | 4 +- .../alloy/auto/StateMachine.html | 4 +- .../alloy/auto/class-use/AlloyAutonomous.html | 4 +- .../alloy/auto/class-use/State.html | 4 +- .../alloy/auto/class-use/StateMachine.html | 4 +- .../alloy/auto/package-frame.html | 4 +- .../alloy/auto/package-summary.html | 8 +- .../alloy/auto/package-tree.html | 8 +- .../alloy/auto/package-use.html | 4 +- .../alloy/components/Action.html | 260 +++++++ .../alloy/components/Component.html | 487 ++++++++++++ .../alloy/components/InputComponent.html | 438 +++++++++++ .../alloy/components/Step.html | 227 ++++++ .../alloy/components/class-use/Action.html | 124 +++ .../alloy/components/class-use/Component.html | 342 ++++++++ .../components/class-use/InputComponent.html | 329 ++++++++ .../alloy/components/class-use/Step.html | 225 ++++++ .../alloy/components/package-frame.html | 26 + .../alloy/components/package-summary.html | 167 ++++ .../alloy/components/package-tree.html | 150 ++++ .../alloy/components/package-use.html | 304 ++++++++ .../alloy/control/ButtonAction.html | 4 +- .../alloy/control/ToggleButton.html | 4 +- .../alloy/control/class-use/ButtonAction.html | 4 +- .../alloy/control/class-use/ToggleButton.html | 4 +- .../alloy/control/package-frame.html | 4 +- .../alloy/control/package-summary.html | 8 +- .../alloy/control/package-tree.html | 8 +- .../alloy/control/package-use.html | 4 +- .../montclairrobotics/alloy/core/Alloy.html | 40 +- .../montclairrobotics/alloy/core/Button.html | 8 +- .../montclairrobotics/alloy/core/Debug.html | 192 +++-- .../alloy/core/Debugger.html | 308 ++++++++ .../montclairrobotics/alloy/core/Encoder.html | 516 +++++++++++++ .../alloy/core/Joystick.html | 8 +- .../montclairrobotics/alloy/core/Mode.html | 4 +- .../montclairrobotics/alloy/core/Motor.html | 4 +- .../alloy/core/RobotCore.html | 6 +- .../alloy/core/TargetMotor.html | 8 +- .../alloy/core/class-use/Alloy.html | 4 +- .../alloy/core/class-use/Button.html | 4 +- .../alloy/core/class-use/Debug.html | 89 ++- .../alloy/core/class-use/Debugger.html | 190 +++++ .../alloy/core/class-use/Encoder.html | 294 +++++++ .../alloy/core/class-use/Joystick.html | 4 +- .../alloy/core/class-use/Mode.html | 4 +- .../alloy/core/class-use/Motor.html | 88 ++- .../alloy/core/class-use/RobotCore.html | 4 +- .../alloy/core/class-use/TargetMotor.html | 4 +- .../alloy/core/package-frame.html | 8 +- .../alloy/core/package-summary.html | 16 +- .../alloy/core/package-tree.html | 20 +- .../alloy/core/package-use.html | 100 ++- .../alloy/drive/DTInput.html | 286 +++++++ .../alloy/drive/DTMapper.html | 30 +- .../alloy/drive/DriveModule.html | 336 ++++++++ .../alloy/drive/DriveTrain.html | 12 +- .../alloy/drive/class-use/DTInput.html | 165 ++++ .../alloy/drive/class-use/DTMapper.html | 4 +- .../alloy/drive/class-use/DriveModule.html | 124 +++ .../alloy/drive/class-use/DriveTrain.html | 4 +- .../alloy/drive/package-frame.html | 6 +- .../alloy/drive/package-summary.html | 12 +- .../alloy/drive/package-tree.html | 22 +- .../alloy/drive/package-use.html | 39 +- .../alloy/ftc/FTCButton.html | 36 +- .../alloy/ftc/FTCDebugger.html | 367 +++++++++ .../alloy/ftc/FTCJoystick.Side.html | 6 +- .../alloy/ftc/FTCJoystick.html | 135 +++- .../montclairrobotics/alloy/ftc/FTCMotor.html | 192 ++++- .../alloy/ftc/FTCTargetMotor.html | 158 +++- .../alloy/ftc/class-use/FTCButton.html | 4 +- .../alloy/ftc/class-use/FTCDebugger.html | 124 +++ .../alloy/ftc/class-use/FTCJoystick.Side.html | 8 +- .../alloy/ftc/class-use/FTCJoystick.html | 4 +- .../alloy/ftc/class-use/FTCMotor.html | 4 +- .../alloy/ftc/class-use/FTCTargetMotor.html | 4 +- .../alloy/ftc/package-frame.html | 6 +- .../alloy/ftc/package-summary.html | 15 +- .../alloy/ftc/package-tree.html | 24 +- .../alloy/ftc/package-use.html | 9 +- .../alloy/motor/DefaultMapper.html | 285 +++++++ .../montclairrobotics/alloy/motor/Mapper.html | 233 ++++++ .../alloy/motor/MotorGroup.html | 430 +++++++++++ .../alloy/motor/MotorModule.html | 727 ++++++++++++++++++ .../alloy/motor/class-use/DefaultMapper.html | 124 +++ .../alloy/motor/class-use/Mapper.html | 240 ++++++ .../alloy/motor/class-use/MotorGroup.html | 124 +++ .../alloy/motor/class-use/MotorModule.html | 292 +++++++ .../alloy/motor/package-frame.html | 26 + .../alloy/motor/package-summary.html | 171 ++++ .../alloy/motor/package-tree.html | 151 ++++ .../alloy/motor/package-use.html | 210 +++++ .../alloy/motor/steps/Deadzone.html | 292 +++++++ .../alloy/motor/steps/VectorDeadzone.html | 280 +++++++ .../alloy/motor/steps/class-use/Deadzone.html | 124 +++ .../motor/steps/class-use/VectorDeadzone.html | 124 +++ .../alloy/motor/steps/package-frame.html | 21 + .../alloy/motor/steps/package-summary.html | 146 ++++ .../alloy/motor/steps/package-tree.html | 138 ++++ .../alloy/motor/steps/package-use.html | 124 +++ .../montclairrobotics/alloy/test/Control.html | 237 ++++++ .../alloy/test/Hardware.html | 271 +++++++ .../alloy/test/ShooterMapper.html | 282 +++++++ .../alloy/test/TestRobot.html | 19 +- .../alloy/test/class-use/Control.html | 124 +++ .../alloy/test/class-use/Hardware.html | 124 +++ .../alloy/test/class-use/ShooterMapper.html | 124 +++ .../alloy/test/class-use/TestRobot.html | 4 +- .../alloy/test/package-frame.html | 8 +- .../alloy/test/package-summary.html | 18 +- .../alloy/test/package-tree.html | 16 +- .../alloy/test/package-use.html | 4 +- .../alloy/update/Update.html | 12 +- .../alloy/update/Updateable.html | 279 +++++++ .../alloy/update/Updater.html | 17 +- .../alloy/update/class-use/Update.html | 75 +- .../alloy/update/class-use/Updateable.html | 124 +++ .../alloy/update/class-use/Updater.html | 4 +- .../alloy/update/package-frame.html | 6 +- .../alloy/update/package-summary.html | 8 +- .../alloy/update/package-tree.html | 6 +- .../alloy/update/package-use.html | 44 +- .../alloy/utils/BangBang.html | 514 +++++++++++++ .../alloy/utils/BooleanToggle.html | 362 +++++++++ .../alloy/utils/ConstantInput.html | 292 +++++++ .../alloy/utils/Differential.html | 411 ++++++++++ .../alloy/utils/ErrorCorrection.html | 314 ++++++++ .../alloy/utils/Initializeable.html | 271 +++++++ .../montclairrobotics/alloy/utils/Input.html | 14 +- .../alloy/utils/Monitor.html | 367 +++++++++ .../montclairrobotics/alloy/utils/PID.html | 190 ++++- .../alloy/utils/Toggleable.Status.html | 358 +++++++++ .../alloy/utils/Toggleable.html | 80 +- .../alloy/utils/TuneablePID.html | 231 +++++- .../montclairrobotics/alloy/utils/Utils.html | 383 +++++++++ .../alloy/utils/class-use/BangBang.html | 174 +++++ .../alloy/utils/class-use/BooleanToggle.html | 124 +++ .../alloy/utils/class-use/ConstantInput.html | 124 +++ .../alloy/utils/class-use/Differential.html | 124 +++ .../utils/class-use/ErrorCorrection.html | 340 ++++++++ .../alloy/utils/class-use/Initializeable.html | 164 ++++ .../alloy/utils/class-use/Input.html | 260 ++++++- .../alloy/utils/class-use/Monitor.html | 124 +++ .../alloy/utils/class-use/PID.html | 43 +- .../utils/class-use/Toggleable.Status.html | 188 +++++ .../alloy/utils/class-use/Toggleable.html | 176 ++++- .../alloy/utils/class-use/TuneablePID.html | 55 +- .../alloy/utils/class-use/Utils.html | 124 +++ .../alloy/utils/package-frame.html | 16 +- .../alloy/utils/package-summary.html | 63 +- .../alloy/utils/package-tree.html | 41 +- .../alloy/utils/package-use.html | 142 +++- .../montclairrobotics/alloy/vector/Angle.html | 4 +- .../montclairrobotics/alloy/vector/Polar.html | 19 +- .../alloy/vector/Vector.html | 48 +- .../montclairrobotics/alloy/vector/XY.html | 19 +- .../alloy/vector/class-use/Angle.html | 26 +- .../alloy/vector/class-use/Polar.html | 4 +- .../alloy/vector/class-use/Vector.html | 180 ++++- .../alloy/vector/class-use/XY.html | 4 +- .../alloy/vector/package-frame.html | 4 +- .../alloy/vector/package-summary.html | 4 +- .../alloy/vector/package-tree.html | 4 +- .../alloy/vector/package-use.html | 93 ++- docs/javadoc/overview-frame.html | 7 +- docs/javadoc/overview-summary.html | 28 +- docs/javadoc/overview-tree.html | 70 +- docs/javadoc/package-list | 3 + .../alloy/components/Component.java | 7 +- .../alloy/components/InputComponent.java | 1 + .../montclairrobotics/alloy/core/Debug.java | 18 +- .../alloy/core/Debugger.java | 150 +++- .../montclairrobotics/alloy/core/Encoder.java | 15 +- .../alloy/drive/DTInput.java | 5 + .../InvalidConfigurationException.java | 38 + .../alloy/exceptions/UpdateException.java | 34 + .../alloy/ftc/FTCDebugger.java | 42 +- .../montclairrobotics/alloy/ftc/FTCMotor.java | 3 +- .../alloy/ftc/FTCTargetMotor.java | 2 +- .../alloy/motor/MotorModule.java | 2 +- .../alloy/{motor => }/steps/Deadzone.java | 21 +- .../{motor => }/steps/VectorDeadzone.java | 21 +- .../alloy/test/Hardware.java | 5 +- .../alloy/test/TestRobot.java | 2 +- .../alloy/update/Updateable.java | 3 +- .../alloy/utils/BangBang.java | 1 - .../alloy/utils/BooleanToggle.java | 2 +- .../alloy/utils/ConstantInput.java | 7 +- .../alloy/utils/GyroCorrection.java | 12 + .../montclairrobotics/alloy/utils/PID.java | 3 +- .../alloy/utils/Toggleable.java | 4 +- 229 files changed, 20817 insertions(+), 1110 deletions(-) create mode 100644 .idea/compiler.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/modules/Alloy.iml create mode 100644 docs/javadoc/index-files/index-24.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/Action.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/Component.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/InputComponent.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/Step.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/class-use/Action.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/class-use/Component.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/class-use/InputComponent.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/class-use/Step.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/components/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/Debugger.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/Encoder.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/Debugger.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/core/class-use/Encoder.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/DTInput.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/DriveModule.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DTInput.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/drive/class-use/DriveModule.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/FTCDebugger.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/ftc/class-use/FTCDebugger.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/DefaultMapper.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/Mapper.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/MotorGroup.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/MotorModule.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/class-use/DefaultMapper.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/class-use/Mapper.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/class-use/MotorGroup.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/class-use/MotorModule.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/steps/Deadzone.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/steps/VectorDeadzone.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/steps/class-use/Deadzone.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/steps/class-use/VectorDeadzone.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/steps/package-frame.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/steps/package-summary.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/steps/package-tree.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/motor/steps/package-use.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/Control.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/Hardware.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/ShooterMapper.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/class-use/Control.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/class-use/Hardware.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/test/class-use/ShooterMapper.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/Updateable.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/update/class-use/Updateable.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/BangBang.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/BooleanToggle.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/ConstantInput.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/Differential.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/ErrorCorrection.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/Initializeable.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/Monitor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/Toggleable.Status.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/Utils.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/BangBang.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/BooleanToggle.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/ConstantInput.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Differential.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/ErrorCorrection.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Initializeable.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Monitor.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Toggleable.Status.html create mode 100644 docs/javadoc/org/montclairrobotics/alloy/utils/class-use/Utils.html create mode 100644 src/main/java/org/montclairrobotics/alloy/exceptions/InvalidConfigurationException.java create mode 100644 src/main/java/org/montclairrobotics/alloy/exceptions/UpdateException.java rename src/main/java/org/montclairrobotics/alloy/{motor => }/steps/Deadzone.java (76%) rename src/main/java/org/montclairrobotics/alloy/{motor => }/steps/VectorDeadzone.java (75%) create mode 100644 src/main/java/org/montclairrobotics/alloy/utils/GyroCorrection.java diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..3446932 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..7f3aa01 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Alloy.iml b/.idea/modules/Alloy.iml new file mode 100644 index 0000000..7a09714 --- /dev/null +++ b/.idea/modules/Alloy.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Alloy_main.iml b/.idea/modules/Alloy_main.iml index 795b244..b8e8832 100644 --- a/.idea/modules/Alloy_main.iml +++ b/.idea/modules/Alloy_main.iml @@ -1,4 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Alloy_test.iml b/.idea/modules/Alloy_test.iml index cae3221..29e54d6 100644 --- a/.idea/modules/Alloy_test.iml +++ b/.idea/modules/Alloy_test.iml @@ -1,4 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 315f0e2..ba48e48 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,9 @@ spotless { java { googleJavaFormat('1.1').aosp() + licenseHeaderFile 'SpotlessLicense' + paddedCell() } } diff --git a/docs/javadoc/allclasses-frame.html b/docs/javadoc/allclasses-frame.html index 9719412..a1b238d 100644 --- a/docs/javadoc/allclasses-frame.html +++ b/docs/javadoc/allclasses-frame.html @@ -2,9 +2,9 @@ - + All Classes - + @@ -12,39 +12,64 @@

All Classes

diff --git a/docs/javadoc/allclasses-noframe.html b/docs/javadoc/allclasses-noframe.html index 3dfc0de..44d2da5 100644 --- a/docs/javadoc/allclasses-noframe.html +++ b/docs/javadoc/allclasses-noframe.html @@ -2,9 +2,9 @@ - + All Classes - + @@ -12,39 +12,64 @@

All Classes

diff --git a/docs/javadoc/constant-values.html b/docs/javadoc/constant-values.html index 85e7268..a5d2c10 100644 --- a/docs/javadoc/constant-values.html +++ b/docs/javadoc/constant-values.html @@ -2,9 +2,9 @@ - + Constant Field Values - + diff --git a/docs/javadoc/deprecated-list.html b/docs/javadoc/deprecated-list.html index a64be8f..bfa54ec 100644 --- a/docs/javadoc/deprecated-list.html +++ b/docs/javadoc/deprecated-list.html @@ -2,9 +2,9 @@ - + Deprecated List - + diff --git a/docs/javadoc/help-doc.html b/docs/javadoc/help-doc.html index 8b75052..d3b48fd 100644 --- a/docs/javadoc/help-doc.html +++ b/docs/javadoc/help-doc.html @@ -2,9 +2,9 @@ - + API Help - + diff --git a/docs/javadoc/index-files/index-1.html b/docs/javadoc/index-files/index-1.html index ef83dbf..ad635fb 100644 --- a/docs/javadoc/index-files/index-1.html +++ b/docs/javadoc/index-files/index-1.html @@ -2,9 +2,9 @@ - + A-Index - + @@ -69,11 +69,13 @@ -
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

A

+
Action - Interface in org.montclairrobotics.alloy.components
+
 
add(Vector) - Method in class org.montclairrobotics.alloy.vector.Polar
Adds two vectors together and returns the result
@@ -86,8 +88,16 @@

A

Adds two vectors together and returns the result
+
addDebug(Debug) - Method in class org.montclairrobotics.alloy.components.Component
+
 
+
addDebugs(Iterable<? extends Debug>) - Method in class org.montclairrobotics.alloy.components.Component
+
 
addState(State) - Method in class org.montclairrobotics.alloy.auto.StateMachine
 
+
addStep(Step) - Method in class org.montclairrobotics.alloy.components.InputComponent
+
 
+
addStep(Step) - Method in class org.montclairrobotics.alloy.motor.MotorModule
+
 
Alloy - Class in org.montclairrobotics.alloy.core
Created by MHS Robotics on 11/13/2017.
@@ -124,8 +134,10 @@

A

gets the angle between two vectors
+
applySteps() - Method in class org.montclairrobotics.alloy.components.InputComponent
+
 
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
-
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

J

@@ -79,7 +79,7 @@

J

Created by MHS Robotics on 11/14/2017.
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
diff --git a/docs/javadoc/index-files/index-11.html b/docs/javadoc/index-files/index-11.html index a7d06d6..5c81367 100644 --- a/docs/javadoc/index-files/index-11.html +++ b/docs/javadoc/index-files/index-11.html @@ -2,9 +2,9 @@ - -L-Index - + +K-Index + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -69,11 +69,23 @@
-
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

B

+
BangBang - Class in org.montclairrobotics.alloy.utils
+
 
+
BangBang(double, double) - Constructor for class org.montclairrobotics.alloy.utils.BangBang
+
 
+
BangBang(double) - Constructor for class org.montclairrobotics.alloy.utils.BangBang
+
 
+
BooleanToggle - Class in org.montclairrobotics.alloy.utils
+
 
+
BooleanToggle() - Constructor for class org.montclairrobotics.alloy.utils.BooleanToggle
+
 
+
booleanValue() - Method in enum org.montclairrobotics.alloy.utils.Toggleable.Status
+
 
button - Variable in class org.montclairrobotics.alloy.control.ButtonAction
 
Button - Interface in org.montclairrobotics.alloy.core
@@ -87,7 +99,7 @@

B

ButtonAction(Button) - Constructor for class org.montclairrobotics.alloy.control.ButtonAction
 
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
diff --git a/docs/javadoc/index-files/index-20.html b/docs/javadoc/index-files/index-20.html index b66554d..b0634c9 100644 --- a/docs/javadoc/index-files/index-20.html +++ b/docs/javadoc/index-files/index-20.html @@ -2,9 +2,9 @@ - -V-Index - + +U-Index + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J K L M N O P R S T U V W X Z  + + +

Z

+
+
ZERO - Variable in class org.montclairrobotics.alloy.vector.Angle
+
 
+
ZERO - Static variable in interface org.montclairrobotics.alloy.vector.Vector
+
 
+
+A B C D E F G H I J K L M N O P R S T U V W X Z 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/javadoc/index-files/index-3.html b/docs/javadoc/index-files/index-3.html index 2af8faf..3f58b01 100644 --- a/docs/javadoc/index-files/index-3.html +++ b/docs/javadoc/index-files/index-3.html @@ -2,9 +2,9 @@ - + C-Index - + @@ -69,11 +69,47 @@
-
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

C

+
calculateCorrection() - Method in class org.montclairrobotics.alloy.utils.BangBang
+
 
+
calculateDifferential() - Method in class org.montclairrobotics.alloy.utils.Differential
+
 
+
Component - Class in org.montclairrobotics.alloy.components
+
+
The main component class that all components of alloy should extend
+
+
Component() - Constructor for class org.montclairrobotics.alloy.components.Component
+
 
+
components - Static variable in class org.montclairrobotics.alloy.components.Component
+
 
+
ConstantInput<T> - Class in org.montclairrobotics.alloy.utils
+
+
Created by MHS Robotics on 3/30/2018.
+
+
ConstantInput(T) - Constructor for class org.montclairrobotics.alloy.utils.ConstantInput
+
 
+
constrain(double, double, double) - Static method in class org.montclairrobotics.alloy.utils.Utils
+
+
Makes sure that a value is between 2 different values
+
+
Control - Class in org.montclairrobotics.alloy.test
+
 
+
Control() - Constructor for class org.montclairrobotics.alloy.test.Control
+
 
+
controlPower() - Method in class org.montclairrobotics.alloy.motor.MotorGroup
+
 
+
copy() - Method in class org.montclairrobotics.alloy.utils.BangBang
+
 
+
copy() - Method in interface org.montclairrobotics.alloy.utils.ErrorCorrection
+
 
+
copy() - Method in class org.montclairrobotics.alloy.utils.PID
+
 
+
copy() - Method in class org.montclairrobotics.alloy.utils.TuneablePID
+
 
copy() - Method in class org.montclairrobotics.alloy.vector.Polar
Creates a copy of the vector
@@ -103,7 +139,7 @@

C

Returns the product of two vectors that have been crossed
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
-
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

D

-
Debug - Interface in org.montclairrobotics.alloy.core
+
Deadzone - Class in org.montclairrobotics.alloy.motor.steps
+
 
+
Deadzone(double) - Constructor for class org.montclairrobotics.alloy.motor.steps.Deadzone
+
 
+
Deadzone() - Constructor for class org.montclairrobotics.alloy.motor.steps.Deadzone
+
 
+
debug() - Method in class org.montclairrobotics.alloy.components.Component
+
 
+
Debug - Class in org.montclairrobotics.alloy.core
+
 
+
Debug(String, Input<Object>) - Constructor for class org.montclairrobotics.alloy.core.Debug
+
 
+
Debug(String, Object) - Constructor for class org.montclairrobotics.alloy.core.Debug
+
 
+
debug(Debug) - Method in interface org.montclairrobotics.alloy.core.Debugger
+
+
Debugs out a debug object
+
+
debug(Debug) - Method in class org.montclairrobotics.alloy.ftc.FTCDebugger
+
+
Debugs out a debug object
+
+
debugger - Static variable in class org.montclairrobotics.alloy.components.Component
+
+
The object used for debugging information about all components
+
+
Debugger - Interface in org.montclairrobotics.alloy.core
Created by MHS Robotics on 11/13/2017.
+
DefaultMapper - Class in org.montclairrobotics.alloy.motor
+
+
A simple default mapper
+
+
DefaultMapper() - Constructor for class org.montclairrobotics.alloy.motor.DefaultMapper
+
 
+
Differential - Class in org.montclairrobotics.alloy.utils
+
+
A class to calculate how an input varies with time
+
+
Differential(Input) - Constructor for class org.montclairrobotics.alloy.utils.Differential
+
 
+
direction - Variable in class org.montclairrobotics.alloy.motor.MotorModule
+
+
The direction that the modules run for use in a motor group
+
disable() - Method in class org.montclairrobotics.alloy.utils.Toggleable
Disables the toggleable
-
disableAction() - Method in class org.montclairrobotics.alloy.test.Shooter
+
disableAction() - Method in class org.montclairrobotics.alloy.components.Component
 
+
disableAction() - Method in class org.montclairrobotics.alloy.ftc.FTCMotor
+
 
+
disableAction() - Method in class org.montclairrobotics.alloy.motor.MotorModule
+
+
Method to be called when the toggleable is disabled
+
+
disableAction() - Method in class org.montclairrobotics.alloy.utils.BooleanToggle
+
+
Method to be called when the toggleable is disabled
+
disableAction() - Method in class org.montclairrobotics.alloy.utils.Toggleable
Method to be called when the toggleable is disabled
-
disablePID() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
disabled() - Method in interface org.montclairrobotics.alloy.components.Action
+
 
+
disableDebug() - Method in class org.montclairrobotics.alloy.components.Component
+
 
+
disableErrorCorrection() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
Stop using the custom PID and return to using the default mode
@@ -104,18 +160,28 @@

D

Returns the dot product of two vectors
+
DriveModule - Class in org.montclairrobotics.alloy.drive
+
 
+
DriveModule(Vector, Encoder, ErrorCorrection<Double>, Motor...) - Constructor for class org.montclairrobotics.alloy.drive.DriveModule
+
+
Create a fully functioning motor module
+
DriveTrain - Class in org.montclairrobotics.alloy.drive
Created by MHS Robotics on 12/16/2017.
DriveTrain() - Constructor for class org.montclairrobotics.alloy.drive.DriveTrain
 
+
DTInput - Class in org.montclairrobotics.alloy.drive
+
 
+
DTInput() - Constructor for class org.montclairrobotics.alloy.drive.DTInput
+
 
DTMapper - Interface in org.montclairrobotics.alloy.drive
Created by MHS Robotics on 12/16/2017.
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
-
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

E

@@ -78,14 +78,40 @@

E

Enables the toggleable
-
enableAction() - Method in class org.montclairrobotics.alloy.test.Shooter
+
enableAction() - Method in class org.montclairrobotics.alloy.components.Component
 
+
enableAction() - Method in class org.montclairrobotics.alloy.utils.BooleanToggle
+
+
Method to be called when the toggleable is enabled
+
enableAction() - Method in class org.montclairrobotics.alloy.utils.Toggleable
Method to be called when the toggleable is enabled
+
enabled() - Method in interface org.montclairrobotics.alloy.components.Action
+
 
+
enableDebug() - Method in class org.montclairrobotics.alloy.components.Component
+
 
+
Encoder - Class in org.montclairrobotics.alloy.core
+
+
A motor encoder that keeps track of kinematic information about the motor
+
+
Encoder(double, double) - Constructor for class org.montclairrobotics.alloy.core.Encoder
+
 
+
Encoder() - Constructor for class org.montclairrobotics.alloy.core.Encoder
+
+
Create a new encoder with default values
+
+
encoder - Variable in class org.montclairrobotics.alloy.motor.MotorModule
+
+
The encoder that keeps track of the position and controls the motors
+
+
ErrorCorrection<T> - Interface in org.montclairrobotics.alloy.utils
+
+
A interface that defines the process of correcting an error
+
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
-
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

F

@@ -79,23 +79,34 @@

F

Created by MHS Robotics on 11/14/2017.
FTCButton(Input<Boolean>) - Constructor for class org.montclairrobotics.alloy.ftc.FTCButton
-
 
+
+
Creates a new button using a buttonInput
+
FTCButton(Input<Boolean>, boolean) - Constructor for class org.montclairrobotics.alloy.ftc.FTCButton
-
 
-
FTCDebug - Class in org.montclairrobotics.alloy.ftc
+
+
Creates a new button specifying a button input and an invert
+
+
FTCDebugger - Class in org.montclairrobotics.alloy.ftc
Created by MHS Robotics on 11/14/2017.
-
FTCDebug() - Constructor for class org.montclairrobotics.alloy.ftc.FTCDebug
-
 
+
FTCDebugger() - Constructor for class org.montclairrobotics.alloy.ftc.FTCDebugger
+
+
Create a new FTCDebugger, and throw an exception if it has not been initialized
+
FTCJoystick - Class in org.montclairrobotics.alloy.ftc
Created by MHS Robotics on 11/14/2017.
FTCJoystick(Gamepad, FTCJoystick.Side) - Constructor for class org.montclairrobotics.alloy.ftc.FTCJoystick
-
 
+
+
Create a new Joystick using the gamepad and side
+
FTCJoystick.Side - Enum in org.montclairrobotics.alloy.ftc
-
 
+
+
The side in a FTCJoystick is referring to the side of the controller is on, there are 2 + joysticks, one on the right, one on the left
+
FTCMotor - Class in org.montclairrobotics.alloy.ftc
Created by MHS Robotics on 11/14/2017.
@@ -109,7 +120,7 @@

F

FTCTargetMotor(String) - Constructor for class org.montclairrobotics.alloy.ftc.FTCTargetMotor
 
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
-
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

G

@@ -82,12 +82,23 @@

G

The second gamepad, generated by pressing start + 'b' on the controller
+
get() - Method in class org.montclairrobotics.alloy.components.InputComponent
+
 
+
get() - Method in class org.montclairrobotics.alloy.utils.BooleanToggle
+
 
+
get() - Method in class org.montclairrobotics.alloy.utils.ConstantInput
+
 
get() - Method in interface org.montclairrobotics.alloy.utils.Input
 
-
get() - Method in class org.montclairrobotics.alloy.utils.PID
+
get() - Method in class org.montclairrobotics.alloy.utils.Monitor
 
getAButton(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
 
+
getAcceleration() - Method in class org.montclairrobotics.alloy.core.Encoder
+
+
Get the acceleration in distance per second The distance is set by the distance per tick + method, it is important to keep distances consistent throughout
+
getAngle() - Method in class org.montclairrobotics.alloy.vector.Polar
Gets the angle in standard position that the vector makes
@@ -102,16 +113,45 @@

G

getBButton(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
 
+
getComponents() - Static method in class org.montclairrobotics.alloy.components.Component
+
 
+
getCorrection() - Method in class org.montclairrobotics.alloy.utils.BangBang
+
+
Get the value to apply the correction
+
+
getCorrection() - Method in interface org.montclairrobotics.alloy.utils.ErrorCorrection
+
+
Get the value to apply the correction
+
+
getCorrection() - Method in class org.montclairrobotics.alloy.utils.PID
+
 
+
getCorrection() - Method in class org.montclairrobotics.alloy.utils.TuneablePID
+
+
Get the value to apply the correction
+
getDegrees() - Method in class org.montclairrobotics.alloy.vector.Angle
Get the angle measure in degrees
+
getDirection() - Method in class org.montclairrobotics.alloy.motor.MotorModule
+
 
getDPADDown(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
 
getDPADLeft(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
 
getDPADUp(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
 
+
getEncoder() - Method in class org.montclairrobotics.alloy.ftc.FTCMotor
+
 
+
getEncoder() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
+
Allows for the creation of an encoder object that is aware of the amount of ticks the motor + has gone
+
+
getEncoder() - Method in class org.montclairrobotics.alloy.motor.MotorModule
+
 
+
getErrorCorrection() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
 
getGamepad1() - Static method in class org.montclairrobotics.alloy.core.RobotCore
Gets the first gamepad
@@ -124,6 +164,8 @@

G

Gets the hardware map of the robot
+
getInput() - Method in class org.montclairrobotics.alloy.utils.Differential
+
 
getInverted() - Method in interface org.montclairrobotics.alloy.core.Motor
Gets weather the motor is inverted
@@ -148,6 +190,8 @@

G

Gets the magnitude of the vector
+
getModifier() - Method in class org.montclairrobotics.alloy.motor.MotorModule
+
 
getMotor() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
 
getMotorPower() - Method in interface org.montclairrobotics.alloy.core.Motor
@@ -158,9 +202,15 @@

G

Gets the motor power
+
getMotors() - Method in class org.montclairrobotics.alloy.motor.MotorModule
+
 
getNextState(int) - Method in class org.montclairrobotics.alloy.auto.State
 
-
getPid() - Method in class org.montclairrobotics.alloy.ftc.FTCTargetMotor
+
getOutput(T) - Method in interface org.montclairrobotics.alloy.components.Step
+
 
+
getOutput(Double) - Method in class org.montclairrobotics.alloy.motor.steps.Deadzone
+
 
+
getOutput(Vector) - Method in class org.montclairrobotics.alloy.motor.steps.VectorDeadzone
 
getPosition() - Method in interface org.montclairrobotics.alloy.core.TargetMotor
@@ -170,10 +220,20 @@

G

Gets the motors position
+
getPowerControl() - Method in class org.montclairrobotics.alloy.motor.MotorModule
+
 
getRadians() - Method in class org.montclairrobotics.alloy.vector.Angle
Get the angle measure in radians
+
getRawVelocity() - Method in class org.montclairrobotics.alloy.core.Encoder
+
+
Get the velocity in Ticks per Second
+
+
getReferences() - Method in class org.montclairrobotics.alloy.update.Updateable
+
+
Gets references to all of the object that the update method should be called on
+
getRightBumper(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
 
getRightTrigger(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
@@ -182,6 +242,10 @@

G

NOTE: this is not the same as the DCMotor runmode
+
getScaledVelocity() - Method in class org.montclairrobotics.alloy.core.Encoder
+
+
Get a scaled value (0 - 1) of how fast the motor is going
+
getTargetPower() - Method in interface org.montclairrobotics.alloy.core.TargetMotor
Gets the motor power
@@ -190,11 +254,17 @@

G

Gets the motor power
+
getTargetPower() - Method in class org.montclairrobotics.alloy.motor.MotorModule
+
 
getTelemetry() - Static method in class org.montclairrobotics.alloy.core.RobotCore
Gets the telemetry object of the robot
-
getUpdateRate() - Method in class org.montclairrobotics.alloy.update.Updatable
+
getTicks() - Method in class org.montclairrobotics.alloy.core.Encoder
+
+
A method that should be overridden by the encoder
+
+
getUpdateRate() - Method in class org.montclairrobotics.alloy.update.Updateable
 
getValue() - Method in interface org.montclairrobotics.alloy.core.Button
@@ -205,9 +275,18 @@

G

Gets the position of the joystick
getValue() - Method in class org.montclairrobotics.alloy.ftc.FTCButton
-
 
+
+
Gets the values for a button
+
getValue() - Method in class org.montclairrobotics.alloy.ftc.FTCJoystick
-
 
+
+
Gets the position of the joystick as a vector
+
+
getVelocity() - Method in class org.montclairrobotics.alloy.core.Encoder
+
+
Get the velocity in distance per second The distance is set by the distance per tick method, + it is important to keep distances consistent throughout the project.
+
getX() - Method in class org.montclairrobotics.alloy.vector.Polar
Gets the X component of the vector
@@ -239,7 +318,7 @@

G

getYDPADRight(Gamepad) - Static method in class org.montclairrobotics.alloy.ftc.FTCButton
 
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
-
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

H

+
Hardware - Class in org.montclairrobotics.alloy.test
+
 
+
Hardware() - Constructor for class org.montclairrobotics.alloy.test.Hardware
+
 
hardwareMap - Static variable in class org.montclairrobotics.alloy.core.RobotCore
The hardware map is essential to any robot and is how the ftc core interacts with the hardware devices on the phones
+
highOut - Variable in class org.montclairrobotics.alloy.utils.BangBang
+
 
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
-
A B C D E F G H I J L M N O P R S T U V W X Z  +
A B C D E F G H I J K L M N O P R S T U V W X Z 

I

@@ -78,16 +78,44 @@

I

 
init() - Method in class org.montclairrobotics.alloy.core.Alloy
 
+
init() - Static method in class org.montclairrobotics.alloy.test.Hardware
+
 
+
init() - Method in class org.montclairrobotics.alloy.utils.Initializeable
+
 
initialization() - Method in class org.montclairrobotics.alloy.core.Alloy
The initialization method is were everything specific to the OpMode Should be set up.
initialization() - Method in class org.montclairrobotics.alloy.test.TestRobot
 
+
Initializeable - Class in org.montclairrobotics.alloy.utils
+
 
+
Initializeable() - Constructor for class org.montclairrobotics.alloy.utils.Initializeable
+
 
+
initObjects - Static variable in class org.montclairrobotics.alloy.core.Alloy
+
 
+
input - Variable in class org.montclairrobotics.alloy.components.InputComponent
+
 
+
input - Variable in class org.montclairrobotics.alloy.motor.MotorGroup
+
+
The control input for the motor group
+
+
input - Variable in class org.montclairrobotics.alloy.utils.Differential
+
+
The dependant variable in the situation
+
Input<T> - Interface in org.montclairrobotics.alloy.utils
Created by MHS Robotics on 2/2/2018.
+
input - Variable in class org.montclairrobotics.alloy.utils.Monitor
+
+
The input to be checked
+
+
InputComponent<T> - Class in org.montclairrobotics.alloy.components
+
 
+
InputComponent() - Constructor for class org.montclairrobotics.alloy.components.InputComponent
+
 
isDone() - Method in class org.montclairrobotics.alloy.auto.State
IsDone should return true when the state is finished
@@ -95,7 +123,7 @@

I

isDone() - Method in class org.montclairrobotics.alloy.auto.StateMachine
 
-A B C D E F G H I J L M N O P R S T U V W X Z 
+A B C D E F G H I J K L M N O P R S T U V W X Z 
diff --git a/docs/javadoc/index.html b/docs/javadoc/index.html index 02909bb..8d44cdc 100644 --- a/docs/javadoc/index.html +++ b/docs/javadoc/index.html @@ -2,7 +2,7 @@ - + Generated Documentation (Untitled) diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/State.html b/docs/javadoc/org/montclairrobotics/alloy/auto/State.html index 13a8028..f40001b 100644 --- a/docs/javadoc/org/montclairrobotics/alloy/auto/State.html +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/State.html @@ -2,9 +2,9 @@ - + State - + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/StateMachine.html b/docs/javadoc/org/montclairrobotics/alloy/auto/StateMachine.html index c2d926b..0968d06 100644 --- a/docs/javadoc/org/montclairrobotics/alloy/auto/StateMachine.html +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/StateMachine.html @@ -2,9 +2,9 @@ - + StateMachine - + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/AlloyAutonomous.html b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/AlloyAutonomous.html index 03b7bf4..456a74c 100644 --- a/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/AlloyAutonomous.html +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/AlloyAutonomous.html @@ -2,9 +2,9 @@ - + Uses of Class org.montclairrobotics.alloy.auto.AlloyAutonomous - + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/State.html b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/State.html index 73834b9..d164a05 100644 --- a/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/State.html +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/State.html @@ -2,9 +2,9 @@ - + Uses of Class org.montclairrobotics.alloy.auto.State - + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/StateMachine.html b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/StateMachine.html index 14222a9..4a21b19 100644 --- a/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/StateMachine.html +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/class-use/StateMachine.html @@ -2,9 +2,9 @@ - + Uses of Class org.montclairrobotics.alloy.auto.StateMachine - + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/package-frame.html b/docs/javadoc/org/montclairrobotics/alloy/auto/package-frame.html index 5cb0502..15ccea0 100644 --- a/docs/javadoc/org/montclairrobotics/alloy/auto/package-frame.html +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/package-frame.html @@ -2,9 +2,9 @@ - + org.montclairrobotics.alloy.auto - + diff --git a/docs/javadoc/org/montclairrobotics/alloy/auto/package-summary.html b/docs/javadoc/org/montclairrobotics/alloy/auto/package-summary.html index aacbc03..536de25 100644 --- a/docs/javadoc/org/montclairrobotics/alloy/auto/package-summary.html +++ b/docs/javadoc/org/montclairrobotics/alloy/auto/package-summary.html @@ -2,9 +2,9 @@ - + org.montclairrobotics.alloy.auto - + @@ -44,7 +44,7 @@