mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Enable checkstyle on cscore, ntcore, wpiutil (#1032)
Also update to version 8.10.
This commit is contained in:
committed by
Peter Johnson
parent
ecfe95383c
commit
40cc743cc7
@@ -10,6 +10,9 @@ package edu.wpi.first.wpilibj.commands.commandgroup;
|
||||
import edu.wpi.first.wpilibj.command.CommandGroup;
|
||||
|
||||
public class ReplaceMeCommandGroup extends CommandGroup {
|
||||
/**
|
||||
* Add your docs here.
|
||||
*/
|
||||
public ReplaceMeCommandGroup() {
|
||||
// Add Commands here:
|
||||
// e.g. addSequential(new Command1());
|
||||
|
||||
@@ -13,6 +13,9 @@ import edu.wpi.first.wpilibj.command.InstantCommand;
|
||||
* Add your docs here.
|
||||
*/
|
||||
public class ReplaceMeInstantCommand extends InstantCommand {
|
||||
/**
|
||||
* Add your docs here.
|
||||
*/
|
||||
public ReplaceMeInstantCommand() {
|
||||
super();
|
||||
// Use requires() here to declare subsystem dependencies
|
||||
|
||||
@@ -13,7 +13,9 @@ import edu.wpi.first.wpilibj.command.PIDSubsystem;
|
||||
* Add your docs here.
|
||||
*/
|
||||
public class ReplaceMePIDSubsystem extends PIDSubsystem {
|
||||
// Initialize your subsystem here
|
||||
/**
|
||||
* Add your docs here.
|
||||
*/
|
||||
public ReplaceMePIDSubsystem() {
|
||||
// Intert a subsystem name and PID values here
|
||||
super("SubsystemName", 1, 2, 3);
|
||||
|
||||
@@ -13,6 +13,9 @@ import edu.wpi.first.wpilibj.command.TimedCommand;
|
||||
* Add your docs here.
|
||||
*/
|
||||
public class ReplaceMeTimedCommand extends TimedCommand {
|
||||
/**
|
||||
* Add your docs here.
|
||||
*/
|
||||
public ReplaceMeTimedCommand(double timeout) {
|
||||
super(timeout);
|
||||
// Use requires() here to declare subsystem dependencies
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.examples.axiscamera;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
import edu.wpi.cscore.AxisCamera;
|
||||
import edu.wpi.cscore.CvSink;
|
||||
import edu.wpi.cscore.CvSource;
|
||||
import edu.wpi.first.wpilibj.CameraServer;
|
||||
import edu.wpi.first.wpilibj.IterativeRobot;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
/**
|
||||
* This is a demo program showing the use of OpenCV to do vision processing. The
|
||||
|
||||
@@ -9,6 +9,8 @@ package edu.wpi.first.wpilibj.examples.gearsbot;
|
||||
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
import edu.wpi.first.wpilibj.buttons.JoystickButton;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.commands.Autonomous;
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.commands.CloseClaw;
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.commands.OpenClaw;
|
||||
@@ -17,7 +19,6 @@ import edu.wpi.first.wpilibj.examples.gearsbot.commands.Place;
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.commands.PrepareToPickup;
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.commands.SetElevatorSetpoint;
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.commands.SetWristSetpoint;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
/**
|
||||
* This class is the glue that binds the controls on the physical operator
|
||||
@@ -26,6 +27,9 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
public class OI {
|
||||
private Joystick m_joystick = new Joystick(0);
|
||||
|
||||
/**
|
||||
* Construct the OI and all of the buttons on it.
|
||||
*/
|
||||
public OI() {
|
||||
// Put Some buttons on the SmartDashboard
|
||||
SmartDashboard.putData("Elevator Bottom", new SetElevatorSetpoint(0));
|
||||
@@ -41,14 +45,14 @@ public class OI {
|
||||
SmartDashboard.putData("Deliver Soda", new Autonomous());
|
||||
|
||||
// Create some buttons
|
||||
JoystickButton dpadUp = new JoystickButton(m_joystick, 5);
|
||||
JoystickButton dpadRight = new JoystickButton(m_joystick, 6);
|
||||
JoystickButton dpadDown = new JoystickButton(m_joystick, 7);
|
||||
JoystickButton dpadLeft = new JoystickButton(m_joystick, 8);
|
||||
JoystickButton l2 = new JoystickButton(m_joystick, 9);
|
||||
JoystickButton r2 = new JoystickButton(m_joystick, 10);
|
||||
JoystickButton l1 = new JoystickButton(m_joystick, 11);
|
||||
JoystickButton r1 = new JoystickButton(m_joystick, 12);
|
||||
final JoystickButton dpadUp = new JoystickButton(m_joystick, 5);
|
||||
final JoystickButton dpadRight = new JoystickButton(m_joystick, 6);
|
||||
final JoystickButton dpadDown = new JoystickButton(m_joystick, 7);
|
||||
final JoystickButton dpadLeft = new JoystickButton(m_joystick, 8);
|
||||
final JoystickButton l2 = new JoystickButton(m_joystick, 9);
|
||||
final JoystickButton r2 = new JoystickButton(m_joystick, 10);
|
||||
final JoystickButton l1 = new JoystickButton(m_joystick, 11);
|
||||
final JoystickButton r1 = new JoystickButton(m_joystick, 12);
|
||||
|
||||
// Connect the buttons to commands
|
||||
dpadUp.whenPressed(new SetElevatorSetpoint(0.2));
|
||||
|
||||
@@ -13,6 +13,9 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
|
||||
* The main autonomous command to pickup and deliver the soda to the box.
|
||||
*/
|
||||
public class Autonomous extends CommandGroup {
|
||||
/**
|
||||
* Create a new autonomous command.
|
||||
*/
|
||||
public Autonomous() {
|
||||
addSequential(new PrepareToPickup());
|
||||
addSequential(new Pickup());
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package edu.wpi.first.wpilibj.examples.gearsbot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Command;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,7 @@ import edu.wpi.first.wpilibj.PIDController;
|
||||
import edu.wpi.first.wpilibj.PIDSource;
|
||||
import edu.wpi.first.wpilibj.PIDSourceType;
|
||||
import edu.wpi.first.wpilibj.command.Command;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
|
||||
/**
|
||||
@@ -22,6 +23,10 @@ import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
public class DriveStraight extends Command {
|
||||
private PIDController m_pid;
|
||||
|
||||
/**
|
||||
* Create a new DriveStraight command.
|
||||
* @param distance The distance to drive
|
||||
*/
|
||||
public DriveStraight(double distance) {
|
||||
requires(Robot.m_drivetrain);
|
||||
m_pid = new PIDController(4, 0, 0, new PIDSource() {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package edu.wpi.first.wpilibj.examples.gearsbot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.TimedCommand;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,9 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
|
||||
* state to drive around.
|
||||
*/
|
||||
public class Pickup extends CommandGroup {
|
||||
/**
|
||||
* Create a new pickup command.
|
||||
*/
|
||||
public Pickup() {
|
||||
addSequential(new CloseClaw());
|
||||
addParallel(new SetWristSetpoint(-45));
|
||||
|
||||
@@ -13,6 +13,9 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
|
||||
* Place a held soda can onto the platform.
|
||||
*/
|
||||
public class Place extends CommandGroup {
|
||||
/**
|
||||
* Create a new place command.
|
||||
*/
|
||||
public Place() {
|
||||
addSequential(new SetElevatorSetpoint(0.25));
|
||||
addSequential(new SetWristSetpoint(0));
|
||||
|
||||
@@ -13,6 +13,9 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
|
||||
* Make sure the robot is in a state to pickup soda cans.
|
||||
*/
|
||||
public class PrepareToPickup extends CommandGroup {
|
||||
/**
|
||||
* Create a new prepare to pickup command.
|
||||
*/
|
||||
public PrepareToPickup() {
|
||||
addParallel(new OpenClaw());
|
||||
addParallel(new SetWristSetpoint(0));
|
||||
|
||||
@@ -11,6 +11,7 @@ import edu.wpi.first.wpilibj.PIDController;
|
||||
import edu.wpi.first.wpilibj.PIDSource;
|
||||
import edu.wpi.first.wpilibj.PIDSourceType;
|
||||
import edu.wpi.first.wpilibj.command.Command;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
|
||||
/**
|
||||
@@ -22,6 +23,10 @@ import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
public class SetDistanceToBox extends Command {
|
||||
private PIDController m_pid;
|
||||
|
||||
/**
|
||||
* Create a new set distance to box command.
|
||||
* @param distance The distance away from the box to drive to
|
||||
*/
|
||||
public SetDistanceToBox(double distance) {
|
||||
requires(Robot.m_drivetrain);
|
||||
m_pid = new PIDController(-2, 0, 0, new PIDSource() {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package edu.wpi.first.wpilibj.examples.gearsbot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Command;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package edu.wpi.first.wpilibj.examples.gearsbot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Command;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package edu.wpi.first.wpilibj.examples.gearsbot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Command;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,9 @@ public class Claw extends Subsystem {
|
||||
private Victor m_motor = new Victor(7);
|
||||
private DigitalInput m_contact = new DigitalInput(5);
|
||||
|
||||
/**
|
||||
* Create a new claw subsystem.
|
||||
*/
|
||||
public Claw() {
|
||||
super();
|
||||
|
||||
|
||||
@@ -16,9 +16,10 @@ import edu.wpi.first.wpilibj.SpeedController;
|
||||
import edu.wpi.first.wpilibj.SpeedControllerGroup;
|
||||
import edu.wpi.first.wpilibj.command.Subsystem;
|
||||
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.commands.TankDriveWithJoystick;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
/**
|
||||
* The DriveTrain subsystem incorporates the sensors and actuators attached to
|
||||
@@ -39,6 +40,9 @@ public class DriveTrain extends Subsystem {
|
||||
private AnalogInput m_rangefinder = new AnalogInput(6);
|
||||
private AnalogGyro m_gyro = new AnalogGyro(1);
|
||||
|
||||
/**
|
||||
* Create a new drive train subsystem.
|
||||
*/
|
||||
public DriveTrain() {
|
||||
super();
|
||||
|
||||
@@ -87,10 +91,8 @@ public class DriveTrain extends Subsystem {
|
||||
/**
|
||||
* Tank style driving for the DriveTrain.
|
||||
*
|
||||
* @param left
|
||||
* Speed in range [-1,1]
|
||||
* @param right
|
||||
* Speed in range [-1,1]
|
||||
* @param left Speed in range [-1,1]
|
||||
* @param right Speed in range [-1,1]
|
||||
*/
|
||||
public void drive(double left, double right) {
|
||||
m_drive.tankDrive(left, right);
|
||||
|
||||
@@ -10,9 +10,10 @@ package edu.wpi.first.wpilibj.examples.gearsbot.subsystems;
|
||||
import edu.wpi.first.wpilibj.AnalogPotentiometer;
|
||||
import edu.wpi.first.wpilibj.Victor;
|
||||
import edu.wpi.first.wpilibj.command.PIDSubsystem;
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
|
||||
/**
|
||||
* The elevator subsystem uses PID to go to a given height. Unfortunately, in
|
||||
* it's current state PID values for simulation are different than in the real
|
||||
@@ -27,6 +28,9 @@ public class Elevator extends PIDSubsystem {
|
||||
private static final double kP_simulation = 18;
|
||||
private static final double kI_simulation = 0.2;
|
||||
|
||||
/**
|
||||
* Create a new elevator subsystem.
|
||||
*/
|
||||
public Elevator() {
|
||||
super(kP_real, kI_real, 0);
|
||||
if (Robot.isSimulation()) { // Check for simulation and update PID values
|
||||
|
||||
@@ -10,9 +10,10 @@ package edu.wpi.first.wpilibj.examples.gearsbot.subsystems;
|
||||
import edu.wpi.first.wpilibj.AnalogPotentiometer;
|
||||
import edu.wpi.first.wpilibj.Victor;
|
||||
import edu.wpi.first.wpilibj.command.PIDSubsystem;
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
|
||||
|
||||
/**
|
||||
* The wrist subsystem is like the elevator, but with a rotational joint instead
|
||||
* of a linear joint.
|
||||
@@ -24,6 +25,9 @@ public class Wrist extends PIDSubsystem {
|
||||
private static final double kP_real = 1;
|
||||
private static final double kP_simulation = 0.05;
|
||||
|
||||
/**
|
||||
* Create a new wrist subsystem.
|
||||
*/
|
||||
public Wrist() {
|
||||
super(kP_real, 0, 0);
|
||||
if (Robot.isSimulation()) { // Check for simulation and update PID values
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.examples.intermediatevision;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
import edu.wpi.cscore.CvSink;
|
||||
import edu.wpi.cscore.CvSource;
|
||||
import edu.wpi.cscore.UsbCamera;
|
||||
import edu.wpi.first.wpilibj.CameraServer;
|
||||
import edu.wpi.first.wpilibj.IterativeRobot;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
/**
|
||||
* This is a demo program showing the use of OpenCV to do vision processing. The
|
||||
|
||||
@@ -9,8 +9,8 @@ package edu.wpi.first.wpilibj.examples.motorcontrol;
|
||||
|
||||
import edu.wpi.first.wpilibj.IterativeRobot;
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
import edu.wpi.first.wpilibj.SpeedController;
|
||||
import edu.wpi.first.wpilibj.Spark;
|
||||
import edu.wpi.first.wpilibj.SpeedController;
|
||||
|
||||
/**
|
||||
* This sample program shows how to control a motor using a joystick. In the
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.examples.pacgoat;
|
||||
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
import edu.wpi.first.wpilibj.buttons.JoystickButton;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.pacgoat.commands.Collect;
|
||||
import edu.wpi.first.wpilibj.examples.pacgoat.commands.DriveForward;
|
||||
import edu.wpi.first.wpilibj.examples.pacgoat.commands.LowGoal;
|
||||
@@ -17,10 +21,6 @@ import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Collector;
|
||||
import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Pivot;
|
||||
import edu.wpi.first.wpilibj.examples.pacgoat.triggers.DoubleButton;
|
||||
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
import edu.wpi.first.wpilibj.buttons.JoystickButton;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
|
||||
/**
|
||||
* The operator interface of the robot, it has been simplified from the real
|
||||
* robot to allow control with a single PS3 joystick. As a result, not all
|
||||
@@ -29,6 +29,9 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
public class OI {
|
||||
public Joystick m_joystick = new Joystick(0);
|
||||
|
||||
/**
|
||||
* Create a new OI and all of the buttons on it.
|
||||
*/
|
||||
public OI() {
|
||||
new JoystickButton(m_joystick, 12).whenPressed(new LowGoal());
|
||||
new JoystickButton(m_joystick, 10).whenPressed(new Collect());
|
||||
|
||||
@@ -16,6 +16,9 @@ import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Pivot;
|
||||
* Get the robot set to collect balls.
|
||||
*/
|
||||
public class Collect extends CommandGroup {
|
||||
/**
|
||||
* Create a new collect command.
|
||||
*/
|
||||
public Collect() {
|
||||
addSequential(new SetCollectionSpeed(Collector.kForward));
|
||||
addParallel(new CloseClaw());
|
||||
|
||||
@@ -16,6 +16,9 @@ import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
|
||||
* it will wait briefly.
|
||||
*/
|
||||
public class DriveAndShootAutonomous extends CommandGroup {
|
||||
/**
|
||||
* Create a new drive and shoot autonomous.
|
||||
*/
|
||||
public DriveAndShootAutonomous() {
|
||||
addSequential(new CloseClaw());
|
||||
addSequential(new WaitForPressure(), 2);
|
||||
|
||||
@@ -30,6 +30,11 @@ public class DriveForward extends Command {
|
||||
this(dist, 0.5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new drive forward command.
|
||||
* @param dist The distance to drive
|
||||
* @param maxSpeed The maximum speed to drive at
|
||||
*/
|
||||
public DriveForward(double dist, double maxSpeed) {
|
||||
requires(Robot.drivetrain);
|
||||
m_distance = dist;
|
||||
|
||||
@@ -17,6 +17,9 @@ import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Pivot;
|
||||
* it.
|
||||
*/
|
||||
public class LowGoal extends CommandGroup {
|
||||
/**
|
||||
* Create a new low goal command.
|
||||
*/
|
||||
public LowGoal() {
|
||||
addSequential(new SetPivotSetpoint(Pivot.kLowGoal));
|
||||
addSequential(new SetCollectionSpeed(Collector.kReverse));
|
||||
|
||||
@@ -15,6 +15,9 @@ import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Collector;
|
||||
* Shoot the ball at the current angle.
|
||||
*/
|
||||
public class Shoot extends CommandGroup {
|
||||
/**
|
||||
* Create a new shoot command.
|
||||
*/
|
||||
public Shoot() {
|
||||
addSequential(new WaitForPressure());
|
||||
addSequential(new SetCollectionSpeed(Collector.kStop));
|
||||
|
||||
@@ -30,6 +30,9 @@ public class Collector extends Subsystem {
|
||||
private DigitalInput m_openDetector = new DigitalInput(6);
|
||||
private Solenoid m_piston = new Solenoid(1, 1);
|
||||
|
||||
/**
|
||||
* Create a new collector subsystem.
|
||||
*/
|
||||
public Collector() {
|
||||
// Put everything to the LiveWindow for testing.
|
||||
addChild("Roller Motor", (Victor) m_rollerMotor);
|
||||
|
||||
@@ -9,7 +9,6 @@ package edu.wpi.first.wpilibj.examples.pacgoat.subsystems;
|
||||
|
||||
import edu.wpi.first.wpilibj.AnalogGyro;
|
||||
import edu.wpi.first.wpilibj.CounterBase.EncodingType;
|
||||
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
||||
import edu.wpi.first.wpilibj.Encoder;
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
import edu.wpi.first.wpilibj.PIDSourceType;
|
||||
@@ -17,6 +16,7 @@ import edu.wpi.first.wpilibj.SpeedController;
|
||||
import edu.wpi.first.wpilibj.SpeedControllerGroup;
|
||||
import edu.wpi.first.wpilibj.Victor;
|
||||
import edu.wpi.first.wpilibj.command.Subsystem;
|
||||
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
||||
|
||||
import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
|
||||
import edu.wpi.first.wpilibj.examples.pacgoat.commands.DriveWithJoystick;
|
||||
@@ -40,6 +40,9 @@ public class DriveTrain extends Subsystem {
|
||||
private Encoder m_leftEncoder = new Encoder(3, 4, false, EncodingType.k4X);
|
||||
private AnalogGyro m_gyro = new AnalogGyro(2);
|
||||
|
||||
/**
|
||||
* Create a new drive train subsystem.
|
||||
*/
|
||||
public DriveTrain() {
|
||||
// Configure drive motors
|
||||
addChild("Front Left CIM", (Victor) m_frontLeftCIM);
|
||||
|
||||
@@ -38,6 +38,9 @@ public class Pivot extends PIDSubsystem {
|
||||
// Motor to move the pivot.
|
||||
private SpeedController m_motor = new Victor(5);
|
||||
|
||||
/**
|
||||
* Create a new pivot subsystem.
|
||||
*/
|
||||
public Pivot() {
|
||||
super("Pivot", 7.0, 0.0, 8.0);
|
||||
setAbsoluteTolerance(0.005);
|
||||
|
||||
@@ -32,6 +32,9 @@ public class Shooter extends Subsystem {
|
||||
//NOTE: currently ignored in simulation
|
||||
DigitalInput m_hotGoalSensor = new DigitalInput(3);
|
||||
|
||||
/**
|
||||
* Create a new shooter subsystem.
|
||||
*/
|
||||
public Shooter() {
|
||||
// Put everything to the LiveWindow for testing.
|
||||
addChild("Hot Goal Sensor", m_hotGoalSensor);
|
||||
|
||||
@@ -19,6 +19,12 @@ public class DoubleButton extends Trigger {
|
||||
private int m_button1;
|
||||
private int m_button2;
|
||||
|
||||
/**
|
||||
* Create a new double button trigger.
|
||||
* @param joy The joystick
|
||||
* @param button1 The first button
|
||||
* @param button2 The second button
|
||||
*/
|
||||
public DoubleButton(Joystick joy, int button1, int button2) {
|
||||
this.m_joy = joy;
|
||||
this.m_button1 = button1;
|
||||
|
||||
@@ -9,10 +9,10 @@ package edu.wpi.first.wpilibj.examples.potentiometerpid;
|
||||
|
||||
import edu.wpi.first.wpilibj.AnalogInput;
|
||||
import edu.wpi.first.wpilibj.IterativeRobot;
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
import edu.wpi.first.wpilibj.PIDController;
|
||||
import edu.wpi.first.wpilibj.Spark;
|
||||
import edu.wpi.first.wpilibj.SpeedController;
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
|
||||
/**
|
||||
* This is a sample program to demonstrate how to use a soft potentiometer and a
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.templates.sample;
|
||||
|
||||
import edu.wpi.first.wpilibj.SampleRobot;
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
import edu.wpi.first.wpilibj.SampleRobot;
|
||||
import edu.wpi.first.wpilibj.Spark;
|
||||
import edu.wpi.first.wpilibj.Timer;
|
||||
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
||||
|
||||
@@ -49,8 +49,7 @@ public class Robot extends TimedRobot {
|
||||
@Override
|
||||
public void autonomousInit() {
|
||||
m_autoSelected = m_chooser.getSelected();
|
||||
// m_autoSelected = SmartDashboard.getString("Auto Selector",
|
||||
// kDefaultAuto);
|
||||
// m_autoSelected = SmartDashboard.getString("Auto Selector", kDefaultAuto);
|
||||
System.out.println("Auto selected: " + m_autoSelected);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user