-
Notifications
You must be signed in to change notification settings - Fork 3
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
Elevator sim #14
Elevator sim #14
Conversation
src/main/java/frc/robot/subsystems/elevator/ElevatorConstants.java
Outdated
Show resolved
Hide resolved
src/main/java/frc/robot/subsystems/elevator/ElevatorConstants.java
Outdated
Show resolved
Hide resolved
powerRequest.withOutput(power); | ||
motor.setControl(powerRequest); |
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.
All of the .with*
methods return the object so you can combine both lines (everywhere)
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.
motor.update(Timer.getFPGATimestamp()); | ||
inputs.currentHeight = | ||
Meters.of( | ||
lib.units.Units.rpsToMetersPerSecond( |
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 to configure the ratio instead of calculating it yourself
https://api.ctr-electronics.com/phoenix6/release/java/com/ctre/phoenix6/configs/FeedbackConfigs.html#withSensorToMechanismRatio(double)
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.
Agreed. Notice that the TalonFXSim
constructor has a parameter called conversionFactor
, which works exactly the same as the real motor conversion factor.
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.
I keep forgetting this is your class and not Phoenix's sim classes lol
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.
fixed it a long time ago
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.
Missing Command.withName()
decorators everywhere (should be written like normal text and not in camelCase
).
I am greatly confuzzled. Github shows a diff between this branch and the base in irrelevant files, and intellij sees it too. And yet, when I run |
Unfortunately, I'm also not sure what happened. There was a problem with the merge commit -- for example, if you look at this commit, GitHub recognizes it's a merge commit: If you click on "view the diff", you'll get to f261626, and there you can see it has two parents, as it should be: But, if you look at 24472e1, which looks like a merge commit, it has only one parent: Looks like the files were added to this branch separately and not merged from
Unfortunately, here too I'm not entirely sure what causes this inconsistency. It might be that GitHub compares commits, so it thinks some files are new, but Git compares the files themselves, so it knows there isn't really a diff. I believe a quick Google search will shed more light on this Git mechanism. As for merging these problematic PRs, I think you might have some merge conflicts, but not something worse. Just make sure you choose the right things. You may also be interested in using this GitHub feature which detects when the PR branch is out of sync with the base branch and can update the PR branch in one click. I recommend doing so with a rebase to reduce the amount of clutter commits. Note however that this should be done by the PR author to prevent conflicts. Feel free to ask any additional questions you have and I'll do my best to answer. BTW, your PR was approved wpilibsuite/allwpilib#6313 (review), but not yet merged. |
This is actually Gaia, I did the mistake of working from Emma's profile.
peace and love