Last active
March 6, 2023 01:28
-
-
Save Aldhanekaa/76d816a0f2a80d41da10cbbd90d7fdd1 to your computer and use it in GitHub Desktop.
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.subsystems; | |
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | |
import edu.wpi.first.wpilibj2.command.CommandBase; | |
import edu.wpi.first.wpilibj2.command.SubsystemBase; | |
public class JetsonNanoSubsystem extends SubsystemBase { | |
private double angleToObj = 0; | |
private String objClassId = ""; | |
public JetsonNanoSubsystem() { | |
} | |
@Override | |
public void periodic() { | |
double angleToObjNew = SmartDashboard.getNumber("angleToObj", angleToObj); | |
String classIdNew = SmartDashboard.getString("classId", objClassId); | |
if (this.angleToObj != angleToObjNew) { | |
this.angleToObj = angleToObjNew; | |
} | |
if (objClassId != classIdNew) { | |
this.objClassId = classIdNew; | |
} | |
} | |
public double getAngle() { | |
return this.angleToObj; | |
} | |
public String getClassId() { | |
return this.objClassId; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment