Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New indexer #17

Open
wants to merge 124 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
be2fc4a
I made the basis for a system that allows wheels to spin.
Krakavius Jan 7, 2018
7904908
Completely rewrote the previous base for the intake rollers, added Mi…
Krakavius Jan 9, 2018
8f96d64
make some packages
Jan 9, 2018
234b2ce
Slightly changed Intake.java and added Outtake.java
Krakavius Jan 9, 2018
53260b2
get and initialize motors
Jan 9, 2018
951b761
Fixed Intake.java and Outtake.java to actually do something.
Krakavius Jan 9, 2018
f90fbaf
Merge branch 'master' into arm-movement-prototype
Jan 9, 2018
ff0bdf9
Merge branch 'master' into intakeroller
Krakavius Jan 9, 2018
ca3c3f2
make ArmMove command
Jan 9, 2018
e75fc1e
Added CANTalonEncoders for Arm (prototype)
lauwong Jan 9, 2018
834e0b6
Merge branch 'master' into intakeroller
oldgalileo Jan 9, 2018
76bbb2e
add xbox control
Jan 9, 2018
a018a78
Added CANTalonEncoders for Arm prototype
lauwong Jan 9, 2018
4884a62
Changed the requests that I was able to.
Krakavius Jan 9, 2018
19ddf97
update for talonSRX
Jan 9, 2018
b9f3ab3
Changed MilkIO to CubeIO.
Krakavius Jan 9, 2018
f74400e
Changed IntakeRollers/OuttakeRollers to RollersIntake/RollersOuttake,…
Krakavius Jan 10, 2018
eb7ca4e
Moved the roller variable to RobotMap.java, renamed some things to be…
Krakavius Jan 11, 2018
9a26e3d
Replaced xbox arm control with joystick (joystick currently does not …
lauwong Jan 11, 2018
889452c
add some joystick stuff
Jan 11, 2018
fe5384b
Added a different default command to CrateIO.java, added a RollersRes…
Krakavius Jan 11, 2018
3d6656a
add more joystick stuff
Jan 11, 2018
1aacecc
Didn't do anything but git is making me commit before I can pull from…
lauwong Jan 12, 2018
af8a3c6
Completely redid RollersIntake and RollersOuttake, changed the way th…
Krakavius Jan 12, 2018
ad0f3a7
Added idle to initDefaultCommand() for Arm and hopefully fixed merge …
lauwong Jan 13, 2018
8bdf2af
Merge conflicts fixed plz?
lauwong Jan 13, 2018
303e849
AJ's requested changes for merge
lauwong Jan 13, 2018
93b5a5a
Git still isn't letting me checkout to master ... :(
lauwong Jan 14, 2018
5a8860c
Changed the speed of the rollers from 1.0/-1.0 to 0.5/-0.5
Krakavius Jan 15, 2018
597f6fb
remove wrist motors
Jan 18, 2018
1102a4a
Added the class RollyBOI.java into subsystems
Krakavius Jan 19, 2018
1093f11
Added RollyBOI-related stuff to RobotMap, and created the classes Ind…
Krakavius Jan 19, 2018
d671283
Added a new motor called 'ElbowMotorC'
Krakavius Jan 20, 2018
105722d
add PositionSensorMotor to arm
Jan 21, 2018
1444934
remove commented out code
Jan 21, 2018
9d5c93f
Added arm in in robotmap and subsystems.
Jan 22, 2018
a9c1d92
Added arm set command.
Jan 22, 2018
7b2a734
Merge branch 'master' into arm-movement-prototype
ajnadel Jan 25, 2018
506aba5
Fixed review comments.
Jan 25, 2018
ec06273
Fixed classpath.:
Jan 25, 2018
82f7984
Added documentation to RollersIntake, RollersOuttake, and CrateIO.
Krakavius Jan 26, 2018
337d40b
Added javadocs for ArmSet
lauwong Jan 26, 2018
e9dd7f0
Merge branch 'master' into intakeroller
Krakavius Jan 27, 2018
abeb017
Changed ArmSet to ArmMove, added the command ArmBrakeSet and commandg…
Krakavius Jan 27, 2018
391c92b
fix a very important typo
isaanca Feb 8, 2018
d3625dd
update standard to fix CAN
ajnadel Feb 8, 2018
b0fbe05
Merge branch 'master' into new-indexer
Feb 9, 2018
114d349
rararasputin
Feb 9, 2018
dd7fe70
made runnable commands a command group for two motors
Feb 9, 2018
ff94695
added operation for rollyBOI cubeIO
Feb 9, 2018
c002833
sketchy idle command for 2 motors
oshlern Feb 9, 2018
ab91839
Merge branch 'new-indexer' of https://github.com/RoboticsTeam4904/201…
oshlern Feb 9, 2018
7aa7063
added default idle
Feb 9, 2018
902c1a6
jankolidar
Feb 9, 2018
8747ceb
more billy commits
Feb 9, 2018
8a69d2b
improved IdleMotors with unlimited number of motors and comments
oshlern Feb 9, 2018
9bb29c6
Merge branch 'new-indexer' of https://github.com/RoboticsTeam4904/201…
oshlern Feb 9, 2018
51e50ca
command names
oshlern Feb 9, 2018
1b65def
made commands and states for indexer grabber and better code with req…
oshlern Feb 9, 2018
7ac38ba
remapped buttons for operator
oshlern Feb 9, 2018
3bbbc2d
working on indexer/intake
billwpierce Feb 9, 2018
cd31a4e
Merge remote-tracking branch 'origin/fix-can-via-standard' into new-i…
oshlern Feb 9, 2018
3a294f4
Updated standard.
Feb 9, 2018
9179d0a
Merge remote-tracking branch 'origin/fix-can-via-standard' into arm-m…
Feb 9, 2018
48a98d1
fix deprecated in standard? and add hi prots
Feb 10, 2018
3aa8140
Merge branch 'arm-movement-prototype' of https://github.com/RoboticsT…
Feb 10, 2018
7376003
Merged basic driving into arm prototype.
Feb 10, 2018
9944e29
Fixed merge conflicts in robot.
Feb 10, 2018
6d27c91
Fixed bad reference of encoder port.
Feb 10, 2018
23ac442
fix minimum arm position
Feb 10, 2018
f0dbc4c
Added documentation to CrateIO, IntakeRollersIntake and IntakeRollers…
Krakavius Feb 10, 2018
e230c9f
Changed right to left, in a documentation comment.
Krakavius Feb 10, 2018
816b6e9
add arbitrary arm values and do encoder stuff
Feb 10, 2018
6a277b7
Added upper cap on set speed
Feb 10, 2018
07a1804
I was going to add more stuff, but Osher made me commit
NikhilSuresh24 Feb 10, 2018
678bdbf
Removed RollersIntake and RollersOuttake.
Krakavius Feb 10, 2018
49fe18c
fixed them merge conflicts
NikhilSuresh24 Feb 10, 2018
f517a72
Merge branch 'new-indexer' of https://github.com/RoboticsTeam4904/201…
NikhilSuresh24 Feb 10, 2018
642860e
Added lines to log arm encoder value in robot.
Feb 10, 2018
8720820
made intakeSquared and OuttakeSquared routines
NikhilSuresh24 Feb 10, 2018
2a7ae66
merged in master
NikhilSuresh24 Feb 10, 2018
d8455b7
added enum for grabber and made PR changes
NikhilSuresh24 Feb 11, 2018
757d16b
made grabber enum and PR changes
NikhilSuresh24 Feb 11, 2018
0d62db1
Update .classpath
NikhilSuresh24 Feb 11, 2018
ae9572a
simplified idlemotors
NikhilSuresh24 Feb 11, 2018
1c4794d
simplifying idlemotors
NikhilSuresh24 Feb 11, 2018
f4aa3c9
put operator chooser after driver chooser
NikhilSuresh24 Feb 11, 2018
04f5a3b
renamed idlemotors to MotorIdleGroup
NikhilSuresh24 Feb 11, 2018
4f0a5a8
added whenPressed to Default Operator
NikhilSuresh24 Feb 11, 2018
9f7a914
added another constructor to motorIdlegroup
NikhilSuresh24 Feb 11, 2018
980f91f
another added constructor
NikhilSuresh24 Feb 11, 2018
712b289
added javadoc
NikhilSuresh24 Feb 11, 2018
aa4865b
changed mig constructor
NikhilSuresh24 Feb 11, 2018
d67e40c
reordered mig constructors
NikhilSuresh24 Feb 11, 2018
6549829
add getAngle method
isaanca Feb 11, 2018
f35e41f
for ns
billwpierce Feb 11, 2018
95410ed
Fixoed
billwpierce Feb 11, 2018
3322249
neato fixes
NikhilSuresh24 Feb 11, 2018
48c565f
tested stuff
NikhilSuresh24 Feb 11, 2018
3f9806b
Slightly changed arm range.
Feb 11, 2018
5ff3392
updated motor idle group
NikhilSuresh24 Feb 11, 2018
ac98fc1
Added default operator.
Feb 11, 2018
12da3a8
deleted comments
NikhilSuresh24 Feb 11, 2018
fca443a
set disc brake ports
ajnadel Feb 11, 2018
9ce8cd1
Added joystick and ports
billwpierce Feb 11, 2018
6e92875
removed autogenerated stubs
NikhilSuresh24 Feb 11, 2018
1b7e795
changes
billwpierce Feb 11, 2018
93114e1
Removed safetly set state
billwpierce Feb 11, 2018
eab1183
give rollyBOI grabber its own class
ajnadel Feb 11, 2018
4c4ffce
Merge branch 'arm-movement-prototype' into new-indexer
billwpierce Feb 11, 2018
66d5434
added command names
oshlern Feb 12, 2018
2696746
some small changes to default command
NikhilSuresh24 Feb 12, 2018
41081ff
required grabber in command
NikhilSuresh24 Feb 12, 2018
34cb988
Merge branch 'new-indexer' of https://github.com/RoboticsTeam4904/201…
billwpierce Feb 13, 2018
da391b9
changes to controls and intake speed
billwpierce Feb 13, 2018
11035e1
added buttons to open and close grabber
NikhilSuresh24 Feb 13, 2018
46a109a
got rid of someone's merge of arm-movement-prototype
NikhilSuresh24 Feb 13, 2018
3475117
default rollyBOI command: Idle()
ajnadel Feb 13, 2018
a6c7ef1
made PR changes
NikhilSuresh24 Feb 17, 2018
81147ab
updated constants
billwpierce Feb 17, 2018
85ccebb
dont use button 10
NikhilSuresh24 Feb 18, 2018
2045b86
Added general intake with adjustments and limit switch
billwpierce Feb 18, 2018
05082e0
Merge branch 'new-indexer' of https://github.com/RoboticsTeam4904/201…
billwpierce Feb 19, 2018
826481d
log sensor values
ajnadel Feb 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/org/usfirst/frc4904/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import org.usfirst.frc4904.robot.humaninterface.drivers.NathanGain;
import org.usfirst.frc4904.robot.humaninterface.operators.DefaultOperator;
import org.usfirst.frc4904.standard.CommandRobotBase;
import org.usfirst.frc4904.standard.commands.chassis.ChassisMove;

Expand All @@ -11,6 +12,7 @@ public class Robot extends CommandRobotBase {
@Override
public void initialize() {
driverChooser.addDefault(new NathanGain());
operatorChooser.addDefault(new DefaultOperator());
}

@Override
Expand Down
34 changes: 33 additions & 1 deletion src/org/usfirst/frc4904/robot/RobotMap.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package org.usfirst.frc4904.robot;


import org.usfirst.frc4904.robot.subsystems.CrateIO;
import org.usfirst.frc4904.robot.subsystems.RollyBOI;
import org.usfirst.frc4904.standard.custom.controllers.CustomJoystick;
import org.usfirst.frc4904.standard.custom.controllers.CustomXbox;
import org.usfirst.frc4904.standard.custom.motioncontrollers.CANTalonSRX;
import org.usfirst.frc4904.standard.custom.motioncontrollers.CustomPIDController;
import org.usfirst.frc4904.standard.custom.sensors.CANEncoder;
import org.usfirst.frc4904.standard.custom.sensors.EncoderPair;
Expand All @@ -13,6 +16,7 @@
import org.usfirst.frc4904.standard.subsystems.motor.Motor;
import org.usfirst.frc4904.standard.subsystems.motor.speedmodifiers.AccelerationCap;
import org.usfirst.frc4904.standard.subsystems.motor.speedmodifiers.EnableableModifier;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.VictorSP;

public class RobotMap {
Expand All @@ -22,7 +26,12 @@ public static class HumanInput {
public static final int xboxController = 1;
}

public static class CANMotor {}
public static class CANMotor {
public static final int crateIORollerMotorLeft = 1;
public static final int crateIORollerMotorRight = 7;
public static final int rollyBOIRollerMotorLeft = 11;
public static final int rollyBOIRollerMotorRight = 3;
}

public static class PWM {
public static final int leftDriveA = 2;
Expand All @@ -39,6 +48,8 @@ public static class CAN {
public static class Pneumatics {
public static final int shifterUp = 0;
public static final int shifterDown = 1;
public static final int rollyBOIGrabberClasped = 2;
public static final int rollyBOIGrabberReleased = 3;
}
}

Expand All @@ -60,6 +71,14 @@ public static class Wheel {

public static class Component {
public static PDP pdp;
public static Motor crateIORollerLeft;
public static Motor crateIORollerRight;
public static Motor rollyBOIRollerLeft;
public static Motor rollyBOIRollerRight;
public static DoubleSolenoid rollyBOIGrabber;
public static CrateIO crateIO;
public static RollyBOI rollyBOI;
public static CustomJoystick joystick;
public static TankDriveShifting chassis;
public static Motor leftWheel;
public static Motor rightWheel;
Expand All @@ -76,7 +95,20 @@ public static class Component {
}

public RobotMap() {
Component.joystick = new CustomJoystick(Port.HumanInput.joystick);
Component.pdp = new PDP();
Component.crateIORollerLeft = new Motor("CrateIORollerLeft", new CANTalonSRX(Port.CANMotor.crateIORollerMotorLeft));
Component.crateIORollerRight = new Motor("CrateIORollerRight", new CANTalonSRX(Port.CANMotor.crateIORollerMotorRight));
Component.crateIO = new CrateIO(Component.crateIORollerLeft, Component.crateIORollerRight);
Component.rollyBOIRollerLeft = new Motor("RollyBOIRollerLeft", new CANTalonSRX(Port.CANMotor.rollyBOIRollerMotorLeft));
Component.rollyBOIRollerLeft.setInverted(true);
Component.rollyBOIRollerRight = new Motor("RollyBOIRollerRight",
new CANTalonSRX(Port.CANMotor.rollyBOIRollerMotorRight));
Component.rollyBOIGrabber = new DoubleSolenoid(RobotMap.Port.Pneumatics.rollyBOIGrabberClasped,
RobotMap.Port.Pneumatics.rollyBOIGrabberReleased);
Component.rollyBOI = new RollyBOI(Component.rollyBOIRollerLeft, Component.rollyBOIRollerRight,
Component.rollyBOIGrabber);

// Wheels
Component.leftWheelEncoder = new CANEncoder("LeftEncoder", Port.CAN.leftEncoder);
Component.rightWheelEncoder = new CANEncoder("RightEncoder", Port.CAN.rightEncoder);
Expand Down
10 changes: 10 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/IndexerGrabberClasp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.usfirst.frc4904.robot.commands;

import org.usfirst.frc4904.robot.subsystems.RollyBOI;

public class IndexerGrabberClasp extends IndexerGrabberSet {

public IndexerGrabberClasp() {
super(RollyBOI.GrabberState.CLASPED);
}
}
10 changes: 10 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/IndexerGrabberRelease.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.usfirst.frc4904.robot.commands;

import org.usfirst.frc4904.robot.subsystems.RollyBOI;

public class IndexerGrabberRelease extends IndexerGrabberSet {

public IndexerGrabberRelease() {
super(RollyBOI.GrabberState.RELEASED);
}
}
29 changes: 29 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/IndexerGrabberSet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.usfirst.frc4904.robot.commands;


import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.subsystems.RollyBOI;
import edu.wpi.first.wpilibj.command.Command;

public class IndexerGrabberSet extends Command {
protected final RollyBOI.GrabberState state;

public IndexerGrabberSet(RollyBOI.GrabberState state) {
this.state = state;
}

@Override
protected void initialize() {
RobotMap.Component.rollyBOI.setState(state);
}

@Override
protected void interrupted() {
RobotMap.Component.rollyBOI.setState(RollyBOI.GrabberState.CLASPED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't put anything here.

}

@Override
protected boolean isFinished() {
return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let it run indefinitely.

}
}
15 changes: 15 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/IndexerIntake.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.usfirst.frc4904.robot.commands;


import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.subsystems.RollyBOI;
import org.usfirst.frc4904.standard.commands.motor.MotorConstant;
import edu.wpi.first.wpilibj.command.CommandGroup;

public class IndexerIntake extends CommandGroup {
public IndexerIntake() {
requires(RobotMap.Component.rollyBOI);
addParallel(new MotorConstant(RobotMap.Component.rollyBOIRollerLeft, RollyBOI.INTAKE_SPEED));
addParallel(new MotorConstant(RobotMap.Component.rollyBOIRollerRight, RollyBOI.INTAKE_SPEED));
}
}
19 changes: 19 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/IndexerOuttake.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.usfirst.frc4904.robot.commands;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.subsystems.RollyBOI;
import org.usfirst.frc4904.standard.commands.motor.MotorConstant;
import edu.wpi.first.wpilibj.command.CommandGroup;


public class IndexerOuttake extends CommandGroup {

public IndexerOuttake() {
super("IndexerRollersOuttake");
requires(RobotMap.Component.rollyBOI);
addParallel(new MotorConstant(RobotMap.Component.rollyBOI.rollerLeft, RollyBOI.OUTTAKE_SPEED));
addParallel(new MotorConstant(RobotMap.Component.rollyBOI.rollerRight, RollyBOI.OUTTAKE_SPEED));
}


}
16 changes: 16 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/IntakeRollersIntake.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.usfirst.frc4904.robot.commands;


import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.subsystems.CrateIO;
import org.usfirst.frc4904.standard.commands.motor.MotorConstant;
import edu.wpi.first.wpilibj.command.CommandGroup;

public class IntakeRollersIntake extends CommandGroup {
public IntakeRollersIntake() {
super("IntakeRollersIntake");
requires(RobotMap.Component.crateIO);
addParallel(new MotorConstant(RobotMap.Component.crateIO.rollerLeft, CrateIO.INTAKE_SPEED));
addParallel(new MotorConstant(RobotMap.Component.crateIO.rollerRight, CrateIO.INTAKE_SPEED));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stop using both of these seperately, instead use the set command included in teh subsystem

}
}
16 changes: 16 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/IntakeRollersOuttake.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.usfirst.frc4904.robot.commands;


import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.subsystems.CrateIO;
import org.usfirst.frc4904.standard.commands.motor.MotorConstant;
import edu.wpi.first.wpilibj.command.CommandGroup;

public class IntakeRollersOuttake extends CommandGroup {
public IntakeRollersOuttake() {
super("IntakeRollersOuttake");
requires(RobotMap.Component.crateIO);
addParallel(new MotorConstant(RobotMap.Component.crateIO.rollerLeft, CrateIO.OUTTAKE_SPEED));
addParallel(new MotorConstant(RobotMap.Component.crateIO.rollerRight, CrateIO.OUTTAKE_SPEED));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the set command

}
}
15 changes: 15 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/IntakeSquared.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.usfirst.frc4904.robot.commands;


import org.usfirst.frc4904.robot.RobotMap;
import edu.wpi.first.wpilibj.command.CommandGroup;

public class IntakeSquared extends CommandGroup {
public IntakeSquared() {
super("IntakeSquared");
requires(RobotMap.Component.crateIO);
requires(RobotMap.Component.rollyBOI);
addParallel(new IndexerIntake());
addParallel(new IntakeRollersIntake());
}
}
71 changes: 71 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/MotorIdleGroup.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package org.usfirst.frc4904.robot.commands;


import org.usfirst.frc4904.standard.LogKitten;
import org.usfirst.frc4904.standard.commands.KittenCommand;
import org.usfirst.frc4904.standard.commands.motor.MotorIdle;
import org.usfirst.frc4904.standard.subsystems.motor.Motor;
import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
* Idles motors of a subsystem.
* Used as a default command
*
*/
public class MotorIdleGroup extends CommandGroup{

/**
* Run MotorIdle (from WPILib) in parallel on every motor
* from a list of motors with unrestricted size.
*
* @param name
* @param subsystem
* @param motors
*/
public MotorIdleGroup(String name, Subsystem subsystem, boolean isDebug, Motor... motors) {
super(name);
requires(subsystem);
String logMessage = "";
for (Motor motor : motors) {
requires(motor);
addParallel(new MotorIdle(motor));
if (isDebug){
if (motor.getName() != null) {
logMessage += motor.getName() + " ";
} else {
logMessage += "unnamed motor ";
}
logMessage += "idling";
addParallel(new KittenCommand(logMessage, LogKitten.KittenLevel.WTF));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not want I meant. calling super("name") will use that name for prexisting logs. I don't think you should manually log them, but you should pass the name as all of the motors together

}
}
}

/**
* Run MotorIdle (from WPILib) in parallel on every motor
* from a list of motors with unrestricted size.
*
* @param name
* @param subsystem
* @param motors
*/
public MotorIdleGroup(String name, Subsystem subsystem, Motor... motors) {
this(name, subsystem, false, motors);
}

/**
* Run MotorIdle (from WPILib) in parallel on every motor
* from a list of motors with unrestricted size.
* Logs the names of all motors that are being idled
*
* @param subsystem
* @param motors
*/
public MotorIdleGroup(Subsystem subsystem, Motor... motors) {
this("Idling Motors", subsystem, motors);
}
}



16 changes: 16 additions & 0 deletions src/org/usfirst/frc4904/robot/commands/OuttakeSquared.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.usfirst.frc4904.robot.commands;


import org.usfirst.frc4904.robot.RobotMap;
import edu.wpi.first.wpilibj.command.CommandGroup;

public class OuttakeSquared extends CommandGroup {

public OuttakeSquared() {
super("OuttakeSquared");
requires(RobotMap.Component.crateIO);
requires(RobotMap.Component.rollyBOI);
addParallel(new IndexerOuttake());
addParallel(new IntakeRollersOuttake());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.usfirst.frc4904.robot.humaninterface.operators;


import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.commands.IndexerGrabberClasp;
import org.usfirst.frc4904.robot.commands.IndexerGrabberRelease;
import org.usfirst.frc4904.robot.commands.IntakeSquared;
import org.usfirst.frc4904.robot.commands.OuttakeSquared;
import org.usfirst.frc4904.standard.humaninput.Operator;

public class DefaultOperator extends Operator {
public DefaultOperator() {
super("DefaultOperator");
}

public DefaultOperator(String name) {
super(name);
}

@Override
public void bindCommands() {
RobotMap.Component.joystick.button3.onlyWhileHeld(new IntakeSquared());
RobotMap.Component.joystick.button3.whenPressed(new IndexerGrabberRelease());
RobotMap.Component.joystick.button3.whenReleased(new IndexerGrabberClasp());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels janky. Is there any way you can set the default state by clasping?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't make it part of the default command because it might act weirdly if we tell it to go to a certain state repeatedly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just looked @ what we did for GearIO last year, which you will want to model. Essentially we have two commands mapped to button3, one of them being button3.whenPressed(command to change pistons, which prevents the solenoids from continuously firing while held. Make sense?

Copy link
Member Author

@NikhilSuresh24 NikhilSuresh24 Feb 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what this code is doing now. This code is in a format like GearIO, we have two commands mapped to button3 and button 4

RobotMap.Component.joystick.button4.onlyWhileHeld(new OuttakeSquared());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need buttons 5 & 6 to be mapped to forcefully opening and closing the rollyBOI pistons, in that order.

RobotMap.Component.joystick.button4.whenPressed(new IndexerGrabberRelease());
RobotMap.Component.joystick.button4.whenReleased(new IndexerGrabberClasp());
}
}
Loading