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

Robot 1 - For review only #3

Closed
wants to merge 49 commits into from
Closed

Robot 1 - For review only #3

wants to merge 49 commits into from

Conversation

agasser
Copy link
Collaborator

@agasser agasser commented Feb 8, 2024

This is a PR for reviewing Robot 1. It won't be merged to main.

Copy link
Collaborator Author

@agasser agasser left a comment

Choose a reason for hiding this comment

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

One comment overall, let's consider taking advantage of the new Java Units Library as much as we can, to avoid unit errors.

public static final int DEVICE_ID_SHOOTER_RIGHT = 51;
public static final int DEVICE_ID_SHOOTER_LEFT = 50;
public static final int DEVICE_ID_ACTUATOR_MOTOR = 52;
public static final int SHOOTER_VELOCITY_OFFSET = 0;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The naming doesn't seem right on this. I think it's a tolerance, not an offset.

public static final int DEVICE_ID_SHOOTER_LEFT = 50;
public static final int DEVICE_ID_ACTUATOR_MOTOR = 52;
public static final int SHOOTER_VELOCITY_OFFSET = 0;
public static final int WRIST_POSITION_OFFSET = 0;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Two problems here:

  1. This constant is used as a tolerance in the subsystem, not an offset.
  2. There needs to be an offset configured in the subsystem, but it is not.

public static final int DEVICE_ID_ACTUATOR_MOTOR = 52;
public static final int SHOOTER_VELOCITY_OFFSET = 0;
public static final int WRIST_POSITION_OFFSET = 0;
public static final int SHOOTER_MOTOR_RATIO = 1;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is unused

}

public static class ClimbConstants {
public static DeadbandFilter CLIMB_DEADBAND_FILTER = new DeadbandFilter(-.25, .5);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is unused

public static class ClimbConstants {
public static DeadbandFilter CLIMB_DEADBAND_FILTER = new DeadbandFilter(-.25, .5);

public static final int DEVICE_ID_FIRST_STAGE_CLIMB = 12;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is unused

*
* @return wrist velocity in radians per second
*/
public double getWristVelocity() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess this is fine, but why would we use it?

}

public boolean checkShooterSpeed(double shooterSpeedGoal) {
return (Math.abs(getWristVelocity() - shooterSpeedGoal) <= SHOOTER_VELOCITY_OFFSET);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This logic is not correct. It's checking the velocity of the wrist, not the velocity of the shooter.

return Units.rotationsToDegrees(actuatorEncoder.getVelocity());
}

public boolean checkWristPosition(double radiansToRotate) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it would be more useful to have a method that returns true if the wrist is at the previously requested velocity. Having it this way will be hard to deal with in a command. The same applies to the checkShooterSpeed method.


public void actuatorRotate(double radians) {
var target = MathUtil.clamp(radians, LIMIT_BOTTOM_RADIANS, LIMIT_TOP_RADIANS);
new TrapezoidProfile.State(target, 0.0);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This method doesn't actually do anything

* them for every robot loop. Combining them into a single method allows us to minimize
* the writes to switch ports on the multiplexer.
*/
public class MultiplexedColorSensor {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We're not going to have color sensors on a multiplexer

@agasser agasser closed this Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants