-
Notifications
You must be signed in to change notification settings - Fork 0
Path Planner #30
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?
Path Planner #30
Conversation
src/main/java/frc/robot/Robot.java
Outdated
| Optional<Elevator> elevator = Optional.of(new Elevator()); | ||
| Optional<Collector> collector = Optional.of(new Collector()); | ||
| Optional<Climber> climber = Optional.of(new Climber()); | ||
| Optional<Elevator> elevator = Optional.ofNullable(null); |
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.
Revert Optional.ofNullable
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.
done
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.
Don't need to do it now, but all of these subsystems need to be non null by merge time
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.
yea
| public static final double ROBOT_LENGTH = 0.864; //in meters with bumpers | ||
| public static final double ROBOT_WIDTH = 0.864; // in meters with bumpers | ||
|
|
||
| public static final double MODULE_OFFSETS = Constants.Drivebase.MODULE_OFFSET; |
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.
Is this line necessary/useful?
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 did it so that it a bit more organized for the pathplanner config
| public static final double MODULE_OFFSETS = Constants.Drivebase.MODULE_OFFSET; | ||
|
|
||
| public static final double ROBOT_MASS = 67.1317; //kilograms | ||
| public static final double MOI = 1.0/12.0 * (ROBOT_MASS)*(Math.sqrt(ROBOT_WIDTH) + Math.sqrt(ROBOT_LENGTH)); |
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.
What does MOI mean?
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.
moment of inertia, i didn't want to spell it out at the time
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.
Please update to the full words
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 did
| // distance from center to wheel | ||
| public static final double PATHPLANNER_DRIVEBASE_RADIUS_METERS = 0.; | ||
|
|
||
| public static final double PERIOD = .02; //seconds |
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.
Add 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.
done
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 recommend changing this variable name to UPDATE_PERIOD
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.
done
|
|
||
| odometryThread.startThread(); | ||
|
|
||
| //configurePathPlanner(); |
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.
Remove comment (add code back in or delete line).
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.
done
| // This will flip the path being followed to the red side of the field. | ||
| // THE ORIGIN WILL REMAIN ON THE BLUE SIDE | ||
|
|
||
| var alliance = DriverStation.getAlliance(); |
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.
Change var
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.
what should i change it to?
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.
changed to what it should be
| public static SwerveModuleConstants MODULES[] = { | ||
| new SwerveModuleConstants( | ||
| 10, 11, 12, -0.337158 + .75, new Translation2d(-MODULE_OFFSET, MODULE_OFFSET), "Back Left" | ||
| 16, 17, 18, 0.476318 - .75, new Translation2d(MODULE_OFFSET, MODULE_OFFSET), "Front Left" |
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.
Please reorder so that these are in the original order
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.
done
| import frc.robot.utils.error.ErrorGroup; | ||
| import frc.robot.utils.error.DiagnosticSubsystem; | ||
|
|
||
| import org.ejml.equation.Variable; |
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.
This is an unused import
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.
done
| 1, | ||
| DCMotor.getKrakenX60(1).withReduction(Constants.Drivebase.Info.DRIVE_MOTOR_GEAR_RATIO), | ||
| 100, | ||
| 4 |
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.
Please add comments for these magic numbers at the very least. Ideally make these constants
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.
done
| setModuleStates(swerveModuleStates); | ||
| } | ||
|
|
||
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.
remove extra space
…into mergingpathplanner
…into mergingpathplanner
…into mergingpathplanner
src/main/java/frc/robot/Robot.java
Outdated
| true | ||
| ) | ||
| ); | ||
| ); // add a set translation controls function. Create a curried function that creates |
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.
Remove comment
src/main/java/frc/robot/Robot.java
Outdated
| autoChooser = AutoBuilder.buildAutoChooser(); | ||
| SmartDashboard.putData("Auto Chooser", autoChooser); | ||
|
|
||
| field = new Field2d(); |
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.
Where is this being used? Delete it if it is not necessary.
src/main/java/frc/robot/Robot.java
Outdated
| NamedCommands.registerCommand("Funnel to up pos", | ||
| new MoveFunnelToSetpoint(funnel.get(), Constants.Funnel.FUNNEL_POSITION_HIGH_CONVERTED)); | ||
|
|
||
| //Collector |
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.
Add space between / and C
src/main/java/frc/robot/Robot.java
Outdated
|
|
||
| NamedCommands.registerCommand("Intake Coral", collector.get().intakeCoralCommand(isAutonomous())); | ||
|
|
||
| NamedCommands.registerCommand("Intake Algea", collector.get().intakeAlgaeCommand(isAutonomous())); |
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.
Check spelling of algae in all locations.
|
|
||
| // All modules are at the position (+-MODULE_TO_OFFSET, +-MODULE_TO_OFFSET) | ||
| private static double MODULE_OFFSET = 0.288925; | ||
| public static double MODULE_OFFSET = 0.288925; |
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.
Revert line.
| new SwerveModuleConstants( | ||
| 10, 11, 12, -0.337158 + .75, new Translation2d(-MODULE_OFFSET, MODULE_OFFSET), "Back Left" | ||
| ), | ||
| new SwerveModuleConstants( |
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.
Revert all of these.
| } | ||
| } | ||
|
|
||
| public Command followPathCommand(String pathName) { |
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.
Move to a new file or to the new command style.
|
|
||
| } | ||
|
|
||
| public Command followAutoTrajectory(String autoName) { |
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.
Change to new command style.
| // THE ORIGIN WILL REMAIN ON THE BLUE SIDE | ||
|
|
||
| Optional<Alliance> alliance = DriverStation.getAlliance(); | ||
| if (alliance.isPresent()) { |
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.
Simplify boolean logic. You don't need an if statement if you use short circuit evaluation.
…into mergingpathplanner
…3/2025Reefscape into mergingpathplanner
No description provided.