Skip to content

Instantly share code, notes, and snippets.

@Aldhanekaa
Last active March 6, 2023 01:28
Show Gist options
  • Save Aldhanekaa/76d816a0f2a80d41da10cbbd90d7fdd1 to your computer and use it in GitHub Desktop.
Save Aldhanekaa/76d816a0f2a80d41da10cbbd90d7fdd1 to your computer and use it in GitHub Desktop.
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