Skip to content
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

New indexer #17

Open
wants to merge 124 commits into
base: master
Choose a base branch
from
Open

New indexer #17

wants to merge 124 commits into from

Conversation

NikhilSuresh24
Copy link
Member

Indexer and intake code. Added intake and outtake routines which use both indexer and intakerollers.

Krakavius and others added 30 commits January 7, 2018 13:40
… addressed all issues that I could fix myself.

@Override
protected void interrupted() {
RobotMap.Component.rollyBOI.setState(RollyBOI.GrabberState.CLASPED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't put anything here.


@Override
protected boolean isFinished() {
return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let it run indefinitely.

currentState = state;
}

public void safelySetState(GrabberState state) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about this.

Copy link
Member

@billwpierce billwpierce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code doesn't work


@Override
protected boolean isFinished() {
return false;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajnadel said false


public IndexerGrabberSet(boolean clasped) {
super(clasped ? "IndexerGrabberClasp" : "IndexerGrabberRelease");
requires(RobotMap.Component.rollyBOIGrabber);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be RobotMap.Component.rollyBOI.grabber

if (motor.getName() != null) {
name += motor.getName() + " ";
} else {
name += "unnamed motor ";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just make this Motor ?

} else {
name += "unnamed motor ";
}
name += "idling";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you want idling between each motor? this seems odd...

@Override
public void bindCommands() {
RobotMap.Component.joystick.button3.onlyWhileHeld(new IntakeSquared());
RobotMap.Component.joystick.button4.onlyWhileHeld(new OuttakeSquared());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need buttons 5 & 6 to be mapped to forcefully opening and closing the rollyBOI pistons, in that order.

public class CrateIO extends Subsystem {

public static final double INTAKE_SPEED = 1.0;
public static final double OUTTAKE_SPEED = -1.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be 0.5

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least for now, as that's what we were using today. they may change, but 100% is too much

setDefaultCommand(new MotorIdleGroup("CrateIO", this, rollerLeft, rollerRight));
}

public void set(double speed) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we never use this, delet?

setDefaultCommand(new MotorIdleGroup("RollyBOI", this, rollerLeft, rollerRight));
}

public void set(double speed) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again we never use this right?


public class RollyBOI extends Subsystem {
public static final double INTAKE_SPEED = -1.0;
public static final double OUTTAKE_SPEED = 1.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set to 0.5

}

public void set(boolean clasped) {
if (clasped) this.grabber.set(CLASPED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ternary is for returning a value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this makes you uncomfortable, we can add curly braces.

}

public void set(boolean clasped) {
if (clasped) this.grabber.set(CLASPED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ternary is for returning a value.


@Override
protected boolean isFinished() {
return false;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajnadel said false

Copy link
Member

@billwpierce billwpierce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, though one more test needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants