Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Format code with google-java-format #68

Open
wants to merge 2 commits into
base: postseason
Choose a base branch
from
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
29 changes: 12 additions & 17 deletions src/main/java/edu/bearbots/BearLib/drivebase/Drivebase.java
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
package edu.bearbots.BearLib.drivebase;

import com.revrobotics.CANSparkMax;
import com.revrobotics.REVLibError;
import com.revrobotics.CANSparkMax.IdleMode;
import com.revrobotics.REVLibError;

import java.util.Map;

/**
* Abstract class to handle common drivebase motor controller functions.
*/
/** Abstract class to handle common drivebase motor controller functions. */
public abstract class Drivebase {
// for all drive bases? don't implement motors
// odometry
// driving
// move to

/**
* Sets the current limit for Spark Max motor controllers, given a free limit
* and a stall limit (in amps) as well as any number of Spark Maxes.
*
* @param freeLimit The free limit (in amps)
* Sets the current limit for Spark Max motor controllers, given a free limit and a stall limit
* (in amps) as well as any number of Spark Maxes.
*
* @param freeLimit The free limit (in amps)
* @param stallLimit The stall limit (in amps)
* @param motor The Spark Maxes
* @param motor The Spark Maxes
* @return An array of errors, if any
*/
public REVLibError[] setCurrentLimit(int freeLimit, int stallLimit, CANSparkMax... motor) {
Expand All @@ -35,13 +31,12 @@ public REVLibError[] setCurrentLimit(int freeLimit, int stallLimit, CANSparkMax.

return errors;
}


/**
* Sets the idle mode for Spark Max motor controllers, given an idle mode and
* any number of Spark Maxes.
*
* @param mode The idle mode
* Sets the idle mode for Spark Max motor controllers, given an idle mode and any number of Spark
* Maxes.
*
* @param mode The idle mode
* @param motor The Spark Maxes
* @return An array of errors, if any
*/
Expand All @@ -57,4 +52,4 @@ public REVLibError[] setIdleMode(IdleMode mode, CANSparkMax... motor) {
return errors;
}
}
// inclue
// inclue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package edu.bearbots.BearLib.drivebase;

public abstract class MecanumDrivebase extends Drivebase {
}
public abstract class MecanumDrivebase extends Drivebase {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package edu.bearbots.BearLib.drivebase;

public abstract class SwerveDrivebase extends Drivebase {
}
public abstract class SwerveDrivebase extends Drivebase {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package edu.bearbots.BearLib.drivebase;

public abstract class TankDrivebase extends Drivebase {
}
public abstract class TankDrivebase extends Drivebase {}
10 changes: 3 additions & 7 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@
import edu.wpi.first.wpilibj.XboxController;

/**
* The Constants class provides a convenient place for teams to hold robot-wide
* numerical or boolean
* constants. This class should not be used for any other purpose. All constants
* should be declared
* The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean
* constants. This class should not be used for any other purpose. All constants should be declared
* globally (i.e. public static). Do not put anything functional in this class.
*
* <p>
* It is advised to statically import this class (or one of its inner classes)
* wherever the
* <p>It is advised to statically import this class (or one of its inner classes) wherever the
* constants are needed, to reduce verbosity.
*/
public final class Constants {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/Interfaces/CANSparkMax.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ public CANSparkMax(int deviceId, MotorType type) {
* public boolean isInverted;
* public boolean roboRIO;
* }
*
*
* public class PeriodicStatus1 {
* public double sensorVelocity;
* public byte motorTemperature;
* public double busVoltage;
* public double outputCurrent;
* }
*
*
* public class PeriodicStatus2 {
* public double sensorPosition;
* public double iAccum;
Expand Down
12 changes: 4 additions & 8 deletions src/main/java/frc/robot/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@
import edu.wpi.first.wpilibj.RobotBase;

/**
* Do NOT add any static variables to this class, or any initialization at all.
* Unless you know what
* you are doing, do not modify this file except to change the parameter class
* to the startRobot
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what
* you are doing, do not modify this file except to change the parameter class to the startRobot
* call.
*/
public final class Main {
private Main() {
}
private Main() {}

/**
* Main initialization function. Do not perform any initialization here.
*
* <p>
* If you change your main robot class, change the parameter type.
* <p>If you change your main robot class, change the parameter type.
*/
public static void main(String... args) {
RobotBase.startRobot(Robot::new);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/RebindHat.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package frc.robot;

/** @deprecated */
/**
* @deprecated
*/
// dude come onthis is the deffinition fo unnesseary complecity
@Deprecated
public class RebindHat {
public static double JoystickToYAxis() {

}
public static double JoystickToYAxis() {}

public static double JoystickToXAxis() {
if (RobotContainer.m_armController.getPOV() == -1
Expand Down
45 changes: 14 additions & 31 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@
import edu.wpi.first.wpilibj2.command.CommandScheduler;

/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to
* each mode, as described in the TimedRobot documentation. If you change the
* name of this class or
* the package after creating this project, you must also update the
* build.gradle file in the
* The VM is configured to automatically run this class, and to call the functions corresponding to
* each mode, as described in the TimedRobot documentation. If you change the name of this class or
* the package after creating this project, you must also update the build.gradle file in the
* project.
*/
public class Robot extends TimedRobot {
Expand All @@ -26,8 +23,7 @@ public class Robot extends TimedRobot {
private RobotContainer m_robotContainer;

/**
* This function is run when the robot is first started up and should be used
* for any
* This function is run when the robot is first started up and should be used for any
* initialization code.
*/
@Override
Expand All @@ -45,13 +41,10 @@ public void robotInit() {
}

/**
* This function is called every 20 ms, no matter the mode. Use this for items
* like diagnostics
* This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
* that you want ran during disabled, autonomous, teleoperated and test.
*
* <p>
* This runs after the mode specific periodic functions, but before LiveWindow
* and
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
*/
@Override
Expand All @@ -69,17 +62,12 @@ public void robotPeriodic() {

/** This function is called once each time the robot enters Disabled mode. */
@Override
public void disabledInit() {
}
public void disabledInit() {}

@Override
public void disabledPeriodic() {
}
public void disabledPeriodic() {}

/**
* This autonomous runs the autonomous command selected by your
* {@link RobotContainer} class.
*/
/** This autonomous runs the autonomous command selected by your {@link RobotContainer} class. */
@Override
public void autonomousInit() {
m_autonomousCommand = m_robotContainer.getAutonomousCommand();
Expand All @@ -92,8 +80,7 @@ public void autonomousInit() {

/** This function is called periodically during autonomous. */
@Override
public void autonomousPeriodic() {
}
public void autonomousPeriodic() {}

@Override
public void teleopInit() {
Expand All @@ -110,8 +97,7 @@ public void teleopInit() {

/** This function is called periodically during operator control. */
@Override
public void teleopPeriodic() {
}
public void teleopPeriodic() {}

@Override
public void testInit() {
Expand All @@ -121,16 +107,13 @@ public void testInit() {

/** This function is called periodically during test mode. */
@Override
public void testPeriodic() {
}
public void testPeriodic() {}

/** This function is called once when the robot is first started up. */
@Override
public void simulationInit() {
}
public void simulationInit() {}

/** This function is called periodically whilst in simulation. */
@Override
public void simulationPeriodic() {
}
public void simulationPeriodic() {}
}
Loading