-
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
Conveyor #6
base: master
Are you sure you want to change the base?
Conveyor #6
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.
This code looks great, well done
* | ||
* @param power % | ||
*/ | ||
public void setMotor(double power) { |
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.
Rename to setPower
* @return boolean sensed. | ||
*/ | ||
public boolean senseShooterBall() { | ||
return shooterProximity.getValue() > Constants.Conveyor.MIN_PROXIMITY_DISTANCE; |
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.
Check if the value is between, min and max, in case the sensor has an error
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { |
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.
Stop the motor in the end method
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.
In general great job, there are some small things but great job.
public static final int SENSE_DISTANCE = 0; | ||
public static final int MIN_PROXIMITY_DISTANCE = 0; | ||
public static final int MAX_PROXIMITY_DISTANCE = 0; |
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.
Please add units for each constant
} | ||
|
||
/** | ||
* Add boolean stopper open/ close. |
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 method doesn't add a boolean, it checks whether the stopper is open or not.
public static final boolean NEW_SHOOTER_BALL = false; | ||
public static final boolean NEW_FUNNEL_BALL = false; |
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 are those neccessary?
newFunnelBall = false; | ||
} else { | ||
newFunnelBall = true; | ||
} |
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.
You should tell if this is a new ball by checking if the sensor stopped sensing one.
this.conveyor = conveyor; | ||
this.power = power; | ||
addRequirements(conveyor); | ||
|
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.conveyor = conveyor; | ||
this.power = power; | ||
addRequirements(conveyor); | ||
|
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.
public void execute() { | ||
if (conveyor.senseFunnelBall() && conveyor.getBallNum() <= Constants.Conveyor.MAX_BALLS) { | ||
conveyor.setMotor(power); | ||
|
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.
public SetStopperMode(Conveyor conveyor, boolean open) { | ||
this.conveyor = conveyor; | ||
this.open = open; | ||
|
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.
Motors: TalonSRX- motor, Solenoid- stopper.
Sensors: AnalogInput- funnelProximity, AnalogInput- shooterProximity.
The code is responsible for the movment of the conveyor.