mirror of
https://github.com/Team4388/2025RidgeScape.git
synced 2026-06-09 00:38:02 -06:00
fix 2025 module possitions
This commit is contained in:
@@ -3,25 +3,25 @@
|
|||||||
"waypoints": [
|
"waypoints": [
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 0.0,
|
"x": 2.780674342105263,
|
||||||
"y": 0.0
|
"y": 5.112253289473684
|
||||||
},
|
},
|
||||||
"prevControl": null,
|
"prevControl": null,
|
||||||
"nextControl": {
|
"nextControl": {
|
||||||
"x": 0.25,
|
"x": 2.7421875,
|
||||||
"y": 0.0
|
"y": 6.016694078947369
|
||||||
},
|
},
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
"linkedName": null
|
"linkedName": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 2.0,
|
"x": 3.8294407894736837,
|
||||||
"y": 0.0
|
"y": 5.862746710526316
|
||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 1.75,
|
"x": 3.5794407894736837,
|
||||||
"y": 0.0
|
"y": 5.862746710526316
|
||||||
},
|
},
|
||||||
"nextControl": null,
|
"nextControl": null,
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
"folder": null,
|
"folder": null,
|
||||||
"idealStartingState": {
|
"idealStartingState": {
|
||||||
"velocity": 0,
|
"velocity": 0,
|
||||||
"rotation": 0.0
|
"rotation": 132.26189909327812
|
||||||
},
|
},
|
||||||
"useDefaultConstraints": true
|
"useDefaultConstraints": true
|
||||||
}
|
}
|
||||||
@@ -99,41 +99,41 @@ public final class Constants {
|
|||||||
public static final double MAX_SPEED_FEET_PER_SECOND = MAX_SPEED_MEETERS_PER_SEC * 3.28084;
|
public static final double MAX_SPEED_FEET_PER_SECOND = MAX_SPEED_MEETERS_PER_SEC * 3.28084;
|
||||||
public static final double MAX_ANGULAR_SPEED_FEET_PER_SECOND = 2 * 2 * Math.PI;
|
public static final double MAX_ANGULAR_SPEED_FEET_PER_SECOND = 2 * 2 * Math.PI;
|
||||||
|
|
||||||
public static final double FORWARD_OFFSET = 0; // 0, 90, 180, 270
|
public static final double FORWARD_OFFSET = 90; // 0, 90, 180, 270
|
||||||
|
|
||||||
public static final Trim POINTLESS_TRIM = new Trim("Pointless Trim", Double.MAX_VALUE, Double.MIN_VALUE, 1.d, 10);
|
public static final Trim POINTLESS_TRIM = new Trim("Pointless Trim", Double.MAX_VALUE, Double.MIN_VALUE, 1.d, 10);
|
||||||
|
|
||||||
private static final class ModuleSpecificConstants {
|
private static final class ModuleSpecificConstants {
|
||||||
private static final Angle FRONT_LEFT_ENCODER_OFFSET = Rotations.of(0.229736328125+.25);
|
private static final Angle FRONT_LEFT_ENCODER_OFFSET = Rotations.of(0.229736328125);
|
||||||
private static final boolean FRONT_LEFT_DRIVE_MOTOR_INVERTED = false;
|
private static final boolean FRONT_LEFT_DRIVE_MOTOR_INVERTED = true;
|
||||||
private static final boolean FRONT_LEFT_STEER_MOTOR_INVERTED = true;
|
private static final boolean FRONT_LEFT_STEER_MOTOR_INVERTED = true;
|
||||||
private static final boolean FRONT_LEFT_ENCODER_INVERTED = false;
|
private static final boolean FRONT_LEFT_ENCODER_INVERTED = false;
|
||||||
private static final Distance FRONT_LEFT_XPOS = Inches.of(-HALF_WIDTH);
|
private static final Distance FRONT_LEFT_XPOS = Inches.of(HALF_HEIGHT);
|
||||||
private static final Distance FRONT_LEFT_YPOS = Inches.of(HALF_HEIGHT);
|
private static final Distance FRONT_LEFT_YPOS = Inches.of(HALF_WIDTH);
|
||||||
|
|
||||||
//Front Right
|
//Front Right
|
||||||
private static final Angle FRONT_RIGHT_ENCODER_OFFSET = Rotations.of(-0.371337890625+.5+.25);
|
private static final Angle FRONT_RIGHT_ENCODER_OFFSET = Rotations.of(-0.371337890625+.5);
|
||||||
private static final boolean FRONT_RIGHT_DRIVE_MOTOR_INVERTED = false;
|
private static final boolean FRONT_RIGHT_DRIVE_MOTOR_INVERTED = true;
|
||||||
private static final boolean FRONT_RIGHT_STEER_MOTOR_INVERTED = true;
|
private static final boolean FRONT_RIGHT_STEER_MOTOR_INVERTED = true;
|
||||||
private static final boolean FRONT_RIGHT_ENCODER_INVERTED = false;
|
private static final boolean FRONT_RIGHT_ENCODER_INVERTED = false;
|
||||||
private static final Distance FRONT_RIGHT_XPOS = Inches.of(HALF_WIDTH);
|
private static final Distance FRONT_RIGHT_XPOS = Inches.of(HALF_HEIGHT);
|
||||||
private static final Distance FRONT_RIGHT_YPOS = Inches.of(HALF_HEIGHT);
|
private static final Distance FRONT_RIGHT_YPOS = Inches.of(-HALF_WIDTH);
|
||||||
|
|
||||||
//Back Left
|
//Back Left
|
||||||
private static final Angle BACK_LEFT_ENCODER_OFFSET = Rotations.of(0.3828125+.25+.5);
|
private static final Angle BACK_LEFT_ENCODER_OFFSET = Rotations.of(0.3828125+.5);
|
||||||
private static final boolean BACK_LEFT_DRIVE_MOTOR_INVERTED = false;
|
private static final boolean BACK_LEFT_DRIVE_MOTOR_INVERTED = true;
|
||||||
private static final boolean BACK_LEFT_STEER_MOTOR_INVERTED = true;
|
private static final boolean BACK_LEFT_STEER_MOTOR_INVERTED = true;
|
||||||
private static final boolean BACK_LEFT_ENCODER_INVERTED = false;
|
private static final boolean BACK_LEFT_ENCODER_INVERTED = false;
|
||||||
private static final Distance BACK_LEFT_XPOS = Inches.of(-HALF_WIDTH);
|
private static final Distance BACK_LEFT_XPOS = Inches.of(-HALF_HEIGHT);
|
||||||
private static final Distance BACK_LEFT_YPOS = Inches.of(-HALF_HEIGHT);
|
private static final Distance BACK_LEFT_YPOS = Inches.of(HALF_WIDTH);
|
||||||
|
|
||||||
//Back Right
|
//Back Right
|
||||||
private static final Angle BACK_RIGHT_ENCODER_OFFSET = Rotations.of(-0.01904296875+.25);
|
private static final Angle BACK_RIGHT_ENCODER_OFFSET = Rotations.of(-0.07666015625);
|
||||||
private static final boolean BACK_RIGHT_DRIVE_MOTOR_INVERTED = false;
|
private static final boolean BACK_RIGHT_DRIVE_MOTOR_INVERTED = true;
|
||||||
private static final boolean BACK_RIGHT_STEER_MOTOR_INVERTED = true;
|
private static final boolean BACK_RIGHT_STEER_MOTOR_INVERTED = true;
|
||||||
private static final boolean BACK_RIGHT_ENCODER_INVERTED = false;
|
private static final boolean BACK_RIGHT_ENCODER_INVERTED = false;
|
||||||
private static final Distance BACK_RIGHT_XPOS = Inches.of(HALF_WIDTH);
|
private static final Distance BACK_RIGHT_XPOS = Inches.of(-HALF_HEIGHT);
|
||||||
private static final Distance BACK_RIGHT_YPOS = Inches.of(-HALF_HEIGHT);
|
private static final Distance BACK_RIGHT_YPOS = Inches.of(-HALF_WIDTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class IDs {
|
public static final class IDs {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import edu.wpi.first.cameraserver.CameraServer;
|
import edu.wpi.first.cameraserver.CameraServer;
|
||||||
|
import edu.wpi.first.math.geometry.Translation2d;
|
||||||
import edu.wpi.first.wpilibj.GenericHID;
|
import edu.wpi.first.wpilibj.GenericHID;
|
||||||
import frc4388.utility.controller.XboxController;
|
import frc4388.utility.controller.XboxController;
|
||||||
import frc4388.utility.controller.DeadbandedXboxController;
|
import frc4388.utility.controller.DeadbandedXboxController;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
package frc4388.robot.subsystems;
|
package frc4388.robot.subsystems;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.function.DoubleSupplier;
|
||||||
|
|
||||||
import com.ctre.phoenix6.Utils;
|
import com.ctre.phoenix6.Utils;
|
||||||
import com.ctre.phoenix6.hardware.CANcoder;
|
import com.ctre.phoenix6.hardware.CANcoder;
|
||||||
@@ -69,8 +70,13 @@ public class SwerveDrive extends Subsystem {
|
|||||||
// Handle exception as needed
|
// Handle exception as needed
|
||||||
config = null;
|
config = null;
|
||||||
}
|
}
|
||||||
|
// DoubleSupplier a = () -> 1.d;
|
||||||
AutoBuilder.configure(
|
AutoBuilder.configure(
|
||||||
() -> swerveDriveTrain.samplePoseAt(Utils.getCurrentTimeSeconds()).orElse(new Pose2d()), // Robot pose supplier
|
() -> {
|
||||||
|
var pose = swerveDriveTrain.samplePoseAt(Utils.getCurrentTimeSeconds()).orElse(new Pose2d());
|
||||||
|
pose = new Pose2d(pose.getX(), pose.getY(), pose.getRotation().times(-1));
|
||||||
|
return pose;//getRotation().times(-1)
|
||||||
|
}, // Robot pose supplier
|
||||||
swerveDriveTrain::resetPose, // Method to reset odometry (will be called if your auto has a starting pose)
|
swerveDriveTrain::resetPose, // Method to reset odometry (will be called if your auto has a starting pose)
|
||||||
() -> swerveDriveTrain.getState().Speeds, // ChassisSpeeds supplier. MUST BE ROBOT RELATIVE
|
() -> swerveDriveTrain.getState().Speeds, // ChassisSpeeds supplier. MUST BE ROBOT RELATIVE
|
||||||
(speeds, feedforwards) -> swerveDriveTrain.setControl(new SwerveRequest.ApplyRobotSpeeds()
|
(speeds, feedforwards) -> swerveDriveTrain.setControl(new SwerveRequest.ApplyRobotSpeeds()
|
||||||
@@ -121,7 +127,7 @@ public class SwerveDrive extends Subsystem {
|
|||||||
if (fieldRelative) {
|
if (fieldRelative) {
|
||||||
swerveDriveTrain.setControl(new SwerveRequest.FieldCentric()
|
swerveDriveTrain.setControl(new SwerveRequest.FieldCentric()
|
||||||
.withVelocityX(leftStick.getX()*speedAdjust)
|
.withVelocityX(leftStick.getX()*speedAdjust)
|
||||||
.withVelocityY(leftStick.getY()*speedAdjust)
|
.withVelocityY(-leftStick.getY()*speedAdjust)
|
||||||
.withRotationalRate(rightStick.getX()*rotSpeedAdjust)
|
.withRotationalRate(rightStick.getX()*rotSpeedAdjust)
|
||||||
);
|
);
|
||||||
// double rot = 0;
|
// double rot = 0;
|
||||||
@@ -159,8 +165,8 @@ public class SwerveDrive extends Subsystem {
|
|||||||
// chassisSpeeds = ChassisSpeeds.fromFieldRelativeSpeeds(-1 * speed.getX(), -1 * speed.getY(), (-1 * rightStick.getX() * rotSpeedAdjust) - rot_correction, gyro.getRotation2d().times(-1));
|
// chassisSpeeds = ChassisSpeeds.fromFieldRelativeSpeeds(-1 * speed.getX(), -1 * speed.getY(), (-1 * rightStick.getX() * rotSpeedAdjust) - rot_correction, gyro.getRotation2d().times(-1));
|
||||||
} else { // Create robot-relative speeds.
|
} else { // Create robot-relative speeds.
|
||||||
swerveDriveTrain.setControl(new SwerveRequest.RobotCentric()
|
swerveDriveTrain.setControl(new SwerveRequest.RobotCentric()
|
||||||
.withVelocityX(leftStick.getX()*-speedAdjust)
|
.withVelocityX(leftStick.getX()*speedAdjust)
|
||||||
.withVelocityY(leftStick.getY()*speedAdjust)
|
.withVelocityY(-leftStick.getY()*speedAdjust)
|
||||||
.withRotationalRate(rightStick.getX()*rotSpeedAdjust)
|
.withRotationalRate(rightStick.getX()*rotSpeedAdjust)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user