From faf777234db7b42155ebeb39b12e37d976f5f68b Mon Sep 17 00:00:00 2001 From: Aarav Shah <91212@psdschools.org> Date: Wed, 19 Feb 2020 16:25:38 -0700 Subject: [PATCH 1/3] Fixed Solenoid to Cool Falcon --- src/main/java/frc4388/robot/RobotContainer.java | 2 +- src/main/java/frc4388/robot/subsystems/Drive.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 80484b4..65199c5 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -78,7 +78,7 @@ public class RobotContainer { /* Default Commands */ // drives the robot with a two-axis input from the driver controller - m_robotDrive.setDefaultCommand(new DriveWithJoystickUsingDeadAssistPID(m_robotDrive, getDriverController())); + m_robotDrive.setDefaultCommand(new DriveWithJoystick(m_robotDrive, getDriverController())); // drives intake with input from triggers on the opperator controller m_robotIntake.setDefaultCommand(new RunIntakeWithTriggers(m_robotIntake, getOperatorController())); // drives climber with input from triggers on the opperator controller diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index 58c14fb..9afa4c9 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -66,7 +66,7 @@ public class Drive extends SubsystemBase { public DoubleSolenoid m_speedShift; public DoubleSolenoid m_coolFalcon; - public int m_currentTimeSec = (int)(System.currentTimeMillis() * 1000); + public int m_currentTimeSec = (int)(System.currentTimeMillis() / 1000); public long m_lastTime, m_deltaTime; //in milliseconds @@ -271,11 +271,15 @@ public class Drive extends SubsystemBase { @Override public void periodic() { + m_currentTimeSec = (int)(System.currentTimeMillis() / 1000); + SmartDashboard.putNumber("Time Seconds", m_currentTimeSec); if (m_currentTimeSec % 10 == 0) { coolFalcon(true); + SmartDashboard.putBoolean("Solenoid", true); } else if ((m_currentTimeSec - 2) % 10 == 0) { coolFalcon(false); + SmartDashboard.putBoolean("Solenoid", false); } m_deltaTime = System.currentTimeMillis() - m_lastTime; From 0f0b3e7208110bd5c3627c8e6084be8922d5c161 Mon Sep 17 00:00:00 2001 From: Aarav Shah <91212@psdschools.org> Date: Wed, 19 Feb 2020 17:38:15 -0700 Subject: [PATCH 2/3] Changed formatting --- src/main/java/frc4388/robot/subsystems/Drive.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index 9afa4c9..32ea707 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -84,7 +84,8 @@ public class Drive extends SubsystemBase { m_pigeon.configFactoryDefault(); resetGyroYaw(); - m_odometry = new DifferentialDriveOdometry(Rotation2d.fromDegrees(getHeading()), new Pose2d(0, 0, new Rotation2d())); + m_odometry = new DifferentialDriveOdometry( Rotation2d.fromDegrees(getHeading()), + new Pose2d(0, 0, new Rotation2d()) ); m_speedShift = new DoubleSolenoid(7,0,1); m_coolFalcon = new DoubleSolenoid(7,3,2); @@ -606,7 +607,7 @@ public class Drive extends SubsystemBase { * @param ticks The value in ticks to convert * @return The converted value in inches */ - public double ticksToInches(double ticks) { + public double ticksToInches(double ticks) { return ticks * DriveConstants.INCHES_PER_TICK; } From 0d13b05dda261589ca443611f18d5299be949ba0 Mon Sep 17 00:00:00 2001 From: Aarav Shah <91212@psdschools.org> Date: Wed, 19 Feb 2020 19:16:26 -0700 Subject: [PATCH 3/3] Testing System Time, made Simpler Trajectory --- src/main/java/frc4388/robot/RobotContainer.java | 4 ++-- src/main/java/frc4388/robot/subsystems/Drive.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 65199c5..608ec18 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -194,8 +194,8 @@ public class RobotContainer { new Pose2d(0, 0, new Rotation2d(0)), // Pass through these two interior waypoints, making an 's' curve path List.of( - new Translation2d(1, 1), - new Translation2d(2, -1) + new Translation2d(3, 0) + //new Translation2d(2, -1) ), // End 3 meters straight ahead of where we started, facing forward new Pose2d(3, 0, new Rotation2d(0)), diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index 32ea707..970aa6c 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -273,7 +273,7 @@ public class Drive extends SubsystemBase { @Override public void periodic() { m_currentTimeSec = (int)(System.currentTimeMillis() / 1000); - SmartDashboard.putNumber("Time Seconds", m_currentTimeSec); + SmartDashboard.putNumber("Time Seconds", System.currentTimeMillis()); if (m_currentTimeSec % 10 == 0) { coolFalcon(true);