Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event ready #242

Merged
merged 10 commits into from
Mar 17, 2024
Merged
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
6 changes: 6 additions & 0 deletions src/main/deploy/pathplanner/autos/Start3.0-8.auto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"type": "sequential",
"data": {
"commands": [
{
"type": "wait",
"data": {
"waitTime": 0.5
}
},
{
"type": "path",
"data": {
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Approach8-N8.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"waypoints": [
{
"anchor": {
"x": 7.19745075853788,
"x": 6.5,
"y": 0.76
},
"prevControl": null,
"nextControl": {
"x": 7.552678820371882,
"x": 6.855228061834001,
"y": 0.76
},
"isLocked": false,
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/N1-N8.path
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
},
{
"anchor": {
"x": 7.19745075853788,
"x": 6.5,
"y": 0.76
},
"prevControl": {
"x": 4.2868820283095115,
"x": 3.589431269771631,
"y": 1.375697231394462
},
"nextControl": null,
Expand Down
6 changes: 3 additions & 3 deletions src/main/deploy/pathplanner/paths/N3-PoseB.path
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
},
{
"anchor": {
"x": 1.3,
"x": 1.1,
"y": 5.65
},
"prevControl": {
"x": 1.8520741952238022,
"x": 1.6520741952238023,
"y": 5.77451654592646
},
"nextControl": null,
"isLocked": false,
"linkedName": "PoseB"
"linkedName": null
}
],
"rotationTargets": [],
Expand Down
16 changes: 8 additions & 8 deletions src/main/deploy/pathplanner/paths/N8-PoseC.path
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@
},
{
"anchor": {
"x": 0.9,
"y": 4.344720358484939
"x": 0.787031987758696,
"y": 4.391563704668065
},
"prevControl": {
"x": 1.040478444593253,
"y": 3.274389821506916
"x": 0.9275104323519487,
"y": 3.3212331676900417
},
"nextControl": null,
"isLocked": false,
"linkedName": "PoseC"
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 5.0,
"maxAcceleration": 5.0,
"maxVelocity": 4.0,
"maxAcceleration": 4.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand All @@ -48,5 +48,5 @@
"rotation": 180.0,
"velocity": 0
},
"useDefaultConstraints": false
"useDefaultConstraints": true
}
8 changes: 4 additions & 4 deletions src/main/deploy/pathplanner/paths/PoseC-8Sweep.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"waypoints": [
{
"anchor": {
"x": 0.9,
"y": 4.344720358484939
"x": 0.7,
"y": 4.34
},
"prevControl": null,
"nextControl": {
"x": 1.5131038535971493,
"y": 2.9042874633538145
"x": 1.3131038535971493,
"y": 2.899567104868875
},
"isLocked": false,
"linkedName": "PoseC"
Expand Down
20 changes: 10 additions & 10 deletions src/main/deploy/pathplanner/paths/PoseC-Approach8.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"waypoints": [
{
"anchor": {
"x": 0.9,
"y": 4.344720358484939
"x": 0.7,
"y": 4.34
},
"prevControl": null,
"nextControl": {
"x": 3.5976327587462578,
"y": 2.1079505782406716
"x": 3.3976327587462576,
"y": 2.103230219755732
},
"isLocked": false,
"linkedName": "PoseC"
},
{
"anchor": {
"x": 7.19745075853788,
"x": 6.5,
"y": 0.76
},
"prevControl": {
"x": 6.283186062972795,
"y": 0.76
"x": 3.667897778020947,
"y": 0.8256861256661172
},
"nextControl": null,
"isLocked": false,
Expand All @@ -38,8 +38,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 4.0,
"maxAcceleration": 4.0,
"maxVelocity": 3.5,
"maxAcceleration": 3.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand All @@ -54,5 +54,5 @@
"rotation": 122.0,
"velocity": 0
},
"useDefaultConstraints": true
"useDefaultConstraints": false
}
8 changes: 4 additions & 4 deletions src/main/deploy/pathplanner/paths/PoseC-N1.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"waypoints": [
{
"anchor": {
"x": 0.9,
"y": 4.344720358484939
"x": 0.7,
"y": 4.34
},
"prevControl": null,
"nextControl": {
"x": 1.3296695684300457,
"y": 4.384510587202993
"x": 1.1296695684300455,
"y": 4.379790228718053
},
"isLocked": false,
"linkedName": "PoseC"
Expand Down
8 changes: 4 additions & 4 deletions src/main/deploy/pathplanner/paths/PoseC-N8.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"waypoints": [
{
"anchor": {
"x": 0.9,
"y": 4.344720358484939
"x": 0.7,
"y": 4.34
},
"prevControl": null,
"nextControl": {
"x": 3.5976327587462578,
"y": 2.1079505782406716
"x": 3.3976327587462576,
"y": 2.103230219755732
},
"isLocked": false,
"linkedName": "PoseC"
Expand Down
6 changes: 3 additions & 3 deletions src/main/deploy/pathplanner/paths/S2-0-2.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 4.0,
"maxAcceleration": 4.0,
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand All @@ -48,5 +48,5 @@
"rotation": 180.0,
"velocity": 0
},
"useDefaultConstraints": true
"useDefaultConstraints": false
}
12 changes: 6 additions & 6 deletions src/main/deploy/pathplanner/paths/S3-PoseC.path
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
},
{
"anchor": {
"x": 0.9,
"y": 4.344720358484939
"x": 0.7,
"y": 4.34
},
"prevControl": {
"x": 0.884333793113009,
"y": 4.371855024775093
"x": 0.6843337931130089,
"y": 4.367134666290154
},
"nextControl": null,
"isLocked": false,
Expand All @@ -38,8 +38,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.5,
"maxAcceleration": 3.5,
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
8 changes: 4 additions & 4 deletions src/main/deploy/pathplanner/paths/ShotC-N7.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"waypoints": [
{
"anchor": {
"x": 0.9,
"y": 4.344720358484939
"x": 0.7,
"y": 4.34
},
"prevControl": null,
"nextControl": {
"x": 3.1860900085436534,
"y": 0.708984690696655
"x": 2.9860900085436537,
"y": 0.7042643322117157
},
"isLocked": false,
"linkedName": "PoseC"
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package frc.robot;

import com.ctre.phoenix6.SignalLogger;
// import com.ctre.phoenix6.SignalLogger;

import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.cscore.CvSink;
Expand All @@ -23,7 +23,8 @@ public class Robot extends TimedRobot {
@Override
public void robotInit() {
m_robotContainer = new RobotContainer();
SignalLogger.setPath("/media/sda1/");
//DO NOT LEAVE THIS UNCOMMENTED DURING COMPETITION
// SignalLogger.setPath("/media/sda1/");
// SignalLogger.start();
CameraServer.startAutomaticCapture();
// Creates the CvSink and connects it to the UsbCamera
Expand Down
16 changes: 9 additions & 7 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public class RobotContainer {
};

private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1) // Add a 10% deadband
.withDriveRequestType(DriveRequestType.OpenLoopVoltage); // I want field-centric
// driving in open loop
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1) // Add a 10% deadband
.withDriveRequestType(DriveRequestType.OpenLoopVoltage); // I want field-centric
// driving in open loop
private final SwerveRequest.SwerveDriveBrake brake = new SwerveRequest.SwerveDriveBrake();
private final SwerveRequest.PointWheelsAt point = new SwerveRequest.PointWheelsAt();
private final Telemetry logger = new Telemetry(MaxSpeed);
Expand Down Expand Up @@ -137,11 +137,13 @@ private void configureBindings() {
.withRotationalRate(-m_driverController.getRightX() * MaxAngularRate) // Drive counterclockwise with
// negative X (left)
;
drivetrain.setDefaultCommand( // Drivetrain will execute this command periodically
drivetrain.setDefaultCommand( // Drivetrain will execute this command periodically
// Drive forward with negative Y (forward)

drivetrain.applyRequest(() -> driveRequest));

drivetrain.applyRequest(() -> drive.withVelocityX(-m_driverController.getLeftY() * MaxSpeed)
.withVelocityY(-m_driverController.getLeftX() * MaxSpeed) // Drive left with negative X (left)
.withRotationalRate(-m_driverController.getRightX() * MaxAngularRate) // Drive counterclockwise with
// negative X (left)
));
// m_driverController.a().whileTrue(drivetrain.applyRequest(() -> brake));
/*
* m_driverController.b().whileTrue(drivetrain
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/generated/TunerConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class TunerConstants {

// The stator current at which the wheels start to slip;
// This needs to be tuned to your individual robot
private static final double kSlipCurrentA = 300.0;
private static final double kSlipCurrentA = 65.0;

// Theoretical free speed (m/s) at 12v applied output;
// This needs to be tuned to your individual robot
Expand Down
Loading