Merge "Scouting: Add submit balance action"
diff --git a/aos/util/config_validator.cc b/aos/util/config_validator.cc
index 78bd0b1..d5bd6ba 100644
--- a/aos/util/config_validator.cc
+++ b/aos/util/config_validator.cc
@@ -1,4 +1,5 @@
 #include <chrono>
+
 #include "aos/configuration.h"
 #include "aos/events/logging/log_reader.h"
 #include "aos/events/logging/log_writer.h"
@@ -9,8 +10,7 @@
 #include "gflags/gflags.h"
 #include "gtest/gtest.h"
 
-DEFINE_string(config, "",
-              "Name of the config file to replay using.");
+DEFINE_string(config, "", "Name of the config file to replay using.");
 /* This binary is used to validate that all of the
    needed remote timestamps channels are in the config
    to log the timestamps.
@@ -18,8 +18,8 @@
    to confirm that the timestamps in the config are able to
    replay all of the data in the log
    This can be done by getting a list of all of the nodes and
-   iterating through it with a for loop creating a logger for 
-   each one 
+   iterating through it with a for loop creating a logger for
+   each one
    Reference superstructure_lib_test.cc*/
 TEST(ConfigValidatorTest, ReadConfig) {
   ASSERT_TRUE(!FLAGS_config.empty());
@@ -30,3 +30,7 @@
 
   factory.RunFor(std::chrono::seconds(1));
 }
+
+// TODO(milind): add more tests, the above one doesn't
+// catch an error like forgetting to add a forwarded message to
+// the destination node's config.
diff --git a/aos/util/config_validator_macro.bzl b/aos/util/config_validator_macro.bzl
index 47ab240..453c5c2 100644
--- a/aos/util/config_validator_macro.bzl
+++ b/aos/util/config_validator_macro.bzl
@@ -1,4 +1,4 @@
-def config_validator_rule(name, config, visibility = None):
+def config_validator_rule(name, config, extension = ".bfbs", visibility = None):
     '''
     Macro to take a config and pass it to the config validator to validate that it will work on a real system.
 
@@ -8,12 +8,12 @@
         name: name that the config validator uses, e.g. "test_config",
         config: config rule that needs to be validated, e.g. "//aos/events:pingpong_config",
     '''
