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

Maus meddling #185

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
3 changes: 2 additions & 1 deletion .pathplanner/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
"holonomicMode": true,
"generateJSON": false,
"generateCSV": false
}
}
//Goodbye! -> LAPTOP-J-SPECTRE1
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ convexity_max:100
convexity_min:0
corner_approx:2
crop_x_max:-0.1
crop_x_min:-0.65
crop_x_min:-0.68
crop_y_max:0.94
crop_y_min:0.1
cross_a_a:0.002056
cross_a_x:-0.580897
cross_a_a:0.002156
cross_a_x:-0.61
cross_a_y:0
cross_b_a:1
cross_b_x:0.79
Expand All @@ -31,7 +31,7 @@ dilation_steps:0
direction_filter:1
dual_close_sort_origin:0
erosion_steps:0
exposure:50
exposure:90
fiducial_decoder_strictness:strict
fiducial_denoise:0.000000
fiducial_idfilters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dilation_steps:0
direction_filter:1
dual_close_sort_origin:0
erosion_steps:0
exposure:50
exposure:90
fiducial_decoder_strictness:strict
fiducial_denoise:0.000000
fiducial_idfilters:
Expand Down
2 changes: 1 addition & 1 deletion scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*backup/
*backup/
File renamed without changes.
3 changes: 2 additions & 1 deletion scripts/auto/autos/auto_default.csv
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
time,1000
time,1000
//Goodbye! -> LAPTOP-J-SPECTRE1
2 changes: 0 additions & 2 deletions scripts/auto/autos/balanceTest.csv

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/auto/autos/coop1_bal.csv

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/auto/autos/midTest.csv

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/auto/events/outtake_cube.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
intake,outtake,cube
time,1000
time,250
intake,disabled
4 changes: 2 additions & 2 deletions scripts/auto/events/pickup_front_cube.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
intake,intake,cube
elevarm,cube,front,ground
elevarm,cube,front,ground
intake,intake,cube
4 changes: 2 additions & 2 deletions src/main/cpp/subsystems/Drivetrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void Drivetrain::init()
table->PutNumber("Vision Std", 3.0);
table->PutBoolean("Load Swerve Mag Encoder", false);

table->PutNumber("KPLIMELIGHT", 0.325);
table->PutNumber("KPLIMELIGHT", KP_LIMELIGHT);

limeTable->PutNumber("pipeline", LimelightPipes::TAPE_HIGH);
limeTable->PutNumber("ledMode", 1);
Expand Down Expand Up @@ -456,7 +456,7 @@ void Drivetrain::adas(LimelightPipes pipe){
if (limeTable->GetNumber("tv",0) == 1){
double tx = limeTable->GetNumber("tx",0);
double normalizedTx = tx / KLIMELIGHT;
double kPlimeLight = KP_LIMELIGHT;
double kPlimeLight = table->GetNumber("KPLIMELIGHT", KP_LIMELIGHT);
state.ySpeedMPS = units::velocity::meters_per_second_t(((std::fabs(normalizedTx) <= 1 ? normalizedTx : std::copysignf(1.0, normalizedTx) ) * kPlimeLight * -driveMaxSpeed));
}
}
Expand Down
25 changes: 16 additions & 9 deletions src/main/cpp/subsystems/Elevarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#define ROTATE_GEAR_RATIO 101.25f
#define WRIST_GEAR_RATIO 24.3f

#define ARM_CANCODER_OFFSET 279.2f
#define WRIST_CANCODER_OFFSET 70.72f
#define ARM_CANCODER_OFFSET 57.39f
#define WRIST_CANCODER_OFFSET 168.31f
#else
#define ROTATE_GEAR_RATIO 101.25f
#define WRIST_GEAR_RATIO 24.3f
Expand Down Expand Up @@ -79,7 +79,7 @@
#define WRIST_K_ACC_MUL 0.425f
#define WRIST_S_CURVE_STRENGTH 3

#define PREVIOUS_WRIST_DEADBAND 1.5f
#define PREVIOUS_WRIST_DEADBAND 2.5f
#define PREVIOUS_HEIGHT_DEADBAND 0.03f
#define PREVIOUS_ROTATION_DEADBAND 3.5f

Expand Down Expand Up @@ -137,6 +137,7 @@ void Elevarm::resetState()
futureState.highStow = true;

zeroArm = false;
zeroWrist = false;
coastMode = false;
previousState = futureState;
setPrevPiece(intake->getFuturePiece());
Expand Down Expand Up @@ -235,12 +236,11 @@ void Elevarm::init()
posMap[Piece::CUBE][Direction::FRONT][Position::SNAKE] =frc::Pose2d(-0.33_m, 1.2376_m, 0.0_deg);
posMap[Piece::CUBE][Direction::FRONT][Position::VERTICAL] =frc::Pose2d(-0.288_m, 1.25_m, 0.0_deg);


// BACK CONE
posMap[Piece::CONE][Direction::BACK][Position::GROUND] =frc::Pose2d(-1.027_m, 0.5931_m, -247.3_deg);
posMap[Piece::CONE][Direction::BACK][Position::GROUND_TOPPLE] =frc::Pose2d(-0.9229_m, 0.2195_m, -192.67_deg);
posMap[Piece::CONE][Direction::BACK][Position::GROUND_SCORE] =frc::Pose2d(-0.888_m, 0.541_m, -165.0_deg);
posMap[Piece::CONE][Direction::BACK][Position::PLAYER] =frc::Pose2d(-0.8605_m, 1.5825_m, 40.7_deg);
posMap[Piece::CONE][Direction::BACK][Position::PLAYER] =frc::Pose2d(-0.8605_m, 1.62_m, 40.7_deg);
posMap[Piece::CONE][Direction::BACK][Position::BIRD] =frc::Pose2d(-0.4899_m, 0.4529_m, -82.81_deg);
posMap[Piece::CONE][Direction::BACK][Position::MID] =frc::Pose2d(-0.904_m, 1.03_m, -180.0_deg);
posMap[Piece::CONE][Direction::BACK][Position::HIGH] =frc::Pose2d(-0.904_m, 1.03_m, -180.0_deg);
Expand All @@ -266,6 +266,7 @@ void Elevarm::init()
table->PutNumber("Carriage Offset", INITIAL_HEIGHT_OFFSET);
table->PutBoolean("Arm In Range", false);
table->PutBoolean("Zero Arm", zeroArm);
table->PutBoolean("Zero Wrist", zeroWrist);
table->PutBoolean("Coast Mode", coastMode);

resetState();
Expand Down Expand Up @@ -347,10 +348,15 @@ void Elevarm::analyzeDashboard()
futureState.pitModeEnabled = table->GetBoolean("Pit Mode", false);
carriageStallPower = table->GetNumber("Carriage Stall Power", P_MIN_CARRIAGE);
zeroArm = table->GetBoolean("Zero Arm", false);
zeroWrist = table->GetBoolean("Zero Wrist", false);
coastMode = table->GetBoolean("Coast Mode", false);

if (zeroArm) {
armRotateMotor.setEncoderPosition(180.0);
armRotateMotor.setEncoderPosition(-180.0);
}

if (zeroWrist) {
wristMotor.setEncoderPosition(0.0);
}

if(coastMode && armRotateMotor.getNeutralMode() == ValorNeutralMode::Brake){
Expand Down Expand Up @@ -383,11 +389,12 @@ void Elevarm::analyzeDashboard()
armCANcoder.GetAbsolutePosition() < (ARM_CANCODER_OFFSET + 8);
table->PutBoolean("Arm In Range", futureState.armInRange);

futureState.wristInRange = wristCANcoder.GetAbsolutePosition() > (WRIST_CANCODER_OFFSET - 50) &&
wristCANcoder.GetAbsolutePosition() < (WRIST_CANCODER_OFFSET + 50);
futureState.wristInRange = wristCANcoder.GetAbsolutePosition() > (WRIST_CANCODER_OFFSET - 42) &&
wristCANcoder.GetAbsolutePosition() < (WRIST_CANCODER_OFFSET + 14);
table->PutBoolean("Wrist In Range", futureState.wristInRange);

intake->state.elevarmGround = futureState.positionState == Position::GROUND_SCORE;
intake->state.elevarmPoopFull = futureState.positionState == Position::STOW;
}

void Elevarm::assignOutputs()
Expand Down Expand Up @@ -719,7 +726,7 @@ frc2::FunctionalCommand * Elevarm::getAutoCommand(std::string pieceState, std::s
},
//onExecute
[](){

},
[&](bool){
previousState = futureState;
Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/subsystems/Intake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define CUBE_SPIKED_CURRENT 60.0f
#define CONE_SPIKED_CURRENT 90.0f

#define CUBE_CACHE_SIZE 250.0f
#define CUBE_CACHE_SIZE 350.0f
#define CONE_CACHE_SIZE 650.0f

#define POOP_FULL_SPEED 1.0f
Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/subsystems/Leds.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "subsystems/Leds.h"
#include <iostream>

#define LED_COUNT 284
#define LED_COUNT 288

#define CARRIAGE_UPPER_LIMIT 0.89f
#define CARRIAGE_LOWER_LIMIT 0.0f
Expand Down
114 changes: 114 additions & 0 deletions src/main/deploy/pathplanner/RED_barrier_s1_p1.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"waypoints": [
{
"anchorPoint": {
"x": 1.78,
"y": 5.03
},
"prevControl": null,
"nextControl": {
"x": 2.7800000000000002,
"y": 5.03
},
"holonomicAngle": 180.0,
"isReversal": false,
"velOverride": null,
"isLocked": false,
"isStopPoint": false,
"stopEvent": {
"names": [
"score_mid_cone"
],
"executionBehavior": "sequential",
"waitBehavior": "none",
"waitTime": 0
}
},
{
"anchorPoint": {
"x": 3.93,
"y": 4.68
},
"prevControl": {
"x": 2.8348903176446116,
"y": 4.68
},
"nextControl": {
"x": 4.949232563893478,
"y": 4.68
},
"holonomicAngle": 180.0,
"isReversal": false,
"velOverride": null,
"isLocked": false,
"isStopPoint": false,
"stopEvent": {
"names": [],
"executionBehavior": "parallel",
"waitBehavior": "none",
"waitTime": 0
}
},
{
"anchorPoint": {
"x": 6.9,
"y": 4.44
},
"prevControl": {
"x": 6.399119386323282,
"y": 4.44
},
"nextControl": {
"x": 6.399119386323282,
"y": 4.44
},
"holonomicAngle": 180.0,
"isReversal": true,
"velOverride": null,
"isLocked": false,
"isStopPoint": false,
"stopEvent": {
"names": [],
"executionBehavior": "parallel",
"waitBehavior": "none",
"waitTime": 0
}
},
{
"anchorPoint": {
"x": 6.3,
"y": 2.77
},
"prevControl": {
"x": 6.3,
"y": 3.724674773741342
},
"nextControl": null,
"holonomicAngle": 180.0,
"isReversal": false,
"velOverride": null,
"isLocked": false,
"isStopPoint": false,
"stopEvent": {
"names": [],
"executionBehavior": "sequential",
"waitBehavior": "none",
"waitTime": 0
}
}
],
"markers": [
{
"position": 0.02,
"names": [
"pickup_back_cube"
]
},
{
"position": 2.4848484848484276,
"names": [
"stow_low"
]
}
]
}
Loading