Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@ public interface Action {
*/
void end(double timestamp);

/**
* Returns whether action should be removed when robot has been disabled.
*
* @return Always returns false
*/
default boolean getRemoveOnDisabled() {return false;}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public class FunctionAction implements Action {
private final Runnable function;
private final boolean removeOnDisabled;

/**
* Creates a new action from a function
* @param function
* @param removeOnDisabled
*/
public FunctionAction(Runnable function, boolean removeOnDisabled) {
this.function = function;
this.removeOnDisabled = removeOnDisabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ public class ParallelAction implements Action {

private List<Action> actions;

/**
* Creates a new action that runs a list of actions to be run simultaneously
* @param actions
*/
public ParallelAction(List<? extends Action> actions) {
this.actions = new ArrayList<>(actions);
}

/**
* Creates a new action that runs a list of actions to be run simultaneously
* @param actions
*/
public ParallelAction(Action...actions) {
this(Arrays.asList(actions));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ public class SeriesAction implements Action {

private Action currentAction;

/**
* Creates a new action from a list of actions to be run sequentially
* @param actions
*/
public SeriesAction(List<? extends Action> actions) {
this.actions = new LinkedList<>(actions);
}

/**
* Creates a new action from a list of actions to be run sequentially
* @param actions
*/
public SeriesAction(Action... actions) {
this(Arrays.asList(actions));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ public class WaitAction implements Action {
private double duration;
private double startTime;

/**
* Create a new action to wait an amount of time in seconds
* @param durationInSeconds
*/
public WaitAction(double durationInSeconds) {
this.duration = durationInSeconds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.team2813.lib.drive.VelocityDrive;
import com.team2813.lib.sparkMax.CANSparkMaxWrapper;
import com.team2813.lib.sparkMax.SparkMaxException;
import com.team2813.lib.talon.CTREException;
import com.team2813.lib.ctre.CTREException;
import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.team2813.lib.controls.Button;
import com.team2813.lib.sparkMax.CANSparkMaxWrapper;
import com.team2813.lib.sparkMax.SparkMaxException;
import com.team2813.lib.talon.CTREException;
import com.team2813.lib.talon.VictorWrapper;
import com.team2813.lib.ctre.CTREException;
import com.team2813.lib.ctre.VictorWrapper;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class GroundIntake extends Subsystem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.team2813.lib.solenoid.PistonSolenoid.PistonState;
import com.team2813.lib.sparkMax.CANSparkMaxWrapper;
import com.team2813.lib.sparkMax.SparkMaxException;
import com.team2813.lib.talon.CTREException;
import com.team2813.lib.ctre.CTREException;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

import static com.team2813.frc2019.subsystems.Subsystems.GROUND_INTAKE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.team2813.frc2019.loops.Loop;
import com.team2813.lib.sparkMax.SparkMaxException;
import com.team2813.lib.talon.CTREException;
import com.team2813.lib.ctre.CTREException;

/**
* TODO rewrite this documentation block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class Subsystem1d<P extends Subsystem1d.Position> extends Subsystem {
Subsystem1d(CANSparkMaxWrapper motor) {
try {
this.motor = motor;
motor.setPeriodicFrame(CANSparkMaxLowLevel.PeriodicFrame.kStatus2, 10);
motor.setPeriodicFrame(CANSparkMaxLowLevel.PeriodicFrame.kStatus2);
motor.set(0, ControlType.kDutyCycle);
motor.setNeutralMode(CANSparkMax.IdleMode.kBrake);
} catch (SparkMaxException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.team2813.lib.sparkMax.CANSparkMaxWrapper;
import com.team2813.lib.sparkMax.SparkMaxException;
import com.team2813.lib.talon.VictorWrapper;
import com.team2813.lib.ctre.VictorWrapper;
import edu.wpi.first.wpilibj.Filesystem;

import java.io.File;
Expand Down
Loading