-
Notifications
You must be signed in to change notification settings - Fork 0
First pass at climber subsystem #32
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?
Conversation
spellingcat
left a comment
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 sure about these implementations, some issues with "static reference to non-static method" | ||
| public Command climbUp() { | ||
| return this.run( | ||
| () -> { | ||
| ClimberIO.setClimberPosition(MAX_ANGLE); | ||
| }); | ||
|
|
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.
so a static method/variable is a method/variable that is shared across all instances of an object. so for example if we have multiple rollerio objects but store a static variable in the rollerio class, all of those rollers would be able to access it. we denote a call to something static by using the class name instead of a local variable name, which is what you've done here by capitalizing Climber
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.
however, setClimberPosition isn't actually marked as a static method so it gets mad when it thinks you're trying to call something statically (by using the class name) when it isn't static
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.
better explanation here: https://www.baeldung.com/java-static (sections 1-3 and 6)
| ClimberIO climberIO; | ||
| ClimberIOInputsAutoLogged climberInputs = new ClimberIOInputsAutoLogged(); | ||
|
|
||
| public ClimberSubsystem() {} |
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 have 2 constructors
|
|
||
| //member variables here? | ||
|
|
||
| public ClimberSubsystem(ClimberIO climberIO) { |
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.
remember to create the climbersubsystem in Robot.java (L263)
No description provided.