From 12ce69ae63c2ff19df7dce0048ab709a58531ae1 Mon Sep 17 00:00:00 2001 From: prak132 Date: Tue, 14 Oct 2025 13:00:38 -0700 Subject: [PATCH 1/4] Removed Bearing Lock for Net and Processor, algae operator eject, bearing requirement for net autoalign --- src/y2025/cpp/commands/teleop/algal_command.cc | 3 +++ src/y2025/cpp/commands/teleop/drive_command.cc | 12 ++---------- .../cpp/commands/teleop/drive_to_net_command.cc | 5 ++++- .../subsystems/hardware/algal/algal_end_effector.cc | 5 ++++- src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc | 2 +- src/y2025/cpp/subsystems/hardware/climber.cc | 7 ++++++- src/y2025/cpp/subsystems/hardware/leds.cc | 3 +++ src/y2025/cpp/subsystems/hardware/leds_logic.cc | 2 ++ .../subsystems/hardware/algal/algal_end_effector.h | 1 + .../include/subsystems/hardware/algal/algal_ss.h | 1 + src/y2025/include/subsystems/hardware/climber.h | 4 +++- src/y2025/include/subsystems/hardware/leds.h | 1 + 12 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/y2025/cpp/commands/teleop/algal_command.cc b/src/y2025/cpp/commands/teleop/algal_command.cc index 87bb2ee..0b2f28c 100644 --- a/src/y2025/cpp/commands/teleop/algal_command.cc +++ b/src/y2025/cpp/commands/teleop/algal_command.cc @@ -58,6 +58,9 @@ void AlgalCommand::Periodic() { else if (ci_readings.dec_a_wrist) container_.algal_ss_.adjustWrist(false); + algal_target.super_mode = + container_.control_input_.GetReadings().override_force; + algal_target.cm = container_.control_input_.GetReadings().level_one; container_.algal_ss_.SetTarget(algal_target); diff --git a/src/y2025/cpp/commands/teleop/drive_command.cc b/src/y2025/cpp/commands/teleop/drive_command.cc index df9c79e..2dcdf3f 100644 --- a/src/y2025/cpp/commands/teleop/drive_command.cc +++ b/src/y2025/cpp/commands/teleop/drive_command.cc @@ -106,16 +106,8 @@ void DriveCommand::Periodic() { if (ci_readings_.auto_align) { units::degree_t target_angle = 1000_deg; - if (ci_readings_.algal_state == kAlgae_Net && - container_.algal_ss_.algal_end_effector.GetReadings().has_piece_) { - target_angle = isBlue ? 180_deg : 0_deg; - } else if (ci_readings_.algal_state == kAlgae_Processor && - container_.algal_ss_.algal_end_effector.GetReadings() - .has_piece_) { - target_angle = isBlue ? -90_deg : 90_deg; - } else if (ci_readings_.coral_state == kCoral_StowNoPiece && - !container_.coral_ss_.coral_end_effector.GetReadings() - .has_piece_) { + if (ci_readings_.coral_state == kCoral_StowNoPiece && + !container_.coral_ss_.coral_end_effector.GetReadings().has_piece_) { if (container_.drivetrain_.GetReadings().estimated_pose.position[0] > (frc846::math::FieldPoint::field_size_x / 2)) target_angle = -54_deg; diff --git a/src/y2025/cpp/commands/teleop/drive_to_net_command.cc b/src/y2025/cpp/commands/teleop/drive_to_net_command.cc index 956f36c..3a4bb85 100644 --- a/src/y2025/cpp/commands/teleop/drive_to_net_command.cc +++ b/src/y2025/cpp/commands/teleop/drive_to_net_command.cc @@ -27,7 +27,10 @@ std::pair DriveToNetCommand::GetTargetPoint() { pos[0], frc846::math::FieldPoint::field_size_y / 2 - net_offest}; frc846::math::FieldPoint target_pos = frc846::math::FieldPoint{net_pos, 0_deg, 0_fps}; - if (pos[1] > frc846::math::FieldPoint::field_size_y / 2) { + if ((pos[1] > frc846::math::FieldPoint::field_size_y / 2) && + units::math::abs(frc846::math::CoterminalDifference( + drivetrain_->GetReadings().estimated_pose.bearing, 0_deg)) > + 150_deg) { target_pos = target_pos.mirrorOnlyY(true); } diff --git a/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc b/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc index 65ae451..b5872f3 100644 --- a/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc +++ b/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc @@ -159,7 +159,10 @@ void AlgalEESubsystem::WriteToHardware(AlgalEETarget target) { } if (piece_override_) { target.velocity_ = 0.0_fps; } - if (target.use_back_spin_) { + if (target.super_mode) { + esc_helper_1_.WriteVelocityOnController(-40_fps); + esc_helper_2_.WriteVelocityOnController(-40_fps); + } else if (target.use_back_spin_) { esc_helper_1_.WriteVelocityOnController( target.velocity_ + GetPreferenceValue_unit_type( diff --git a/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc b/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc index c018c51..76c6de5 100644 --- a/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc +++ b/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc @@ -141,7 +141,7 @@ void AlgalSuperstructure::WriteToHardware(AlgalSSTarget target) { : algal_end_effector.SetTarget( {GetPreferenceValue_unit_type( "score_dc"), - true}); + true, false, false, target.super_mode}); } else if (coral_mode) algal_end_effector.SetTarget( {setpoint.ee_vel, false, target.cm, target.state != kAlgae_CoralPick}); diff --git a/src/y2025/cpp/subsystems/hardware/climber.cc b/src/y2025/cpp/subsystems/hardware/climber.cc index 6c3909f..1060930 100644 --- a/src/y2025/cpp/subsystems/hardware/climber.cc +++ b/src/y2025/cpp/subsystems/hardware/climber.cc @@ -48,7 +48,12 @@ bool ClimberSubsystem::VerifyHardware() { ClimberReadings ClimberSubsystem::ReadFromHardware() { Graph("readings/position", esc_helper_.GetPosition()); - return {}; + return {units::math::abs(esc_helper_.GetPosition() - + GetPreferenceValue_unit_type( + "limits/upper_limit")) < 2_deg || + units::math::abs(esc_helper_.GetPosition() - + GetPreferenceValue_unit_type( + "limits/lower_limit")) < 2_deg}; } void ClimberSubsystem::WriteToHardware(ClimberTarget target) { diff --git a/src/y2025/cpp/subsystems/hardware/leds.cc b/src/y2025/cpp/subsystems/hardware/leds.cc index f5302e4..fd43627 100644 --- a/src/y2025/cpp/subsystems/hardware/leds.cc +++ b/src/y2025/cpp/subsystems/hardware/leds.cc @@ -70,6 +70,9 @@ void LEDsSubsystem::WriteToHardware(TLTGT target) { } else if (tgt->state == kLEDsTeleop) { SetStrip(ORANGE); Flash(SLOW_FLASH); + } else if (tgt->state == kLEDsClimbed) { + SetStrip(GREEN); + Flash(RAPID_FLASH); } else if (tgt->state == kLEDsClimbing) { SetStrip(LIGHT_BLUE); Flash(SLOW_FLASH); diff --git a/src/y2025/cpp/subsystems/hardware/leds_logic.cc b/src/y2025/cpp/subsystems/hardware/leds_logic.cc index 29bad2b..ccb2519 100644 --- a/src/y2025/cpp/subsystems/hardware/leds_logic.cc +++ b/src/y2025/cpp/subsystems/hardware/leds_logic.cc @@ -68,6 +68,8 @@ void LEDsLogic::UpdateLEDs(RobotContainer* container) { target.state = kisLinedUp; else target.state = kLEDsSequencing; + } else if (container->climber_.GetReadings().reached_limit_) { + target.state = kLEDsClimbed; } else if (container->control_input_.GetReadings().extend_climb || container->control_input_.GetReadings().retract_climb) { target.state = kLEDsClimbing; diff --git a/src/y2025/include/subsystems/hardware/algal/algal_end_effector.h b/src/y2025/include/subsystems/hardware/algal/algal_end_effector.h index 7b22a05..a3b90f2 100644 --- a/src/y2025/include/subsystems/hardware/algal/algal_end_effector.h +++ b/src/y2025/include/subsystems/hardware/algal/algal_end_effector.h @@ -22,6 +22,7 @@ struct AlgalEETarget { bool use_back_spin_ = false; bool cmode = false; bool coral_keep = false; + bool super_mode = false; }; using roller_pos_conv_t = units::unit_t< diff --git a/src/y2025/include/subsystems/hardware/algal/algal_ss.h b/src/y2025/include/subsystems/hardware/algal/algal_ss.h index 2a234b5..7aab536 100644 --- a/src/y2025/include/subsystems/hardware/algal/algal_ss.h +++ b/src/y2025/include/subsystems/hardware/algal/algal_ss.h @@ -33,6 +33,7 @@ struct AlgalSSTarget { AlgalStates state; bool score; bool cm = false; + bool super_mode = false; }; class AlgalSuperstructure diff --git a/src/y2025/include/subsystems/hardware/climber.h b/src/y2025/include/subsystems/hardware/climber.h index 9779510..913d9a1 100644 --- a/src/y2025/include/subsystems/hardware/climber.h +++ b/src/y2025/include/subsystems/hardware/climber.h @@ -13,7 +13,9 @@ #include "frc846/control/HigherMotorController.h" #include "frc846/robot/GenericSubsystem.h" -struct ClimberReadings {}; +struct ClimberReadings { + bool reached_limit_; +}; struct ClimberTarget { double duty_cycle_; diff --git a/src/y2025/include/subsystems/hardware/leds.h b/src/y2025/include/subsystems/hardware/leds.h index af777d2..a81e44d 100644 --- a/src/y2025/include/subsystems/hardware/leds.h +++ b/src/y2025/include/subsystems/hardware/leds.h @@ -14,6 +14,7 @@ enum LEDsState { kLEDsSequencing, kLEDsTeleop, kLEDsClimbing, + kLEDsClimbed, kLEDsHavePiece, kisLinedUp, kisCompletelyLinedUp, From 985893150d0698513f06912f8b646aac682171d6 Mon Sep 17 00:00:00 2001 From: prak132 Date: Thu, 23 Oct 2025 18:46:09 -0700 Subject: [PATCH 2/4] Fixed backspin at processor, climber reaches thresh, telescope net stow, nt backups --- .gitignore | 3 +++ build.gradle | 15 ++++++------ networktables.json | 14 +++++------ networktables_.json.bck | 4 ++-- .../cpp/commands/teleop/coral_command.cc | 2 +- .../cpp/subsystems/hardware/algal/algal_ss.cc | 23 +++++++++++-------- src/y2025/cpp/subsystems/hardware/climber.cc | 4 ++-- 7 files changed, 37 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index b1d155b..3b502a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # This gitignore has been specially created by the WPILib team. # If you remove items from this file, intellisense might break. +# NetworkTables backups +/nt_backups + #Developer Id *.id diff --git a/build.gradle b/build.gradle index 4c68806..dfbf599 100644 --- a/build.gradle +++ b/build.gradle @@ -112,16 +112,17 @@ model { task backupNetworkTables(type: Exec) { println "Backing up Networktables..." - def timestamp = new Date().format('yyyyMMdd_HHmm') - def nt_backup_file = "nt_backups/networktables_${timestamp}.json.bck" - def backupFile = "networktables_.json.bck" + def timestamp = new Date().format('MM_dd_HH_mm') + def nt_backup_file = "nt_backups/networktables_${timestamp}.json" + def backupFile = "networktables_.json.bck" + doFirst { + new File("nt_backups").mkdirs() + } if (System.getProperty('os.name').toLowerCase().contains('windows')) { - commandLine 'cmd', '/c', 'scp', "lvuser@10.8.46.2:/home/lvuser/networktables.json", "./${nt_backup_file}" - commandLine 'cmd', '/c', 'scp', "lvuser@10.8.46.2:/home/lvuser/networktables.json", "./${backupFile}" + commandLine 'cmd', '/c', "scp lvuser@10.8.46.2:/home/lvuser/networktables.json ./${nt_backup_file} && scp lvuser@10.8.46.2:/home/lvuser/networktables.json ./${backupFile}" } else { - commandLine 'sh', '-c', "scp lvuser@10.8.46.2:/home/lvuser/networktables.json ./${nt_backup_file}" - commandLine 'sh', '-c', "scp lvuser@10.8.46.2:/home/lvuser/networktables.json ./${backupFile}" + commandLine 'sh', '-c', "scp lvuser@10.8.46.2:/home/lvuser/networktables.json ./${nt_backup_file} && scp lvuser@10.8.46.2:/home/lvuser/networktables.json ./${backupFile}" } ignoreExitValue = true } diff --git a/networktables.json b/networktables.json index e92b441..35dbf7f 100644 --- a/networktables.json +++ b/networktables.json @@ -74,7 +74,7 @@ { "name": "/Preferences/SwerveDrivetrain/FR/cancoder_offset_ (deg)", "type": "double", - "value": -73.740234375, + "value": -73.037109375, "properties": { "persistent": true } @@ -82,7 +82,7 @@ { "name": "/Preferences/SwerveDrivetrain/FL/cancoder_offset_ (deg)", "type": "double", - "value": -128.3203125, + "value": -128.408203125, "properties": { "persistent": true } @@ -90,7 +90,7 @@ { "name": "/Preferences/SwerveDrivetrain/BL/cancoder_offset_ (deg)", "type": "double", - "value": -78.92578125, + "value": -80.068359375, "properties": { "persistent": true } @@ -98,7 +98,7 @@ { "name": "/Preferences/SwerveDrivetrain/BR/cancoder_offset_ (deg)", "type": "double", - "value": -78.310546875, + "value": -78.75, "properties": { "persistent": true } @@ -275,7 +275,7 @@ { "name": "/Preferences/SwerveDrivetrain/odom_fudge_factor", "type": "double", - "value": 0.98, + "value": 0.95, "properties": { "persistent": true } @@ -2547,7 +2547,7 @@ { "name": "/Preferences/algal_end_effector/backspin_constant (fps)", "type": "double", - "value": -55.0, + "value": -30.0, "properties": { "persistent": true } @@ -2667,7 +2667,7 @@ { "name": "/Preferences/algal_ss/score_dc (fps)", "type": "double", - "value": -10.0, + "value": -50.0, "properties": { "persistent": true } diff --git a/networktables_.json.bck b/networktables_.json.bck index 2900606..35dbf7f 100644 --- a/networktables_.json.bck +++ b/networktables_.json.bck @@ -2547,7 +2547,7 @@ { "name": "/Preferences/algal_end_effector/backspin_constant (fps)", "type": "double", - "value": -55.0, + "value": -30.0, "properties": { "persistent": true } @@ -2667,7 +2667,7 @@ { "name": "/Preferences/algal_ss/score_dc (fps)", "type": "double", - "value": -10.0, + "value": -50.0, "properties": { "persistent": true } diff --git a/src/y2025/cpp/commands/teleop/coral_command.cc b/src/y2025/cpp/commands/teleop/coral_command.cc index 95f072b..90f65d3 100644 --- a/src/y2025/cpp/commands/teleop/coral_command.cc +++ b/src/y2025/cpp/commands/teleop/coral_command.cc @@ -15,7 +15,7 @@ void CoralCommand::Periodic() { if (container_.algal_ss_.algal_end_effector.GetReadings().has_piece_ && container_.control_input_.GetReadings().coral_state == kCoral_StowNoPiece) { - if (container_.coral_ss_.coral_end_effector.GetReadings().has_piece_ || + if (container_.coral_ss_.coral_end_effector.GetReadings().has_piece_ && (container_.control_input_.GetReadings().algal_state == kAlgae_Net && container_.control_input_.GetReadings().position_algal)) coral_target.state = kCoral_StowNet; diff --git a/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc b/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc index 76c6de5..4c83bda 100644 --- a/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc +++ b/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc @@ -133,15 +133,20 @@ void AlgalSuperstructure::WriteToHardware(AlgalSSTarget target) { Graph("is_coral_mode", coral_mode); if (target.score) { - if (coral_mode) algal_end_effector.ClearHasPiece(); - (coral_mode) ? algal_end_effector.SetTarget( - {GetPreferenceValue_unit_type( - "score_coral_vel"), - false}) - : algal_end_effector.SetTarget( - {GetPreferenceValue_unit_type( - "score_dc"), - true, false, false, target.super_mode}); + if (coral_mode) { + algal_end_effector.ClearHasPiece(); + algal_end_effector.SetTarget( + {GetPreferenceValue_unit_type( + "score_coral_vel"), + false}); + } else if (target.state == kAlgae_Processor) { + algal_end_effector.SetTarget( + {GetPreferenceValue_unit_type("score_dc")}); + } else { + algal_end_effector.SetTarget( + {GetPreferenceValue_unit_type("score_dc"), + true, false, false, target.super_mode}); + } } else if (coral_mode) algal_end_effector.SetTarget( {setpoint.ee_vel, false, target.cm, target.state != kAlgae_CoralPick}); diff --git a/src/y2025/cpp/subsystems/hardware/climber.cc b/src/y2025/cpp/subsystems/hardware/climber.cc index 1060930..494c952 100644 --- a/src/y2025/cpp/subsystems/hardware/climber.cc +++ b/src/y2025/cpp/subsystems/hardware/climber.cc @@ -50,10 +50,10 @@ ClimberReadings ClimberSubsystem::ReadFromHardware() { return {units::math::abs(esc_helper_.GetPosition() - GetPreferenceValue_unit_type( - "limits/upper_limit")) < 2_deg || + "limits/upper_limit")) < 6_deg || units::math::abs(esc_helper_.GetPosition() - GetPreferenceValue_unit_type( - "limits/lower_limit")) < 2_deg}; + "limits/lower_limit")) < 6_deg}; } void ClimberSubsystem::WriteToHardware(ClimberTarget target) { From ea7f6878f5a191ff5f8f2d3198cc6f98812757db Mon Sep 17 00:00:00 2001 From: prak132 Date: Sun, 26 Oct 2025 22:02:55 -0700 Subject: [PATCH 3/4] Adjust gains * even after the esc loses power, the gains are saved --- .../hardware/algal/algal_end_effector.cc | 39 +++++++++++++------ .../cpp/subsystems/hardware/algal/algal_ss.cc | 6 +++ .../hardware/algal/algal_end_effector.h | 2 + 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc b/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc index b5872f3..5d37625 100644 --- a/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc +++ b/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc @@ -34,6 +34,9 @@ AlgalEESubsystem::AlgalEESubsystem() RegisterPreference("idle_speed_coral", -5.0_fps); RegisterPreference("coral_vel_thresh", 5_fps); RegisterPreference("test1", false); + + RegisterPreference("max_eject", -40_fps); + REGISTER_PIDF_CONFIG(0.0001, 0.0, 0.0, 0.0); RegisterPreference("testthing", 0.4); @@ -107,8 +110,22 @@ void AlgalEESubsystem::WriteToHardware(AlgalEETarget target) { Graph("readings/vel1", esc_helper_1_.GetVelocity()); Graph("readings/vel2", esc_helper_2_.GetVelocity()); - esc_1_.SetGains(GET_PIDF_GAINS()); - esc_2_.SetGains(GET_PIDF_GAINS()); + frc846::control::base::MotorGains gains; + gains.kP = GetPreferenceValue_double("gains/_kP"); + gains.kFF = GetPreferenceValue_double("gains/_kF"); + gains.kD = 0.0; + gains.kI = 0.0; + + pleasefixthis += 1; + if (pleasefixthis > 50) { + gains.kFF += 0.000003; + } + if (pleasefixthis == 100) { + pleasefixthis = 0; + } + + esc_1_.SetGains(gains); + esc_2_.SetGains(gains); target.coral_keep &= target.cmode; @@ -150,18 +167,18 @@ void AlgalEESubsystem::WriteToHardware(AlgalEETarget target) { if (target.cmode && has_coral_piece_) { target.velocity_ = 0_fps; } - if (units::math::abs(esc_helper_2_.GetVelocity()) <= - GetPreferenceValue_unit_type( - "piece_thresh") && - target.velocity_ < 0.0_fps) { - target.velocity_ = - GetPreferenceValue_unit_type("kick_dc"); - } + // if (units::math::abs(esc_helper_2_.GetVelocity()) <= + // GetPreferenceValue_unit_type( + // "piece_thresh") && + // target.velocity_ < 0.0_fps) { + // target.velocity_ = + // GetPreferenceValue_unit_type("kick_dc"); + // } if (piece_override_) { target.velocity_ = 0.0_fps; } if (target.super_mode) { - esc_helper_1_.WriteVelocityOnController(-40_fps); - esc_helper_2_.WriteVelocityOnController(-40_fps); + esc_helper_1_.WriteVelocityOnController(GetPreferenceValue_unit_type("max_eject")); + esc_helper_2_.WriteVelocityOnController(GetPreferenceValue_unit_type("max_eject")); } else if (target.use_back_spin_) { esc_helper_1_.WriteVelocityOnController( target.velocity_ + diff --git a/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc b/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc index 4c83bda..6dbf17b 100644 --- a/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc +++ b/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc @@ -132,6 +132,12 @@ void AlgalSuperstructure::WriteToHardware(AlgalSSTarget target) { Graph("is_coral_mode", coral_mode); + if (target.super_mode) { + algal_end_effector.SetTarget( + {GetPreferenceValue_unit_type("score_dc"), + true, false, false, true}); + } + if (target.score) { if (coral_mode) { algal_end_effector.ClearHasPiece(); diff --git a/src/y2025/include/subsystems/hardware/algal/algal_end_effector.h b/src/y2025/include/subsystems/hardware/algal/algal_end_effector.h index a3b90f2..63ef63e 100644 --- a/src/y2025/include/subsystems/hardware/algal/algal_end_effector.h +++ b/src/y2025/include/subsystems/hardware/algal/algal_end_effector.h @@ -69,6 +69,8 @@ class AlgalEESubsystem double counter_ = 0; + int pleasefixthis = 0; + AlgalEEReadings ReadFromHardware() override; void WriteToHardware(AlgalEETarget target) override; From 2b3ed3ce748fb4a48fbd7675cd4a6289a24407c6 Mon Sep 17 00:00:00 2001 From: prak132 Date: Mon, 27 Oct 2025 17:26:04 -0700 Subject: [PATCH 4/4] Post CCC --- build.gradle | 2 +- networktables.json | 22 +++++++++++++------ .../hardware/algal/algal_end_effector.cc | 14 +++++------- .../cpp/subsystems/hardware/algal/algal_ss.cc | 4 ++-- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/build.gradle b/build.gradle index dfbf599..d138f2d 100644 --- a/build.gradle +++ b/build.gradle @@ -114,7 +114,7 @@ task backupNetworkTables(type: Exec) { println "Backing up Networktables..." def timestamp = new Date().format('MM_dd_HH_mm') def nt_backup_file = "nt_backups/networktables_${timestamp}.json" - def backupFile = "networktables_.json.bck" + def backupFile = "networktables.json.bck" doFirst { new File("nt_backups").mkdirs() } diff --git a/networktables.json b/networktables.json index 35dbf7f..105baf3 100644 --- a/networktables.json +++ b/networktables.json @@ -74,7 +74,7 @@ { "name": "/Preferences/SwerveDrivetrain/FR/cancoder_offset_ (deg)", "type": "double", - "value": -73.037109375, + "value": -72.158203125, "properties": { "persistent": true } @@ -82,7 +82,7 @@ { "name": "/Preferences/SwerveDrivetrain/FL/cancoder_offset_ (deg)", "type": "double", - "value": -128.408203125, + "value": -129.462890625, "properties": { "persistent": true } @@ -90,7 +90,7 @@ { "name": "/Preferences/SwerveDrivetrain/BL/cancoder_offset_ (deg)", "type": "double", - "value": -80.068359375, + "value": -80.595703125, "properties": { "persistent": true } @@ -98,7 +98,7 @@ { "name": "/Preferences/SwerveDrivetrain/BR/cancoder_offset_ (deg)", "type": "double", - "value": -78.75, + "value": -79.27734375, "properties": { "persistent": true } @@ -1843,7 +1843,7 @@ { "name": "/Preferences/coral_ss/setpoints/stow_net/height (in)", "type": "double", - "value": 40.0, + "value": 72.0, "properties": { "persistent": true } @@ -2547,7 +2547,7 @@ { "name": "/Preferences/algal_end_effector/backspin_constant (fps)", "type": "double", - "value": -30.0, + "value": -50.0, "properties": { "persistent": true } @@ -2667,7 +2667,7 @@ { "name": "/Preferences/algal_ss/score_dc (fps)", "type": "double", - "value": -50.0, + "value": -60.0, "properties": { "persistent": true } @@ -2791,5 +2791,13 @@ "properties": { "persistent": true } + }, + { + "name": "/Preferences/algal_end_effector/max_eject (fps)", + "type": "double", + "value": -40.0, + "properties": { + "persistent": true + } } ] diff --git a/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc b/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc index 5d37625..a9a0600 100644 --- a/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc +++ b/src/y2025/cpp/subsystems/hardware/algal/algal_end_effector.cc @@ -117,12 +117,8 @@ void AlgalEESubsystem::WriteToHardware(AlgalEETarget target) { gains.kI = 0.0; pleasefixthis += 1; - if (pleasefixthis > 50) { - gains.kFF += 0.000003; - } - if (pleasefixthis == 100) { - pleasefixthis = 0; - } + if (pleasefixthis > 50) { gains.kFF += 0.000003; } + if (pleasefixthis == 100) { pleasefixthis = 0; } esc_1_.SetGains(gains); esc_2_.SetGains(gains); @@ -177,8 +173,10 @@ void AlgalEESubsystem::WriteToHardware(AlgalEETarget target) { if (piece_override_) { target.velocity_ = 0.0_fps; } if (target.super_mode) { - esc_helper_1_.WriteVelocityOnController(GetPreferenceValue_unit_type("max_eject")); - esc_helper_2_.WriteVelocityOnController(GetPreferenceValue_unit_type("max_eject")); + esc_helper_1_.WriteVelocityOnController( + GetPreferenceValue_unit_type("max_eject")); + esc_helper_2_.WriteVelocityOnController( + GetPreferenceValue_unit_type("max_eject")); } else if (target.use_back_spin_) { esc_helper_1_.WriteVelocityOnController( target.velocity_ + diff --git a/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc b/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc index 6dbf17b..b4c93c8 100644 --- a/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc +++ b/src/y2025/cpp/subsystems/hardware/algal/algal_ss.cc @@ -134,8 +134,8 @@ void AlgalSuperstructure::WriteToHardware(AlgalSSTarget target) { if (target.super_mode) { algal_end_effector.SetTarget( - {GetPreferenceValue_unit_type("score_dc"), - true, false, false, true}); + {GetPreferenceValue_unit_type("score_dc"), + true, false, false, true}); } if (target.score) {