-
Couldn't load subscription status.
- Fork 0
Yishay Amir #11
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
Open
yisha23
wants to merge
18
commits into
main
Choose a base branch
from
side-shooter-yishay
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Yishay Amir #11
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d46d959
added sideShooterConstantas
yisha23 930fe12
fix according to the rewiew
yisha23 32726f0
added optimizeBusUtilization()
yisha23 c8dc826
created getSetTargetAngleCommand
yisha23 04041e5
fixed according to code rewiew
yisha23 c702353
created SideShooterCommands
yisha23 50c5418
fixed according to code rewiew
yisha23 0b793c0
finished subsystem
yisha23 0e67372
created ArmConstants
yisha23 e937844
reformat class
yisha23 6ec507a
fixed according to code review
yisha23 ab18038
fixed according to code reviwe
yisha23 c67882f
added Arm and ArmCommands
yisha23 ca4f95e
added feedforward
yisha23 847e2bf
fixed according code review
yisha23 f5dfefe
fixed according code review
yisha23 6adcef7
fixed according code review
yisha23 55212d1
fixed according code review
yisha23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| package frc.trigon.robot.subsystems.sideshooter; | ||
|
|
||
| import com.ctre.phoenix6.configs.CANcoderConfiguration; | ||
| import com.ctre.phoenix6.configs.TalonFXConfiguration; | ||
| import com.ctre.phoenix6.hardware.CANcoder; | ||
| import com.ctre.phoenix6.hardware.TalonFX; | ||
| import com.ctre.phoenix6.signals.AbsoluteSensorRangeValue; | ||
| import com.ctre.phoenix6.signals.InvertedValue; | ||
| import com.ctre.phoenix6.signals.NeutralModeValue; | ||
| import com.revrobotics.CANSparkMax; | ||
| import com.revrobotics.CANSparkMaxLowLevel; | ||
|
|
||
| public class SideShooterConstants { | ||
| private static final int SHOOTING_MOTOR_ID = 0; | ||
| private static final int ANGEL_MOTOR_ID = 0; | ||
| private static final int ENCODER_ID = 0; | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| private static final NeutralModeValue SHOOTING_NEUTRAL_MODE_VALUE = NeutralModeValue.Coast; | ||
| private static final CANSparkMax.IdleMode ANGLE_NEUTRAL_MODE_VALUE = CANSparkMax.IdleMode.kBrake; | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| private static final InvertedValue SHOOTING_INVERTED_VALUE = InvertedValue.CounterClockwise_Positive; | ||
| private static final boolean ANGLE_INVERTED_VALUE = false; | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| private static final double ENCODER_OFFSET = 0; | ||
| private static final AbsoluteSensorRangeValue ENCODER_RANGE_VALUE = AbsoluteSensorRangeValue.Signed_PlusMinusHalf; | ||
| static final CANcoder ENCODER = new CANcoder(ENCODER_ID); | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| static final TalonFX SHOOTING_MOTOR = new TalonFX(SHOOTING_MOTOR_ID); | ||
| static final CANSparkMax ANGEL_MOTOR = new CANSparkMax(ANGEL_MOTOR_ID, CANSparkMaxLowLevel.MotorType.kBrushless); | ||
|
|
||
| static { | ||
| configureShootingMotor(); | ||
| configureAngleMotor(); | ||
| configureEncoder(); | ||
| } | ||
| private static void configureShootingMotor() { | ||
yisha23 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| TalonFXConfiguration ShootingMotorConfig = new TalonFXConfiguration(); | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ShootingMotorConfig.Audio.BeepOnBoot = false; | ||
| ShootingMotorConfig.Audio.BeepOnConfig = false; | ||
| ShootingMotorConfig.MotorOutput.NeutralMode = SHOOTING_NEUTRAL_MODE_VALUE; | ||
| ShootingMotorConfig.MotorOutput.Inverted = SHOOTING_INVERTED_VALUE; | ||
| SHOOTING_MOTOR.getConfigurator().apply(ShootingMotorConfig); | ||
| } | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| private static void configureAngleMotor(){ | ||
| ANGEL_MOTOR.restoreFactoryDefaults(); | ||
| ANGEL_MOTOR.setIdleMode(ANGLE_NEUTRAL_MODE_VALUE); | ||
| ANGEL_MOTOR.setInverted(ANGLE_INVERTED_VALUE); | ||
| } | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| private static void configureEncoder(){ | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| CANcoderConfiguration EncoderConfiguration = new CANcoderConfiguration(); | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| EncoderConfiguration.MagnetSensor.MagnetOffset = ENCODER_OFFSET; | ||
| EncoderConfiguration.MagnetSensor.AbsoluteSensorRange = ENCODER_RANGE_VALUE; | ||
| ENCODER.getConfigurator().apply(EncoderConfiguration); | ||
| } | ||
yisha23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.