Skip to content

Commit

Permalink
ui element to represent whether or not robot is in field centric cont…
Browse files Browse the repository at this point in the history
…rol or robot centric control, true equals field centric.
  • Loading branch information
aahFancyGun committed Mar 21, 2024
1 parent 9f0c9ab commit f826f49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/subsystems/drive/DriveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public Hardware(NavX2 navx,
private ControlCentricity m_controlCentricity;
private ChassisSpeeds m_desiredChassisSpeeds;
private boolean m_isTractionControlEnabled = true;
private boolean m_isFieldCentricEnabled = true;
private Rotation2d m_allianceCorrection;
private Pose2d m_previousPose;
private Rotation2d m_currentHeading;
Expand Down Expand Up @@ -499,6 +500,7 @@ private void smartDashboard() {
m_field.setRobotPose(getPose());
SmartDashboard.putBoolean("TC", m_isTractionControlEnabled);
SmartDashboard.putBoolean("PurplePath", m_purplePathClient.isConnected());
SmartDashboard.putBoolean("Field Oriented Control", m_isFieldCentricEnabled);
}

/**
Expand Down Expand Up @@ -831,8 +833,10 @@ public void autoDrive(ChassisSpeeds speeds) {
private void toggleControlCentricity() {
if (m_controlCentricity == ControlCentricity.FIELD_CENTRIC) {
this.m_controlCentricity = ControlCentricity.ROBOT_CENTRIC;
m_isFieldCentricEnabled = false;
} else {
this.m_controlCentricity = ControlCentricity.FIELD_CENTRIC;
m_isFieldCentricEnabled = true;
}
}

Expand Down

0 comments on commit f826f49

Please sign in to comment.