-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sensors test #38
base: master
Are you sure you want to change the base?
Sensors test #38
Conversation
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.
Code is kind of a mess guys, Please organize it so we won't have problems
@@ -79,37 +80,60 @@ public void robotInit() { | |||
}, Set.of(algaeArm)); | |||
algaeArm.setDefaultCommand(checkIfAlgaeRetract); | |||
|
|||
Command checkIfLow = Commands.defer(()-> { | |||
/* Command checkIfLow = Commands.defer(()-> { |
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.
Delete all the commented-out code that is no longer necessary
@@ -141,6 +165,7 @@ public void disabledExit() { | |||
|
|||
@Override | |||
public void teleopInit() { | |||
compressor.enableAnalog(RobotMap.MIN_PRESSURE,RobotMap.MAX_PRESSURE); |
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.
this is already done in robotInit
. Why again here?
|
||
public class CollectCoral extends Command { | ||
public CoralGripper coralGripper; | ||
Instant previousTime = null; |
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.
don't use Instant
as it uses the less trusty system clock. Use Timer.getFPGATimestamp()
instead.
public class ReleaseAlgae extends Command { | ||
private final AlgaeGripper algaeGripper; | ||
Instant previousTime = null; |
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.
don't use Instant
as it uses the less trusty system clock. Use Timer.getFPGATimestamp()
instead.
public class ReleaseCoral extends Command { | ||
public CoralGripper coralGripper; | ||
Instant previousTime = null; |
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.
don't use Instant
as it uses the less trusty system clock. Use Timer.getFPGATimestamp()
instead.
} | ||
|
||
public void raise() { | ||
piston1.set(DoubleSolenoid.Value.kForward); | ||
piston2.set(DoubleSolenoid.Value.kForward); | ||
//piston2.set(DoubleSolenoid.Value.kForward); |
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.
delete
@@ -30,6 +31,7 @@ public class CoralGripper extends SubsystemBase { | |||
public CoralGripper() { | |||
motor = new TalonFX(RobotMap.CORAL_GRIPPER_MOTOR); | |||
motor.getConfigurator().apply(new TalonFXConfiguration()); | |||
motor.setNeutralMode(NeutralModeValue.Brake); |
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.
don't set it like that, use the configuration
TalonFXConfiguration config = new TalonFXConfiguration();
config.MotorOutput.NeutralMode = NeutralModeValue.Brake;
motor.getConfigurator().apply(config);
} | ||
return Optional.empty(); | ||
} | ||
|
||
public Optional<Double> frontTargetAngle(){ |
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.
what is this for?
LimelightHelpers.RawFiducial[] fiducials = LimelightHelpers.getRawFiducials(name); | ||
if(fiducials.length >0) | ||
return fiducials[0].distToRobot; | ||
return 3; |
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 3? that is a lie, but it may fool someone into thinking the real distance is 3, return a number indicating an invalid value.
Either a negative value, optional, or if you want your trick to still work, return Double.MAX_VALUE
algaeGripper.setDefaultCommand(checkAlgae); | ||
algaeGripper.setDefaultCommand(checkAlgae);*/ | ||
|
||
new JoystickButton(xbox, XboxController.Button.kY.value) |
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.
not all the command groups are attached to buttons.
# Conflicts: # src/main/java/frc/robot/Limelight.java # src/main/java/frc/robot/Robot.java # src/main/java/frc/robot/subsystems/VisionSystem.java
# Conflicts: # src/main/java/frc/robot/Robot.java
…value seems good.
No description provided.