This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package frc.robot.hardware; | |
import com.kauailabs.navx.frc.AHRS; | |
import edu.wpi.first.wpilibj.I2C; | |
import edu.wpi.first.wpilibj.PIDSourceType; | |
/*** Encoder Class that keeps track of total angle even when reset unless hard reset*/ | |
public class SuperGyro extends AHRS { | |
private double offsetAngle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#---------------------------------------------------------------------------- | |
# Copyright (c) 2018 FIRST. All Rights Reserved. | |
# Open Source Software - may be modified and shared by FRC teams. The code | |
# must be accompanied by the FIRST BSD license file in the root directory of | |
# the project. | |
# My 2019 license: use it as much as you want. Crediting is recommended because it lets me know that I am being useful. | |
# Credit to Screaming Chickens 3997 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package frc.robot; | |
import frc.robot.controllers.DriveController; | |
import edu.wpi.first.wpilibj.drive.Vector2d; | |
import java.lang.Math; | |
public class Odometry { | |
DriveController driveController; | |
private double prevX, prevY, prevDistance; | |
private double currX, currY, currDistance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#---------------------------------------------------------------------------- | |
# Copyright (c) 2018 FIRST. All Rights Reserved. | |
# Open Source Software - may be modified and shared by FRC teams. The code | |
# must be accompanied by the FIRST BSD license file in the root directory of | |
# the project. | |
# My 2019 license: use it as much as you want. Crediting is recommended because it lets me know that I am being useful. | |
# Credit to Screaming Chickens 3997 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#---------------------------------------------------------------------------- | |
# Copyright (c) 2018 FIRST. All Rights Reserved. | |
# Open Source Software - may be modified and shared by FRC teams. The code | |
# must be accompanied by the FIRST BSD license file in the root directory of | |
# the project. | |
# My 2019 license: use it as much as you want. Crediting is recommended because it lets me know that I am being useful. | |
# Credit to Screaming Chickens 3997 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package frc.robot.controllers; | |
import edu.wpi.first.networktables.NetworkTable; | |
import edu.wpi.first.networktables.NetworkTableEntry; | |
import edu.wpi.first.networktables.NetworkTableInstance; | |
import edu.wpi.first.wpilibj.command.Subsystem; | |
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | |
import frc.robot.hardware.*; | |
public class VisionController extends Subsystem { | |
private boolean is_enabled, driverVision, tapeVision, cargoVision; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package frc.robot.controllers; | |
import edu.wpi.first.networktables.NetworkTable; | |
import edu.wpi.first.networktables.NetworkTableEntry; | |
import edu.wpi.first.networktables.NetworkTableInstance; | |
import edu.wpi.first.wpilibj.command.Subsystem; | |
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | |
import frc.robot.hardware.*; | |
public class VisionController extends Subsystem { | |
private boolean is_enabled, driverVision, tapeVision, cargoVision; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#---------------------------------------------------------------------------- | |
# Copyright (c) 2018 FIRST. All Rights Reserved. | |
# Open Source Software - may be modified and shared by FRC teams. The code | |
# must be accompanied by the FIRST BSD license file in the root directory of | |
# the project. | |
# My 2019 license: use it as much as you want. Crediting is recommended because it lets me know that I am being useful. | |
# Credit to Screaming Chickens 3997 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package frc.robot; | |
import edu.wpi.first.wpilibj.Joystick; | |
import edu.wpi.first.wpilibj.XboxController; | |
import edu.wpi.first.wpilibj.GenericHID.Hand; | |
import edu.wpi.first.wpilibj.drive.DifferentialDrive; | |
/** | |
* The VM is configured to automatically run this class, and to call the | |
* functions corresponding to each mode, as described in the IterativeRobot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Draws Contours and finds center and yaw of ball | |
# centerX is center x coordinate of image | |
# centerY is center y coordinate of image | |
def findBall(contours, image, centerX, centerY): | |
screenHeight, screenWidth, channels = image.shape; | |
#Seen vision targets (correct angle, adjacent to each other) | |
ball = [] | |
if len(contours) > 0: | |
#Sort contours by area size (biggest to smallest) |
OlderNewer