Skip to content

Commit

Permalink
moved everything out of subsystems/
Browse files Browse the repository at this point in the history
  • Loading branch information
AngleSideAngle committed Oct 25, 2023
1 parent c9fdf9e commit 50a4775
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 205 deletions.
34 changes: 0 additions & 34 deletions src/main/java/org/sciborgs1155/robot/Constants.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package org.sciborgs1155.robot;

import edu.wpi.first.math.geometry.Rotation3d;
import edu.wpi.first.math.geometry.Transform3d;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.geometry.Translation3d;
import edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints;
import edu.wpi.first.math.util.Units;
import java.awt.Color;
import java.util.Map;
import org.photonvision.PhotonPoseEstimator.PoseStrategy;
import org.sciborgs1155.lib.constants.MotorConfig;
import org.sciborgs1155.lib.constants.MotorConfig.NeutralBehavior;
import org.sciborgs1155.lib.constants.PIDConstants;
Expand Down Expand Up @@ -74,35 +69,6 @@ public static final class Dimensions {
// Mass of the claw alone
}

public static final class Vision {
// Camera names
public static final String FRONT_CAM = "frontPhotonVision";
public static final String BACK_CAM = "backPhotonVision";

// Robot to camera translations
public static final Translation3d FRONT_CAM_TRANSLATION =
new Translation3d(0.165, -0.305, 0.356);
public static final Rotation3d FRONT_CAM_ROTATION = new Rotation3d(1.64933614, 1.78, 0);
public static final Transform3d ROBOT_TO_FRONT_CAM =
new Transform3d(FRONT_CAM_TRANSLATION, FRONT_CAM_ROTATION);

public static final Translation3d BACK_CAM_TRANSLATION =
new Translation3d(); // Units.degreesToRadians(-180)
public static final Rotation3d BACK_CAM_ROTATION =
new Rotation3d(0, 0, Units.degreesToRadians(-180));
public static final Transform3d ROBOT_TO_BACK_CAM =
new Transform3d(BACK_CAM_TRANSLATION, BACK_CAM_ROTATION);

public static final PoseStrategy PRIMARY_POSE_STRATEGY = PoseStrategy.LOWEST_AMBIGUITY;
public static final PoseStrategy SECONDARY_POSE_STRATEGY = PoseStrategy.LOWEST_AMBIGUITY;

public static final double LED_RANGE = 9000;
public static final double CAM_FOV = 68.5;
public static final double MIN_TARGET_AREA = 90;
public static final int CAMERA_RES_WIDTH = 960;
public static final int CAMERA_RES_HEIGHT = 544;
}

