Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Team334/R2024
Browse files Browse the repository at this point in the history
  • Loading branch information
cherriae committed Jan 20, 2024
2 parents bbf75e1 + 1fafbcc commit 54ab9f1
Show file tree
Hide file tree
Showing 9 changed files with 262 additions and 150 deletions.
25 changes: 25 additions & 0 deletions src/main/deploy/pathplanner/autos/New Auto.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 1.9099007567375976,
"y": 6.998240302783657
},
"rotation": 0
},
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Test Path"
}
}
]
}
},
"folder": null,
"choreoAuto": false
}
118 changes: 118 additions & 0 deletions src/main/deploy/pathplanner/paths/Test Path.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 1.9099007567375976,
"y": 6.998240302783657
},
"prevControl": null,
"nextControl": {
"x": 2.455338244008969,
"y": 7.007485005957748
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.889839293191247,
"y": 6.998240302783657
},
"prevControl": {
"x": 2.5374475056350487,
"y": 6.998240302783657
},
"nextControl": {
"x": 2.8990839963653383,
"y": 6.998240302783657
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 1.9099007567375976,
"y": 7.608390712273665
},
"prevControl": {
"x": 1.9838583821303262,
"y": 7.6268801186218464
},
"nextControl": {
"x": 1.8576048183019434,
"y": 7.595316727664752
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.558414396107218,
"y": 7.460475461488208
},
"prevControl": {
"x": 5.595400123565224,
"y": 7.460475461488208
},
"nextControl": {
"x": 7.650861427848128,
"y": 7.460475461488208
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 1.8636772408671425,
"y": 5.472864279058636
},
"prevControl": {
"x": 4.821982256577126,
"y": 6.406579299645086
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1,
"rotationDegrees": 0,
"rotateFast": false
},
{
"waypointRelativePos": 2,
"rotationDegrees": 90.0,
"rotateFast": false
},
{
"waypointRelativePos": 3,
"rotationDegrees": 0,
"rotateFast": false
},
{
"waypointRelativePos": 3.6,
"rotationDegrees": 180.0,
"rotateFast": false
}
],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 4.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0,
"rotateFast": true
},
"reversed": false,
"folder": null,
"previewStartingState": null,
"useDefaultConstraints": false
}
129 changes: 0 additions & 129 deletions src/main/deploy/pathplanner/paths/Test1.path

This file was deleted.

26 changes: 17 additions & 9 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ public static class CAN {
}

public static class Speeds {
public static final double SWERVE_DRIVE_COEFF = 0.3;
public static final double SWERVE_DRIVE_COEFF = 1;

public static final double SWERVE_PID_KP = 0.012;

public static final double SWERVE_DRIVE_MAX_SPEED = 4.67; // TODO: Get this value
public static final double SWERVE_DRIVE_MAX_ANGULAR_SPEED = Math.PI * 1; // Todo: Get this value

public static final double SHOOTER_MAX_SPEED = 1;
}

public static class Physical {
Expand All @@ -55,17 +57,23 @@ public static class Physical {

public static final double SWERVE_DRIVE_GEAR_RATIO = 6.75;
public static final double SWERVE_DRIVE_WHEEL_RADIUS = 0.05;
public static final double SWERVE_DRIVE_WHEEL_CIRCUMFERENCE =
2 * Math.PI * SWERVE_DRIVE_WHEEL_RADIUS;
public static final double SWERVE_DRIVE_WHEEL_CIRCUMFERENCE = 2 * Math.PI * SWERVE_DRIVE_WHEEL_RADIUS;

public static final double SHOOTER_GEAR_RATIO = 1.45;
public static final double SHOOTER_FLYWHEEL_RADIUS = 1; // TODO: FIND RADIUS
public static final double SHOOTER_FLYWHEEL_CIRCUMFERENCE = 2 * Math.PI * SHOOTER_FLYWHEEL_RADIUS;


public static final double TALON_TICKS_PER_REVOLUTION = 2048;

public static final SwerveDriveKinematics SWERVE_KINEMATICS =
new SwerveDriveKinematics(
new Translation2d(0.292, 0.292),
new Translation2d(0.292, -0.292),
new Translation2d(-0.292, -0.292),
new Translation2d(-0.292, 0.292));
public static final SwerveDriveKinematics SWERVE_KINEMATICS = new SwerveDriveKinematics(
new Translation2d(0.292, 0.292),
new Translation2d(0.292, -0.292),
new Translation2d(-0.292, -0.292),
new Translation2d(-0.292, 0.292)
);

public static final double SHOOTER_PID_KP = 0;
}

public static class Offsets {
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/frc/robot/subsystems/ElevatorSubsystem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Team 334 */
/* Copyright (c) 2024 Team 334. All Rights Reserved. */

package frc.robot.subsystems;

import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;

import com.revrobotics.CANSparkMax;
import com.revrobotics.RelativeEncoder;
import com.revrobotics.CANSparkLowLevel.MotorType;

public class ElevatorSubsystem extends SubsystemBase {
/** Creates a new ElevatorSubsystem. */
public ElevatorSubsystem() {}

@Override
public void periodic() {
// This method will be called once per scheduler run
}
}
22 changes: 22 additions & 0 deletions src/main/java/frc/robot/subsystems/IntakeSubsystem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Team 334 */
/* Copyright (c) 2024 Team 334. All Rights Reserved. */

package frc.robot.subsystems;

import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;

import com.revrobotics.CANSparkMax;
import com.revrobotics.RelativeEncoder;
import com.revrobotics.CANSparkLowLevel.MotorType;

public class IntakeSubsystem extends SubsystemBase {
/** Creates a new IntakeSubsystem. */
public IntakeSubsystem() {}

@Override
public void periodic() {
// This method will be called once per scheduler run
}
}
Loading

0 comments on commit 54ab9f1

Please sign in to comment.