Conversation
|
|
||
| @Override | ||
| public void execute() { | ||
| if (currentIndex >= points.size()) |
| double distance = Math.hypot(dx, dy); | ||
| double dtheta = wrapAngle(target.theta - pose.getRotation().getRadians()); | ||
|
|
||
| if (distance < POSITION_TOLERANCE && Math.abs(dtheta) < ANGLE_TOLERANCE) { |
There was a problem hiding this comment.
This logic will not work properly depending on sample rate.
There was a problem hiding this comment.
made it time based instead so I don't need to use that logic
There was a problem hiding this comment.
What is this file for? Is it related to pathing?
There was a problem hiding this comment.
its just the april tag map for the cameras
| public static final double ACCURATE_FOLLOWER_FEED_FORWARD_MULTIPLIER = 1; | ||
| public static String[] paths; | ||
|
|
||
| static { |
There was a problem hiding this comment.
Are you still using .polarauto files?
| return driverController.getRightTriggerAxis(); | ||
| } | ||
|
|
||
| // public static double getDriverLTPercent() { |
There was a problem hiding this comment.
Remove code instead of just commenting it out.
There was a problem hiding this comment.
its for the other controller that has a bad trigger.
|
|
||
| public static double getOperatorRightY() { | ||
| double rightX = operatorController.getRightX(), rightY = operatorController.getRightY(); | ||
| if (Math.hypot(rightX, rightY) < Constants.OperatorConstants.LEFT_STICK_DEADZONE) { |
There was a problem hiding this comment.
Why are you comparing your right joystick values to the left stick deadzone
| return leftY; | ||
| } | ||
|
|
||
| public static double getOperatorRightX() { |
There was a problem hiding this comment.
Why are you comparing your right joysticks to the left stick dead zone.
| // Dictates the inputs and outputs | ||
| private double maxInput; | ||
| private double minInput; | ||
| private double maxOutput = 1500;// defaults to 100% and -100% motor power |
There was a problem hiding this comment.
Why are these set to 1500? Should be -1 and 1 for 100% power
| import frc.robot.tools.math.Vector; | ||
|
|
||
| public class Peripherals { | ||
| private PhotonCamera frontReefCam = new PhotonCamera("Front_Reef"); |
There was a problem hiding this comment.
Remove code components you don't have implemented yet.
There was a problem hiding this comment.
There is too much code in drive that references the camera stuff, but it doesn't effect anything if I don't have anything plugged in.
There was a problem hiding this comment.
Pull request overview
This PR implements an autonomous path following system using JSON-based configuration. The main changes add infrastructure for conditional execution, path following commands, and various utility classes for vector math, PID control, and robot subsystems.
Reviewed changes
Copilot reviewed 45 out of 48 changed files in this pull request and generated 22 comments.
Show a summary per file
| File | Description |
|---|---|
| photonlib.json, WPILibNewCommands.json, Phoenix6-frc2025-latest.json, AdvantageKit.json | Added vendor dependency configurations for vision, commands, motor controllers, and logging |
| AutoFollower.java | Abstract base class defining interface for path following commands |
| Vector.java | Vector math utility for 2D calculations |
| PID.java (tools/math) | Basic PID controller implementation |
| PID.java (tools/controlloops) | Enhanced PID controller with detailed documentation |
| TriggerButton.java | Simple wrapper extending WPILib Trigger |
| PathLoader.java | Utility to load path data from JSON files |
| SwerveModule.java | Comprehensive swerve module control implementation |
| Superstructure.java | High-level robot state management |
| Peripherals.java | Sensor and camera management subsystem |
| Drive.java | Main drive subsystem with path following, odometry, and vision |
| Conditional classes | Interface and implementations for autonomous branching logic |
| SetRobotState commands | Various command classes for state management |
| AutoRunner.java | Command orchestrator for JSON-based autonomous routines |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import java.util.function.BooleanSupplier; | ||
| import java.util.function.IntFunction; | ||
|
|
||
| import javax.lang.model.util.ElementScanner14; |
There was a problem hiding this comment.
Unused import 'javax.lang.model.util.ElementScanner14' should be removed. This is a compiler-related utility that is not used anywhere in this file and should not be present in robot code.
|
|
||
| import org.littletonrobotics.junction.Logger; | ||
|
|
||
| import com.fasterxml.jackson.databind.ser.BeanSerializer; |
There was a problem hiding this comment.
Unused import 'com.fasterxml.jackson.databind.ser.BeanSerializer' should be removed. This import is not used anywhere in the file.
| package frc.robot.subsystems; | ||
|
|
||
| import java.util.function.BooleanSupplier; | ||
| import java.util.function.IntFunction; |
There was a problem hiding this comment.
Unused import 'java.util.function.IntFunction' should be removed. This import is not used anywhere in the file.
| private void check() { | ||
| if (condition.getAsBoolean()) { | ||
| runCommands(); | ||
| } | ||
| } |
There was a problem hiding this comment.
The 'check()' method is never called, making this Trigger class non-functional. Either implement periodic checking (e.g., in Robot.periodic) or remove the unused method.
| import edu.wpi.first.wpilibj2.command.Command; | ||
|
|
||
| public abstract class AutoFollower extends Command { | ||
| /** Creates a new PolarTakeDrive. */ |
There was a problem hiding this comment.
Incorrect JavaDoc comment references 'PolarTakeDrive' instead of 'AutoFollower'. The documentation should match the actual class name.
| /** | ||
| * Converts feet to meters. | ||
| * | ||
| * @param inches The length in feet to be converted. |
| /** | ||
| * Converts a quantity in degrees to rotations. | ||
| * | ||
| * @param rotations The quantity in degrees to be converted. |
There was a problem hiding this comment.
@param tag "rotations" does not match any actual parameter of method "degreesToRotations()".
| * @param rotations The quantity in degrees to be converted. | |
| * @param degrees The quantity in degrees to be converted. |
| /** | ||
| * Converts a quantity in degrees to radians. | ||
| * | ||
| * @param rotations The quantity in degrees to be converted. |
There was a problem hiding this comment.
@param tag "rotations" does not match any actual parameter of method "degreesToRadians()".
| * @param rotations The quantity in degrees to be converted. | |
| * @param degrees The quantity in degrees to be converted. |
| /** | ||
| * Converts revolutions per second (RPS) to revolutions per minute (RPM). | ||
| * | ||
| * @param RPM The value in revolutions per second (RPS) to be converted. |
There was a problem hiding this comment.
@param tag "RPM" does not match any actual parameter of method "RPSToRPM()".
| * @param RPM The value in revolutions per second (RPS) to be converted. | |
| * @param RPS The value in revolutions per second (RPS) to be converted. |
| /** Creates a new PolarTakeDrive. */ | ||
| public abstract int getPathPointIndex(); | ||
|
|
||
| public abstract void initialize(); |
There was a problem hiding this comment.
This method overrides Command.initialize; it is advisable to add an Override annotation.
everything in autorunner.java and the sample_path.json in the deploy directory