Merge "Clean up some styling in scouting app."
diff --git a/frc971/analysis/plot_index.ts b/frc971/analysis/plot_index.ts
index f56a6bf..bbaa0ce 100644
--- a/frc971/analysis/plot_index.ts
+++ b/frc971/analysis/plot_index.ts
@@ -44,7 +44,7 @@
     'org_frc971/y2022/control_loops/superstructure/turret_plotter'
 import {plotCatapult as plot2022Catapult} from
     'org_frc971/y2022/control_loops/superstructure/catapult_plotter'
-import {plotIntake as plot2022Intake} from
+import {plotIntakeFront as plot2022IntakeFront, plotIntakeBack as plot2022IntakeBack} from
     'org_frc971/y2022/control_loops/superstructure/intake_plotter'
 import {plotClimber as plot2022Climber} from
     'org_frc971/y2022/control_loops/superstructure/climber_plotter'
@@ -117,7 +117,8 @@
   ['2020 Localizer', new PlotState(plotDiv, plot2020Localizer)],
   ['2022 Localizer', new PlotState(plotDiv, plot2022Localizer)],
   ['2022 Catapult', new PlotState(plotDiv, plot2022Catapult)],
-  ['2022 Intake', new PlotState(plotDiv, plot2022Intake)],
+  ['2022 Intake Front', new PlotState(plotDiv, plot2022IntakeFront)],
+  ['2022 Intake Back', new PlotState(plotDiv, plot2022IntakeBack)],
   ['2022 Climber', new PlotState(plotDiv, plot2022Climber)],
   ['2022 Turret', new PlotState(plotDiv, plot2022Turret)],
   ['C++ Plotter', new PlotState(plotDiv, plotData)],
diff --git a/y2022/constants.h b/y2022/constants.h
index b1565e6..5b8fe64 100644
--- a/y2022/constants.h
+++ b/y2022/constants.h
@@ -131,10 +131,10 @@
   // TODO (Yash): Constants need to be tuned
   static constexpr ::frc971::constants::Range kTurretRange() {
     return ::frc971::constants::Range{
-        .lower_hard = -0.1,  // Back Hard
-        .upper_hard = 4.71,  // Front Hard
-        .lower = 0.0,        // Back Soft
-        .upper = 3.3         // Front Soft
+        .lower_hard = -6.0,  // Back Hard
+        .upper_hard = 4.0,   // Front Hard
+        .lower = -5.0,       // Back Soft
+        .upper = 3.7         // Front Soft
     };
   }
 
diff --git a/y2022/control_loops/superstructure/intake_plotter.ts b/y2022/control_loops/superstructure/intake_plotter.ts
index 592d85f..8904d8b 100644
--- a/y2022/control_loops/superstructure/intake_plotter.ts
+++ b/y2022/control_loops/superstructure/intake_plotter.ts
@@ -9,7 +9,7 @@
 const DEFAULT_WIDTH = AosPlotter.DEFAULT_WIDTH * 5 / 2;
 const DEFAULT_HEIGHT = AosPlotter.DEFAULT_HEIGHT * 3;
 