-    config_bfbs = config + ".bfbs"
+    config_file = config + extension
     native.genrule(
         name = name,
         outs = [name + ".txt"],
-        cmd = "$(location //aos/util:config_validator) --config $(location %s) > $@" % config_bfbs,
-        srcs = [config_bfbs],
+        cmd = "$(location //aos/util:config_validator) --config $(location %s) > $@" % config_file,
+        srcs = [config_file],
         tools = ["//aos/util:config_validator"],
         testonly = True,
         visibility = visibility,
diff --git a/scouting/deploy/deploy.py b/scouting/deploy/deploy.py
index 2f14f07..f947398 100644
--- a/scouting/deploy/deploy.py
+++ b/scouting/deploy/deploy.py
@@ -32,20 +32,22 @@
         print("Stopping the scouting app.")
         subprocess.run(
             f"ssh -tt {args.host} sudo systemctl stop scouting.service",
+            shell=True,
             # In case the scouting app isn't installed, ignore the error here.
             check=False,
             stdin=sys.stdin)
         print("Clearing the database.")
         subprocess.run(
             " ".join([
-                f"ssh -tt {args.host} sudo -u postgres psql",
+                f"ssh -tt {args.host}",
+                "\"sudo -u postgres psql",
                 # Drop all tables in the same schema.
                 "-c 'drop schema public cascade;'",
                 # Create an empty schema for the scouting app to use.
                 "-c 'create schema public;'",
                 # List all tables as a sanity check.
                 "-c '\dt'",
-                "postgres",
+                "postgres\"",
             ]),
             shell=True,
             check=True,
diff --git a/scouting/www/entry/entry.ng.html b/scouting/www/entry/entry.ng.html
index ca04fba..72fc140 100644
--- a/scouting/www/entry/entry.ng.html
+++ b/scouting/www/entry/entry.ng.html
@@ -70,7 +70,7 @@
     </div>
     <div class="buttons">
       <!-- Creates a responsive stack of full-width, "block buttons". -->
-      <div class="d-grid gap-2">
+      <div class="d-grid gap-5">
         <button
           class="btn btn-primary"
           [disabled]="!selectedValue"
@@ -83,7 +83,7 @@
   </div>
 
   <div *ngSwitchCase="'Pickup'" id="PickUp" class="container-fluid">
-    <div class="d-grid gap-2">
+    <div class="d-grid gap-5">
       <button class="btn btn-danger" (click)="undoLastAction()">UNDO</button>
       <button
         class="btn btn-warning"
@@ -136,7 +136,7 @@
   </div>
 
   <div *ngSwitchCase="'Place'" id="Place" class="container-fluid">
-    <div class="d-grid gap-2">
+    <div class="d-grid gap-5">
       <button class="btn btn-danger" (click)="undoLastAction()">UNDO</button>
       <button
         class="btn btn-success"
@@ -195,7 +195,7 @@
   </div>
 
   <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
-    <div class="d-grid gap-2">
+    <div class="d-grid gap-5">
       <button class="btn btn-danger" (click)="undoLastAction()">UNDO</button>
       <label>
         <input type="checkbox" (change)="dockedValue = $event.target.value" />
@@ -216,7 +216,7 @@
   </div>
 
   <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
-    <div class="d-grid gap-2">
+    <div class="d-grid gap-5">
       <button class="btn btn-danger" (click)="undoLastAction()">UNDO</button>
       <button
         *ngIf="!autoPhase"
diff --git a/y2023/BUILD b/y2023/BUILD
index f055fe4..d0ba061 100644
--- a/y2023/BUILD
+++ b/y2023/BUILD
@@ -2,6 +2,12 @@
 load("//aos:config.bzl", "aos_config")
 load("//tools/build_rules:template.bzl", "jinja2_template")
 load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/util:config_validator_macro.bzl", "config_validator_rule")
+
+config_validator_rule(
+    name = "config_validator_test",
+    config = "//y2023:aos_config",
+)
 
 robot_downloader(
     binaries = [
diff --git a/y2023/constants.cc b/y2023/constants.cc
index b7b444d..c9eda5e 100644
--- a/y2023/constants.cc
+++ b/y2023/constants.cc
@@ -87,11 +87,11 @@
           0.931355973012855 + 8.6743197253382 - 0.101200335326309 -
           0.0820901660993467 - 0.0703733798337964;
 
-      arm_distal->zeroing.measured_absolute_position = 0.617279923658987;
+      arm_distal->zeroing.measured_absolute_position = 0.58478872393942;
       arm_distal->potentiometer_offset =
           0.436664933370656 + 0.49457213779426 + 6.78213223139724 -
           0.0220711555235029 - 0.0162945074111813 + 0.00630344935527365 -
-          0.0164398318919943 - 0.145833494945215;
+          0.0164398318919943 - 0.145833494945215 + 0.234878799868491;
 
       roll_joint->zeroing.measured_absolute_position = 1.12525305971909;
       roll_joint->potentiometer_offset =
@@ -102,27 +102,27 @@
           0.11972765117321;
 
       wrist->subsystem_params.zeroing_constants.measured_absolute_position =
-          0.420104471500763;
+          0.783151696328745;
 
       break;
 
     case kPracticeTeamNumber:
-      arm_proximal->zeroing.measured_absolute_position = 0.254437958024658;
+      arm_proximal->zeroing.measured_absolute_position = 0.261970010788946;
       arm_proximal->potentiometer_offset =
-          10.5178592988554 + 0.0944609125285876;
+          10.5178592988554 + 0.0944609125285876 - 0.00826532984625095;
 
-      arm_distal->zeroing.measured_absolute_position = 0.51986178669514;
-      arm_distal->potentiometer_offset = 7.673132586937 - 0.0799284644472573 -
-                                         0.0323574039310657 +
-                                         0.0143810684138064;
+      arm_distal->zeroing.measured_absolute_position = 0.507166003869875;
+      arm_distal->potentiometer_offset =
+          7.673132586937 - 0.0799284644472573 - 0.0323574039310657 +
+          0.0143810684138064 + 0.00945555248207735;
 
-      roll_joint->zeroing.measured_absolute_position = 1.86685853969852;
-      roll_joint->potentiometer_offset = 0.624713611895747 + 3.10458504917251 -
-                                         0.0966407797407789 +
-                                         0.0257708772364788;
+      roll_joint->zeroing.measured_absolute_position = 1.88759815823151;
+      roll_joint->potentiometer_offset =
+          0.624713611895747 + 3.10458504917251 - 0.0966407797407789 +
+          0.0257708772364788 - 0.0395076737853459;
 
       wrist->subsystem_params.zeroing_constants.measured_absolute_position =
-          0.615125389629717;
+          0.627578012126286;
 
       break;