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

Brownout2 #18

Merged
merged 24 commits into from
Feb 4, 2022
Merged
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@
import edu.wpi.first.wpilibj.Filesystem;
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.XboxController;
<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

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

Github made you commit merge conflicts? Have you resolved these or are they just on the branch?

Copy link
Member

Choose a reason for hiding this comment

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

By the way, you should keep HEAD for all of these. The conflicts look to be from very old changes from before pathfollowing was merged.

import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.geometry.Translation2d;
=======
>>>>>>> b87526b3161c203dc458a02f37ca2bda76a19083
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.RunCommand;
<<<<<<< HEAD
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import frc.robot.commands.tank.FollowPathCommand;
=======
import frc.robot.commands.tank.DriveTankCommand;
>>>>>>> b87526b3161c203dc458a02f37ca2bda76a19083
import frc.robot.subsystems.tank.TankSubsystem;

/**
Expand Down Expand Up @@ -98,12 +105,28 @@ private void configureButtonBindings() {
}

private void controllerBindings() {
<<<<<<< HEAD
// Bind A button to zero robot position when pressed
xboxAButton.whenPressed(new InstantCommand(tankSubsystem::resetPosition));
=======
Runnable tank = () -> {

// Check which controller is being used
boolean isXbox = (Math.abs(controlXbox.getLeftY())
+ Math.abs(controlXbox.getRightX())) > (Math.abs(joystickLeft.getY()) + Math.abs(joystickRight.getY()));
>>>>>>> b87526b3161c203dc458a02f37ca2bda76a19083

Runnable tank = () -> {
// Set the drive powers based on which controller is being used
<<<<<<< HEAD
tankSubsystem.setCarDrivePowers(-controlXbox.getLeftY(), controlXbox.getRightX());
=======
if (isXbox) {
tankSubsystem.setCarDrivePowers(-controlXbox.getLeftY(), controlXbox.getRightX());
} else {
tankSubsystem.setTankDrivePowers(-joystickLeft.getY(), -joystickRight.getY());
}
>>>>>>> b87526b3161c203dc458a02f37ca2bda76a19083
};
tankSubsystem.setDefaultCommand(new RunCommand(tank, tankSubsystem));
}
Expand Down