- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Azoulay #9
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
base: main
Are you sure you want to change the base?
Azoulay #9
Conversation
        
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooterConstants.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/main/java/frc/trigon/robot/subsystems/sideshooter/SideShooter.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | double getAnglePosition() { | ||
| double positionRevolutions = SideShooterConstants.ANGLE_ENCODER_POSITION_SIGNAL.refresh().getValue(); | ||
| return positionRevolutions; | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return a rotation2d here.
| return positionRevolutions; | ||
| } | ||
| 
               | 
          ||
| Double getAngleVelocityDegreesPerSecond() { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the primative type double.
| ); | ||
| angleMotor.setVoltage(pidOutPut = feedforward); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this here?
| double getAnglePosition() { | ||
| double positionRevolutions = SideShooterConstants.ANGLE_ENCODER_POSITION_SIGNAL.refresh().getValue(); | ||
| return positionRevolutions; | ||
| } | ||
| 
               | 
          ||
| Double getAngleVelocityDegreesPerSecond() { | ||
| return Conversions.revolutionsToDegrees(SideShooterConstants.ANGLE_ENCODER_VELOCITY_SIGNAL.refresh().getValue()); | ||
| } | ||
| 
               | 
          ||
| double getAngleMotorProfileTime() { | ||
| return Timer.getFPGATimestamp() - lastAngleMotorProfileGenerationTime; | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move these to the bottom of the class and make them private.
| double calculateAngleOutput(TrapezoidProfile.State targetState) { | ||
| double pidOutPut = SideShooterConstants.ANGLE_PID_CONTROLLER.calculate( | ||
| getAnglePosition(), | ||
| targetState.position | ||
| ); | ||
| double feedforward = SideShooterConstants.SIDE_SHOOTER_FEEDFORWARD.calculate( | ||
| Units.degreesToRadians(targetState.position), | ||
| targetState.velocity | ||
| ); | ||
| angleMotor.setVoltage(pidOutPut = feedforward); | ||
| return feedforward + pidOutPut; | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this down and make it private.
| public static SideShooterCommands getInstance() { | ||
| return getInstance(); | ||
| } | ||
| 
               | 
          
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh?
| public Command getSetTargetShooterAngleCommand(Rotation2d targetAngle) { | ||
| return new FunctionalCommand( | ||
| () -> SideShooter.getInstance().generateAngleMotorProfile(targetAngle), | ||
| () -> getSetTargetShooterAngleCommand(targetAngle), | ||
| (interrupted) -> {}, | ||
| () -> false, | ||
| SideShooter.getInstance() | ||
| ); | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this static, and instead of typing SideShooter.getInstance() every time have a class variable for it.
Also, add the commands to set the target voltage and target state.
No description provided.