Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanErn committed Dec 7, 2024
1 parent dc18ef3 commit c0ca635
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/mkdocs/docs/library/subsystems/bling.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ To add this subsystem to your robot:
3. Set up default command (typically DefaultSetToAllianceColor)
4. Integrate with robot state indicators as needed

This subsystem is designed to be both robust for competition use and flexible for development and testing purposes.
This subsystem is designed to be both robust for competition use and flexible for development and testing purposes.
8 changes: 4 additions & 4 deletions docs/mkdocs/docs/library/subsystems/swerve.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Module configuration is handled in the year-specific TunerConstants files. To co
// PID Gains
private static final Slot0Configs steerGains = new Slot0Configs()
.withKP(100) // Adjust based on your robot's steering response
.withKI(0)
.withKI(0)
.withKD(0.2);

private static final Slot0Configs driveGains = new Slot0Configs()
Expand All @@ -63,7 +63,7 @@ public static final PathConstraints PATHFINDING_CONSTRAINTS = new PathConstraint

2. Configure the holonomic drive controller:
```java
public static final PPHolonomicDriveController PP_HOLONOMIC_DRIVE_CONTROLLER =
public static final PPHolonomicDriveController PP_HOLONOMIC_DRIVE_CONTROLLER =
new PPHolonomicDriveController(
new PIDConstants(2.4, 0, 0.015), // Translation PID
new PIDConstants(7.8, 0, 0.015) // Rotation PID
Expand Down Expand Up @@ -136,7 +136,7 @@ Command pathfindCommand = pathPlanner.getPathFinderCommand(

### Manual Drive Control
```java
swerve.applyRequest(() ->
swerve.applyRequest(() ->
new SwerveRequest.FieldCentric()
.withVelocityX(joystickX)
.withVelocityY(joystickY)
Expand Down Expand Up @@ -164,4 +164,4 @@ swerve.applyRequest(() ->
4. Telemetry
- Monitor module states during testing
- Use field visualization to verify odometry
- Log relevant data for troubleshooting
- Log relevant data for troubleshooting
2 changes: 1 addition & 1 deletion docs/mkdocs/site/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</urlset>
</urlset>
3 changes: 2 additions & 1 deletion src/main/java/frc/alotobots/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,13 @@ private void configureLogicCommands() {
// Test OTF Pathplanner to best object
hmiStation.testOTFPathplannerButton.onTrue(
new PathfindToBestObject(
photonvisionObjectDetectionSubsystem, drivetrainSubsystem, pathPlanner));
photonvisionObjectDetectionSubsystem, drivetrainSubsystem, pathPlanner, "Note"));
// Test Object Detection and FieldCentricFacingAngle
hmiStation.driveWhileFacingBestObjectTrigger.toggleOnTrue(
new DriveFacingBestObject(
photonvisionObjectDetectionSubsystem,
drivetrainSubsystem,
"Note",
() -> hmiStation.driveFwdAxis() * hmiStation.getDriveXYPerfMode(),
() -> hmiStation.driveStrAxis() * hmiStation.getDriveXYPerfMode(),
() -> hmiStation.driveRotAxis() * hmiStation.getDriveRotPerfMode()));
Expand Down
15 changes: 6 additions & 9 deletions src/main/java/frc/alotobots/library/bling/BlingSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@
/**
* Subsystem for controlling LED lighting (Bling) on the robot.
*
* <p>The Bling subsystem manages LED strips connected to a CTRE CANdle controller.
* It supports:
* - Setting solid colors
* - Running animations
* - Queueing colors/animations
* - Alliance-based color schemes
* - Brightness control
* <p>The Bling subsystem manages LED strips connected to a CTRE CANdle controller. It supports: -
* Setting solid colors - Running animations - Queueing colors/animations - Alliance-based color
* schemes - Brightness control
*
* <p>The subsystem uses a CANdle controller to drive addressable LED strips.
* LED updates happen in the periodic() method.
* <p>The subsystem uses a CANdle controller to drive addressable LED strips. LED updates happen in
* the periodic() method.
*
* <p>Usage example:
*
* <pre>
* BlingSubsystem bling = new BlingSubsystem();
* // Set solid red color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public GameElement getGameElement() {
}
return GAME_ELEMENTS[classId];
}

private double lastUpdateTime;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj2.command.Command;
import frc.alotobots.library.drivetrains.swerve.ctre.SwerveDriveSubsystem;
import frc.alotobots.library.vision.photonvision.objectdetection.GameElement;
import frc.alotobots.library.vision.photonvision.objectdetection.PhotonVisionObjectDetectionSubsystem;
import java.util.function.DoubleSupplier;

Expand Down Expand Up @@ -88,9 +87,10 @@ public DriveFacingBestObject(
*/
@Override
public void execute() {
var detectedObjects = objectDetectionSubsystem.getDetectedObjects().stream()
.filter(obj -> obj.getGameElement().getName().equals(targetGameElementName))
.toList();
var detectedObjects =
objectDetectionSubsystem.getDetectedObjects().stream()
.filter(obj -> obj.getGameElement().getName().equals(targetGameElementName))
.toList();

if (!detectedObjects.isEmpty()) {
Rotation2d angle = detectedObjects.get(0).getAngle();
Expand All @@ -108,8 +108,7 @@ public void execute() {
}

// Rotation override timeout
if (!detectedObjects.isEmpty()
&& velocityRotation.getAsDouble() != 0) {
if (!detectedObjects.isEmpty() && velocityRotation.getAsDouble() != 0) {
overrideTimer.start();
} else {
overrideTimer.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ public PathfindToBestObject(

@Override
public void initialize() {
var detectedObjects = objectDetectionSubsystem.getDetectedObjects().stream()
.filter(obj -> obj.getGameElement().getName().equals(targetGameElementName))
.toList();
var detectedObjects =
objectDetectionSubsystem.getDetectedObjects().stream()
.filter(obj -> obj.getGameElement().getName().equals(targetGameElementName))
.toList();
if (detectedObjects.isEmpty()) {
return;
}
Expand Down

0 comments on commit c0ca635

Please sign in to comment.