public static final class Intake {
public static final MotorConfig MOTOR_CFG =
MotorConfig.base()
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/org/sciborgs1155/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
import org.sciborgs1155.lib.failure.FaultBuilder;
import org.sciborgs1155.lib.failure.HardwareFault;
import org.sciborgs1155.robot.Ports.OI;
import org.sciborgs1155.robot.commands.Autos;
import org.sciborgs1155.robot.arm.Arm;
import org.sciborgs1155.robot.arm.ArmConstants.Elbow;
import org.sciborgs1155.robot.arm.ArmConstants.Elevator;
import org.sciborgs1155.robot.arm.ArmConstants.Wrist;
import org.sciborgs1155.robot.arm.ArmState;
import org.sciborgs1155.robot.arm.ArmState.GamePiece;
import org.sciborgs1155.robot.arm.ArmState.Goal;
import org.sciborgs1155.robot.auto.Autos;
import org.sciborgs1155.robot.drive.Drive;
import org.sciborgs1155.robot.subsystems.Intake;
import org.sciborgs1155.robot.subsystems.LED;
import org.sciborgs1155.robot.subsystems.arm.Arm;
import org.sciborgs1155.robot.subsystems.arm.ArmConstants.Elbow;
import org.sciborgs1155.robot.subsystems.arm.ArmConstants.Elevator;
import org.sciborgs1155.robot.subsystems.arm.ArmConstants.Wrist;
import org.sciborgs1155.robot.subsystems.arm.ArmState;
import org.sciborgs1155.robot.subsystems.arm.ArmState.GamePiece;
import org.sciborgs1155.robot.subsystems.arm.ArmState.Goal;
import org.sciborgs1155.robot.intake.Intake;
import org.sciborgs1155.robot.intake.LED;
import org.sciborgs1155.robot.vision.NoVision;
import org.sciborgs1155.robot.vision.VisionIO;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import static org.sciborgs1155.robot.subsystems.arm.ArmConstants.*;
import static org.sciborgs1155.robot.arm.ArmConstants.*;

import edu.wpi.first.math.trajectory.TrapezoidProfile;
import edu.wpi.first.math.trajectory.TrapezoidProfile.State;
Expand All @@ -22,12 +22,12 @@
import org.sciborgs1155.lib.failure.FaultBuilder;
import org.sciborgs1155.lib.failure.HardwareFault;
import org.sciborgs1155.robot.Robot;
import org.sciborgs1155.robot.subsystems.arm.ArmState.GamePiece;
import org.sciborgs1155.robot.subsystems.arm.ArmState.Goal;
import org.sciborgs1155.robot.subsystems.arm.ElevatorIO.ElevatorConfig;
import org.sciborgs1155.robot.subsystems.arm.JointIO.JointConfig;
import org.sciborgs1155.robot.subsystems.arm.TrajectoryCache.ArmTrajectory;
import org.sciborgs1155.robot.subsystems.arm.TrajectoryCache.Parameters;
import org.sciborgs1155.robot.arm.ArmState.GamePiece;
import org.sciborgs1155.robot.arm.ArmState.Goal;
import org.sciborgs1155.robot.arm.ElevatorIO.ElevatorConfig;
import org.sciborgs1155.robot.arm.JointIO.JointConfig;
import org.sciborgs1155.robot.arm.TrajectoryCache.ArmTrajectory;
import org.sciborgs1155.robot.arm.TrajectoryCache.Parameters;

public class Arm extends SubsystemBase implements Fallible, Loggable, AutoCloseable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import edu.wpi.first.math.system.plant.DCMotor;
import edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints;
Expand All @@ -9,8 +9,8 @@
import org.sciborgs1155.lib.constants.PIDConstants;
import org.sciborgs1155.robot.Constants;
import org.sciborgs1155.robot.Constants.Dimensions;
import org.sciborgs1155.robot.subsystems.arm.ElevatorIO.ElevatorConfig;
import org.sciborgs1155.robot.subsystems.arm.JointIO.JointConfig;
import org.sciborgs1155.robot.arm.ElevatorIO.ElevatorConfig;
import org.sciborgs1155.robot.arm.JointIO.JointConfig;

public class ArmConstants {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.geometry.Pose2d;
Expand All @@ -11,8 +11,8 @@
import org.sciborgs1155.robot.Constants;
import org.sciborgs1155.robot.Constants.Dimensions;
import org.sciborgs1155.robot.Constants.RobotType;
import org.sciborgs1155.robot.subsystems.arm.ArmConstants.Elbow;
import org.sciborgs1155.robot.subsystems.arm.ArmConstants.Elevator;
import org.sciborgs1155.robot.arm.ArmConstants.Elbow;
import org.sciborgs1155.robot.arm.ArmConstants.Elevator;

/** ArmState class to store relative angles for the arm. */
public record ArmState(double elevatorHeight, Rotation2d elbowAngle, Rotation2d wristAngle) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import edu.wpi.first.math.system.plant.DCMotor;
import edu.wpi.first.math.trajectory.TrapezoidProfile.State;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.system.plant.DCMotor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import edu.wpi.first.math.trajectory.TrapezoidProfile.State;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.trajectory.TrapezoidProfile.State;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import static org.sciborgs1155.robot.Ports.Elbow.*;

Expand All @@ -17,7 +17,7 @@
import org.sciborgs1155.lib.failure.FaultBuilder;
import org.sciborgs1155.lib.failure.HardwareFault;
import org.sciborgs1155.robot.Constants;
import org.sciborgs1155.robot.subsystems.arm.ArmConstants.Elbow;
import org.sciborgs1155.robot.arm.ArmConstants.Elbow;

public class RealElbow implements JointIO {
private final CANSparkMax middleMotor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import static org.sciborgs1155.robot.Ports.Elevator.*;

Expand All @@ -15,7 +15,7 @@
import org.sciborgs1155.lib.failure.FaultBuilder;
import org.sciborgs1155.lib.failure.HardwareFault;
import org.sciborgs1155.robot.Constants;
import org.sciborgs1155.robot.subsystems.arm.ArmConstants.Elevator;
import org.sciborgs1155.robot.arm.ArmConstants.Elevator;

public class RealElevator implements ElevatorIO {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import static org.sciborgs1155.robot.Ports.Wrist.*;

Expand All @@ -17,7 +17,7 @@
import org.sciborgs1155.lib.failure.FaultBuilder;
import org.sciborgs1155.lib.failure.HardwareFault;
import org.sciborgs1155.robot.Constants;
import org.sciborgs1155.robot.subsystems.arm.ArmConstants.Wrist;
import org.sciborgs1155.robot.arm.ArmConstants.Wrist;

public class RealWrist implements JointIO {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.VecBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.VecBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems.arm;
package org.sciborgs1155.robot.arm;

import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.util.sendable.Sendable;
Expand All @@ -9,7 +9,7 @@
import edu.wpi.first.wpilibj.util.Color;
import edu.wpi.first.wpilibj.util.Color8Bit;
import org.sciborgs1155.robot.Constants.Dimensions;
import org.sciborgs1155.robot.subsystems.arm.ArmConstants.Elevator;
import org.sciborgs1155.robot.arm.ArmConstants.Elevator;

/** Visualization class specific for our charged up bot */
public class Visualizer implements Sendable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.commands;
package org.sciborgs1155.robot.auto;

import static org.sciborgs1155.lib.PathFlipper.*;
import static org.sciborgs1155.robot.Constants.Field.*;
Expand All @@ -12,9 +12,9 @@
import java.util.Collection;
import java.util.List;
import org.sciborgs1155.lib.DeferredCommand;
import org.sciborgs1155.robot.arm.ArmState.GamePiece;
import org.sciborgs1155.robot.arm.ArmState.Side;
import org.sciborgs1155.robot.drive.Drive;
import org.sciborgs1155.robot.subsystems.arm.ArmState.GamePiece;
import org.sciborgs1155.robot.subsystems.arm.ArmState.Side;

public class Alignment {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.sciborgs1155.robot.commands;
package org.sciborgs1155.robot.auto;

import static org.sciborgs1155.robot.Constants.Auto.*;
import static org.sciborgs1155.robot.Constants.Field.*;
import static org.sciborgs1155.robot.arm.ArmState.*;
import static org.sciborgs1155.robot.drive.DriveConstants.*;
import static org.sciborgs1155.robot.subsystems.arm.ArmState.*;

import com.pathplanner.lib.PathPlanner;
import com.pathplanner.lib.PathPlannerTrajectory;
Expand All @@ -20,10 +20,10 @@
import edu.wpi.first.wpilibj2.command.Commands;
import java.util.List;
import java.util.function.Supplier;
import org.sciborgs1155.robot.arm.Arm;
import org.sciborgs1155.robot.arm.ArmState;
import org.sciborgs1155.robot.drive.Drive;
import org.sciborgs1155.robot.subsystems.Intake;
import org.sciborgs1155.robot.subsystems.arm.Arm;
import org.sciborgs1155.robot.subsystems.arm.ArmState;
import org.sciborgs1155.robot.intake.Intake;

public final class Autos implements Sendable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.sciborgs1155.robot.subsystems;
package org.sciborgs1155.robot.intake;

import static org.sciborgs1155.robot.Constants.Auto.*;
import static org.sciborgs1155.robot.Constants.Intake.*;
Expand All @@ -17,7 +17,7 @@
import org.sciborgs1155.lib.failure.Fallible;
import org.sciborgs1155.lib.failure.FaultBuilder;
import org.sciborgs1155.lib.failure.HardwareFault;
import org.sciborgs1155.robot.subsystems.arm.ArmState.GamePiece;
import org.sciborgs1155.robot.arm.ArmState.GamePiece;

public class Intake extends SubsystemBase implements Fallible, Loggable, AutoCloseable {

Expand Down
Loading

0 comments on commit 50a4775

Please sign in to comment.