-export function plotIntake(conn: Connection, element: Element) : void {
+export function plotIntakeFront(conn: Connection, element: Element) : void {
   const aosPlotter = new AosPlotter(conn);
   const goal = aosPlotter.addMessageSource('/superstructure', 'y2022.control_loops.superstructure.Goal');
   const output = aosPlotter.addMessageSource('/superstructure', 'y2022.control_loops.superstructure.Output');
@@ -30,19 +30,6 @@
   positionPlotFront.addMessageLine(status, ['intake_front', 'goal_velocity']).setColor(ORANGE).setPointSize(4.0);
   positionPlotFront.addMessageLine(status, ['intake_front', 'estimator_state', 'position']).setColor(CYAN).setPointSize(1.0);
 
-  const positionPlotBack =
-      aosPlotter.addPlot(element, [DEFAULT_WIDTH, DEFAULT_HEIGHT / 2]);
-  positionPlotBack.plot.getAxisLabels().setTitle('Position');
-  positionPlotBack.plot.getAxisLabels().setXLabel(TIME);
-  positionPlotBack.plot.getAxisLabels().setYLabel('rad');
-  positionPlotBack.plot.setDefaultYRange([-1.0, 2.0]);
-
-  positionPlotBack.addMessageLine(status, ['intake_back', 'position']).setColor(GREEN).setPointSize(4.0);
-  positionPlotBack.addMessageLine(status, ['intake_back', 'velocity']).setColor(PINK).setPointSize(1.0);
-  positionPlotBack.addMessageLine(status, ['intake_back', 'goal_position']).setColor(RED).setPointSize(4.0);
-  positionPlotBack.addMessageLine(status, ['intake_back', 'goal_velocity']).setColor(ORANGE).setPointSize(4.0);
-  positionPlotBack.addMessageLine(status, ['intake_back', 'estimator_state', 'position']).setColor(CYAN).setPointSize(1.0);
-
   const voltagePlotFront =
       aosPlotter.addPlot(element, [DEFAULT_WIDTH, DEFAULT_HEIGHT / 2]);
   voltagePlotFront.plot.getAxisLabels().setTitle('Voltage');
@@ -55,6 +42,35 @@
   voltagePlotFront.addMessageLine(status, ['intake_front', 'position_power']).setColor(BROWN).setPointSize(1.0);
   voltagePlotFront.addMessageLine(status, ['intake_front', 'velocity_power']).setColor(CYAN).setPointSize(1.0);
   voltagePlotFront.addMessageLine(robotState, ['voltage_battery']).setColor(GREEN).setPointSize(1.0);
+}
+
+export function plotIntakeBack(conn: Connection, element: Element) : void {
+  const aosPlotter = new AosPlotter(conn);
+  const goal = aosPlotter.addMessageSource('/superstructure', 'y2022.control_loops.superstructure.Goal');
+  const output = aosPlotter.addMessageSource('/superstructure', 'y2022.control_loops.superstructure.Output');
+  const status = aosPlotter.addMessageSource('/superstructure', 'y2022.control_loops.superstructure.Status');
+  const robotState = aosPlotter.addMessageSource('/aos', 'aos.RobotState');
+
+  // Robot Enabled/Disabled and Mode
+  const positionPlotFront =
+      aosPlotter.addPlot(element, [DEFAULT_WIDTH, DEFAULT_HEIGHT / 2]);
+  positionPlotFront.plot.getAxisLabels().setTitle('Position');
+  positionPlotFront.plot.getAxisLabels().setXLabel(TIME);
+  positionPlotFront.plot.getAxisLabels().setYLabel('rad');
+  positionPlotFront.plot.setDefaultYRange([-1.0, 2.0]);
+
+  const positionPlotBack =
+      aosPlotter.addPlot(element, [DEFAULT_WIDTH, DEFAULT_HEIGHT / 2]);
+  positionPlotBack.plot.getAxisLabels().setTitle('Position');
+  positionPlotBack.plot.getAxisLabels().setXLabel(TIME);
+  positionPlotBack.plot.getAxisLabels().setYLabel('rad');
+  positionPlotBack.plot.setDefaultYRange([-1.0, 2.0]);
+
+  positionPlotBack.addMessageLine(status, ['intake_back', 'position']).setColor(GREEN).setPointSize(4.0);
+  positionPlotBack.addMessageLine(status, ['intake_back', 'velocity']).setColor(PINK).setPointSize(1.0);
+  positionPlotBack.addMessageLine(status, ['intake_back', 'goal_position']).setColor(RED).setPointSize(4.0);
+  positionPlotBack.addMessageLine(status, ['intake_back', 'goal_velocity']).setColor(ORANGE).setPointSize(4.0);
+  positionPlotBack.addMessageLine(status, ['intake_back', 'estimator_state', 'position']).setColor(CYAN).setPointSize(1.0);
 
 
   const voltagePlotBack =
diff --git a/y2022/control_loops/superstructure/superstructure.cc b/y2022/control_loops/superstructure/superstructure.cc
index aa5eee8..affc25b 100644
--- a/y2022/control_loops/superstructure/superstructure.cc
+++ b/y2022/control_loops/superstructure/superstructure.cc
@@ -349,24 +349,29 @@
   const flatbuffers::Offset<RelativeEncoderProfiledJointStatus>
       climber_status_offset = climber_.Iterate(
           unsafe_goal != nullptr ? unsafe_goal->climber() : nullptr,
-          position->climber(), &output_struct.climber_voltage, status->fbb());
+          position->climber(),
+          output != nullptr ? &output_struct.climber_voltage : nullptr,
+          status->fbb());
 
   const flatbuffers::Offset<PotAndAbsoluteEncoderProfiledJointStatus>
       intake_status_offset_front = intake_front_.Iterate(
           unsafe_goal != nullptr ? unsafe_goal->intake_front() : nullptr,
-          position->intake_front(), &output_struct.intake_voltage_front,
+          position->intake_front(),
+          output != nullptr ? &output_struct.intake_voltage_front : nullptr,
           status->fbb());
 
   const flatbuffers::Offset<PotAndAbsoluteEncoderProfiledJointStatus>
       intake_status_offset_back = intake_back_.Iterate(
           unsafe_goal != nullptr ? unsafe_goal->intake_back() : nullptr,
-          position->intake_back(), &output_struct.intake_voltage_back,
+          position->intake_back(),
+          output != nullptr ? &output_struct.intake_voltage_back : nullptr,
           status->fbb());
 
   const flatbuffers::Offset<PotAndAbsoluteEncoderProfiledJointStatus>
-      turret_status_offset =
-          turret_.Iterate(turret_goal, position->turret(),
-                          &output_struct.turret_voltage, status->fbb());
+      turret_status_offset = turret_.Iterate(
+          turret_goal, position->turret(),
+          output != nullptr ? &output_struct.turret_voltage : nullptr,
+          status->fbb());
 
   if (output != nullptr) {
     output_struct.roller_voltage_front = roller_speed_compensated_front;