projects
/
ozzloy@gmail.com
/
3501-spark-go
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3e4790a
)
everything done except mapping buttons to actions
author
Logan Howard
<logan@oflogan.com>
Fri, 17 Apr 2015 03:00:51 +0000
(20:00 -0700)
committer
Logan Howard
<logan@oflogan.com>
Fri, 17 Apr 2015 03:00:51 +0000
(20:00 -0700)
src/org/usfirst/frc/team3501/robot/OI.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/Robot.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/RobotMap.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/commands/DriveWithJoysticks.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/commands/MoveArm.java
[new file with mode: 0644]
patch
|
blob
src/org/usfirst/frc/team3501/robot/subsystems/Arm.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/subsystems/Drivetrain.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/subsystems/Pneumatics.java
patch
|
blob
|
blame
|
history
diff --git
a/src/org/usfirst/frc/team3501/robot/OI.java
b/src/org/usfirst/frc/team3501/robot/OI.java
index 0b8fa0755904bfe29ecefae66038f4e5e7bec95d..6a245583c57421768c4c10482d3803cac2d228f4 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/OI.java
+++ b/
src/org/usfirst/frc/team3501/robot/OI.java
@@
-3,7
+3,7
@@
package org.usfirst.frc.team3501.robot;
import org.usfirst.frc.team3501.robot.commands.*;
public class OI {
import org.usfirst.frc.team3501.robot.commands.*;
public class OI {
- p
ublic
Joystick left, right;
+ p
rivate
Joystick left, right;
public OI() {
left = new Joystick(RobotMap.LEFT_JOYSTICK_PORT);
public OI() {
left = new Joystick(RobotMap.LEFT_JOYSTICK_PORT);
@@
-13,11
+13,15
@@
public class OI {
right.whenReleased(1, new OpenClaw());
}
right.whenReleased(1, new OpenClaw());
}
- public double getForward() {
+ public double getForwardL() {
+ return left.getY();
+ }
+
+ public double getForwardR() {
return right.getY();
}
return right.getY();
}
- public double getTwist() {
+ public double getTwist
R
() {
return right.getTwist();
}
}
return right.getTwist();
}
}
diff --git
a/src/org/usfirst/frc/team3501/robot/Robot.java
b/src/org/usfirst/frc/team3501/robot/Robot.java
index b5ac5b7a98a13dd563a37dfbe2e9e504cd165755..23a43b7812daab2e2bfe1d188ebfcb025f998b7c 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/Robot.java
+++ b/
src/org/usfirst/frc/team3501/robot/Robot.java
@@
-13,9
+13,11
@@
import org.usfirst.frc.team3501.robot.subsystems.*;
public class Robot extends IterativeRobot {
public class Robot extends IterativeRobot {
- public static final Drivetrain drivetrain = new Drivetrain();
- public static final Arm arm = new Arm();
- public static final Claw claw = new Claw();
+ public static Drivetrain drivetrain;
+ public static Arm arm;
+ public static Claw claw;
+
+ public static Pneumatics pneumatics;
public static OI oi;
public static OI oi;
@@
-26,6
+28,12
@@
public class Robot extends IterativeRobot {
public void robotInit() {
oi = new OI();
public void robotInit() {
oi = new OI();
+ drivetrain = new Drivetrain();
+ arm = new Arm();
+ claw = new Claw();
+
+ pneumatics = new Pneumatics();
+
chooseAuto();
}
chooseAuto();
}
@@
-34,6
+42,8
@@
public class Robot extends IterativeRobot {
}
public void autonomousInit() {
}
public void autonomousInit() {
+ pneumatics.start();
+
autonomousCommand = (Command) autoChooser.getSelected();
autonomousCommand.start();
}
autonomousCommand = (Command) autoChooser.getSelected();
autonomousCommand.start();
}
@@
-43,6
+53,8
@@
public class Robot extends IterativeRobot {
}
public void teleopInit() {
}
public void teleopInit() {
+ pneumatics.start();
+
autonomousCommand.cancel();
}
autonomousCommand.cancel();
}
@@
-54,6
+66,10
@@
public class Robot extends IterativeRobot {
LiveWindow.run();
}
LiveWindow.run();
}
+ public void disabledInit() {
+ pneumatics.stop();
+ }
+
private void chooseAuto() {
autoChooser = new SendableChooser();
private void chooseAuto() {
autoChooser = new SendableChooser();
diff --git
a/src/org/usfirst/frc/team3501/robot/RobotMap.java
b/src/org/usfirst/frc/team3501/robot/RobotMap.java
index bfb2bea698ec249228da2ef910e76660268ebce6..3ce51bf176aade4e46c2c6cc5647fabbb020ba1e 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/RobotMap.java
+++ b/
src/org/usfirst/frc/team3501/robot/RobotMap.java
@@
-3,27
+3,27
@@
package org.usfirst.frc.team3501.robot;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
public class RobotMap {
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
public class RobotMap {
- //
Driver S
tation
+ //
driver s
tation
public static final int LEFT_JOYSTICK_PORT = 0, RIGHT_JOYSTICK_PORT = 1;
public static final double MIN_DRIVE_JOYSTICK_INPUT = 0.1,
MIN_ARM_JOYSTICK_INPUT = 0.1;
public static final int LEFT_JOYSTICK_PORT = 0, RIGHT_JOYSTICK_PORT = 1;
public static final double MIN_DRIVE_JOYSTICK_INPUT = 0.1,
MIN_ARM_JOYSTICK_INPUT = 0.1;
- //
D
rivetrain
+ //
d
rivetrain
public static final int FRONT_LEFT_ADDRESS = 4, FRONT_RIGHT_ADDRESS = 5,
REAR_LEFT_ADDRESS = 3, REAR_RIGHT_ADDRESS = 6;
public static final double MAX_DRIVE_SPEED = 0.7;
public static final int FRONT_LEFT_ADDRESS = 4, FRONT_RIGHT_ADDRESS = 5,
REAR_LEFT_ADDRESS = 3, REAR_RIGHT_ADDRESS = 6;
public static final double MAX_DRIVE_SPEED = 0.7;
- //
C
law
+ //
c
law
public static final int CLAW_FORWARD_CHANNEL = 0, CLAW_REVERSE_CHANNEL = 1;
public static final Value OPEN = Value.kForward, CLOSED = Value.kReverse;
public static final int CLAW_FORWARD_CHANNEL = 0, CLAW_REVERSE_CHANNEL = 1;
public static final Value OPEN = Value.kForward, CLOSED = Value.kReverse;
- //
A
rm
+ //
a
rm
public static final int LEFT_WINCH_ADDRESS = 2, RIGHT_WINCH_ADDRESS = 7;
public static final int LEFT_WINCH_ADDRESS = 2, RIGHT_WINCH_ADDRESS = 7;
- //
A
uton
+ //
a
uton
public static final double OVER_STEP_TIME = 1.2, OVER_STEP_SPEED = 0.7,
PAST_STEP_TIME = 1.5, PAST_STEP_SPEED = 0.5;
}
public static final double OVER_STEP_TIME = 1.2, OVER_STEP_SPEED = 0.7,
PAST_STEP_TIME = 1.5, PAST_STEP_SPEED = 0.5;
}
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/DriveWithJoysticks.java
b/src/org/usfirst/frc/team3501/robot/commands/DriveWithJoysticks.java
index 500bad953e33000ad9c29fa9a890c64d29ed0f86..cda6cdd7f35cd96a9d6d3592a0f63c33d7634aac 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/commands/DriveWithJoysticks.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/DriveWithJoysticks.java
@@
-8,7
+8,7
@@
public class DriveWithJoysticks extends CommandBase {
}
protected void execute() {
}
protected void execute() {
- drivetrain.drive(oi.getForward
(), oi.getTwist
());
+ drivetrain.drive(oi.getForward
R(), oi.getTwistR
());
}
protected boolean isFinished() {
}
protected boolean isFinished() {
diff --git a/src/org/usfirst/frc/team3501/robot/commands/MoveArm.java
b/src/org/usfirst/frc/team3501/robot/commands/MoveArm.java
new file mode 100644
(file)
index 0000000..
f0865af
--- /dev/null
+++ b/
src/org/usfirst/frc/team3501/robot/commands/MoveArm.java
@@ -0,0
+1,17
@@
+package org.usfirst.frc.team3501.robot.commands;
+
+public class MoveArm extends CommandBase {
+
+ public MoveArm() {
+ super("MoveArm");
+ requires(arm);
+ }
+
+ protected void execute() {
+ arm.setFromJoystick(oi.getForwardL());
+ }
+
+ protected boolean isFinished() {
+ return false;
+ }
+}
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java
b/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java
index 8cfcf9b6411a646b9caaa78aae909fda25292964..f42de1dfa0670af331e3521b4d5574f4c53efdf5 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/Arm.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/Arm.java
@@
-1,6
+1,7
@@
package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.RobotMap;
package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.RobotMap;
+import org.usfirst.frc.team3501.robot.commands.MoveArm;
import edu.wpi.first.wpilibj.CANJaguar;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.CANJaguar;
import edu.wpi.first.wpilibj.command.Subsystem;
@@
-19,6
+20,10
@@
public class Arm extends Subsystem {
right.set(speed);
}
right.set(speed);
}
+ public void setFromJoystick(double speed) {
+ set(getSpeedFromJoystick(speed));
+ }
+
public void moveLeft(double speed) {
left.set(speed);
right.set(0);
public void moveLeft(double speed) {
left.set(speed);
right.set(0);
@@
-36,6
+41,7
@@
public class Arm extends Subsystem {
return speed;
}
return speed;
}
- public void initDefaultCommand() {}
+ public void initDefaultCommand() {
+ setDefaultCommand(new MoveArm());
+ }
}
}
-
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/Drivetrain.java
b/src/org/usfirst/frc/team3501/robot/subsystems/Drivetrain.java
index 5dd39abb4a716f1bf8a7729b57696371281ec823..72428e4a7ca5e757f42529fbac5adc98c906e5f4 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/Drivetrain.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/Drivetrain.java
@@
-51,4
+51,3
@@
public class Drivetrain extends Subsystem {
setDefaultCommand(new DriveWithJoysticks());
}
}
setDefaultCommand(new DriveWithJoysticks());
}
}
-
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/Pneumatics.java
b/src/org/usfirst/frc/team3501/robot/subsystems/Pneumatics.java
index 8a831d5bfd96dcd9c2f7aff9debf622f14cb8723..270758ed4f6d220fb2007017123e2a9d07cadf6b 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/Pneumatics.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/Pneumatics.java
@@
-21,4
+21,3
@@
public class Pneumatics extends Subsystem {
public void initDefaultCommand() {}
}
public void initDefaultCommand() {}
}
-