Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

set up subsystem interfaces #39

Merged
lhmcgann merged 3 commits intoDeepBlueRobotics:masterfrom
kaytay7430:master
Jan 29, 2018
Merged

set up subsystem interfaces #39
lhmcgann merged 3 commits intoDeepBlueRobotics:masterfrom
kaytay7430:master

Conversation

@kaytay7430
Copy link
Copy Markdown
Contributor

added some methods and motor controllers to Lift, Climber, and Intake

added some methods and motor controllers to Lift, Climber, and Intake
added some methods and motor controllers to Lift, Climber, and Intake
Copy link
Copy Markdown
Contributor

@lhmcgann lhmcgann left a comment

Choose a reason for hiding this comment

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

Great work on doing all of this! It's a great place to start and work from as we begin to develop our subsystems' functions. Go ahead and review the requested changes, and then let me know again once you have your next "draft" done and ready for me to look at. The next step(s) after that will be writing JUnit tests to make sure all of the methods do the correct things, then actually implementing the methods according to what the tests expect them to do. We'll also be creating Commands (like for the climber process) and tying them to buttons in OI, figuring out how the user/driver will interface with the functions. We'll also need to experiment w/ and research some sensors, as well as talk to Design, to determine which sensors are best for which functions and where they should be placed, etc.

* returns current motor value
*/
public double getIntake();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change name of this method to getIntakeSpeed() because getIntake() makes it seems like you are returning the whole intake object which isn't happening :)


/**
* Uses (insert sensor here) to detect the distance above the ground
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clarify comment a little bit: not exactly dist above ground, but rather how high up/at what position the carriage of the lift is (could be measuring from top or btm so don't need to specify reference frame yet)

public double getLift() {
return liftMotors.get();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same w/ getIntake: change this to getLiftSpeed() or getMotorValue() bc may not necessarily be spd (could be voltage --> something to check in documentation of WPI_TalonSRX)

public void goToBar() {

}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

instead of having these four methods, I would suggest having one general goToPosition(double height) method. Then this method can be used for all cases and a parameter can be which specific height. The parameter doesn't have to be a straight double, although it could be. I would suggest looking into enums, possibly (you can look at Kevin's code in Autonomous.java for some reference too). You can create a new enum class essentially, called LiftPositions maybe, and then values can be BAR, SCALE, SWITCH, GROUND, etc, each key w/ a specified number value associated with it. Could also just use SD keys too, but enums could be good to explore.

@@ -1,57 +0,0 @@
package org.usfirst.frc.team199.Robot2018.autonomous;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know why it shows these two classes being deleted, but they shouldn't be, so if you could check to make sure they're still there that would be good 👍

public static SpeedController intakeMotors;
public static SpeedController liftMotors;
public static SpeedController climberMotors;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you make these singular? i.e. intakeMotor instead of intakeMotors? Ik it's a detail but kind of confusing being plural. I also don't think they need to be speed controllers, you can just make them WPI_TalonSRX directly.

// here. Call these from Commands.
private final SpeedController climberMotors = RobotMap.climberMotors;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah all of these references can be WPI_TalonSRX's as well.

public void goUp() {

}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A better name might be climb() ?

goUp();

}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm a little confused what this method is meant to do. What I would have guessed a runClimber() method would do would just set the climberMotor to the speed parameter, so pretty basic. I see what you're trying to do: the whole climbing process right? Calling all of the individual steps together to make the full process is more of what happens in a Command (i.e. in the execute method), so I would wait for that and not put that here. Maybe just make it a simple runClimber(double speed) method as described above.

public boolean detectCube() {
return false;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I might change the method name detectCube() to something like seesCube() to make the difference between this method and the one below (hasCube) a little clearer. In the end this method is something that might become obsolete because the driver will just look through the camera and see it, but good to have here in case we are able to automate enough :)

added some methods and motor controllers to Lift, Intake, and Climber
@kaytay7430
Copy link
Copy Markdown
Contributor Author

Okay, I fixed everything you mentioned. For setting the lift position, I have an enum for the standard positions and then a double for the offset. It seems like the simplest option. I'm not sure what's going on with the Auto classes. They're still there in the autonomous package as far as I can tell

@lhmcgann lhmcgann merged commit 089009a into DeepBlueRobotics:master Jan 29, 2018
@lhmcgann
Copy link
Copy Markdown
Contributor

Looks good! Thanks for getting all of those changes done. Next up is implementing everything (and combining climber and lift bc that happened on Saturday at the end). 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants