Merge "Add beambreaks to wpilib_interface"
diff --git a/aos/actions/BUILD b/aos/actions/BUILD
index 1905e9c..a76dc3f 100644
--- a/aos/actions/BUILD
+++ b/aos/actions/BUILD
@@ -54,7 +54,7 @@
],
target_compatible_with = ["@platforms//os:linux"],
deps = [
- "//aos/events:config",
+ "//aos/events:aos_config",
],
)
diff --git a/aos/aos_cli_utils.cc b/aos/aos_cli_utils.cc
index 84ba1e4..f71ed2a 100644
--- a/aos/aos_cli_utils.cc
+++ b/aos/aos_cli_utils.cc
@@ -6,7 +6,7 @@
#include <iostream>
-DEFINE_string(config, "./config.json", "File path of aos configuration");
+DEFINE_string(config, "./aos_config.json", "File path of aos configuration");
DEFINE_bool(
_bash_autocomplete, false,
diff --git a/aos/aos_graph_nodes.cc b/aos/aos_graph_nodes.cc
index 90778d1..cf7bc11 100644
--- a/aos/aos_graph_nodes.cc
+++ b/aos/aos_graph_nodes.cc
@@ -10,7 +10,7 @@
DEFINE_bool(all, false,
"If true, print out the channels for all nodes in the config file, "
"not just the channels which are visible on this node.");
-DEFINE_string(config, "./config.json", "File path of aos configuration");
+DEFINE_string(config, "./aos_config.json", "File path of aos configuration");
DEFINE_bool(short_types, true,
"Whether to show a shortened version of the type name");
diff --git a/aos/configuration.h b/aos/configuration.h
index 9cb1132..c0e2715 100644
--- a/aos/configuration.h
+++ b/aos/configuration.h
@@ -40,8 +40,8 @@
FlatbufferDetachedBuffer<Configuration> MergeWithConfig(
const Configuration *config, const Flatbuffer<Configuration> &addition);
-// Adds the list of schemas to the provide config json. This should mostly be
-// used for testing and in conjunction with MergeWithConfig.
+// Adds the list of schemas to the provide aos_config.json. This should mostly
+// be used for testing and in conjunction with MergeWithConfig.
FlatbufferDetachedBuffer<aos::Configuration> AddSchema(
std::string_view json,
const std::vector<FlatbufferVector<reflection::Schema>> &schemas);
diff --git a/aos/events/BUILD b/aos/events/BUILD
index f36da1e..e53be2f 100644
--- a/aos/events/BUILD
+++ b/aos/events/BUILD
@@ -142,7 +142,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "aos.json",
flatbuffers = [
":event_loop_fbs",
@@ -161,7 +161,7 @@
":pong_fbs",
],
target_compatible_with = ["@platforms//os:linux"],
- deps = [":config"],
+ deps = [":aos_config"],
)
[
@@ -177,7 +177,7 @@
"//aos/network:message_bridge_server_fbs",
],
target_compatible_with = ["@platforms//os:linux"],
- deps = [":config"],
+ deps = [":aos_config"],
)
for config in [
"multinode_pingpong_test_split",
@@ -448,7 +448,7 @@
"glib_main_loop_test.cc",
],
data = [
- ":config",
+ ":aos_config",
],
deps = [
":glib_main_loop",
diff --git a/aos/events/glib_main_loop_test.cc b/aos/events/glib_main_loop_test.cc
index b857b0b..9f72e54 100644
--- a/aos/events/glib_main_loop_test.cc
+++ b/aos/events/glib_main_loop_test.cc
@@ -15,7 +15,7 @@
const FlatbufferDetachedBuffer<Configuration> &Config() {
static const FlatbufferDetachedBuffer<Configuration> result =
- configuration::ReadConfig(ArtifactPath("aos/events/config.json"));
+ configuration::ReadConfig(ArtifactPath("aos/events/aos_config.json"));
return result;
}
diff --git a/aos/events/logging/BUILD b/aos/events/logging/BUILD
index ec13f92..272bee4 100644
--- a/aos/events/logging/BUILD
+++ b/aos/events/logging/BUILD
@@ -383,7 +383,7 @@
"//aos/network:timestamp_fbs",
],
target_compatible_with = ["@platforms//os:linux"],
- deps = ["//aos/events:config"],
+ deps = ["//aos/events:aos_config"],
)
aos_config(
@@ -398,7 +398,7 @@
"//aos/network:timestamp_fbs",
],
target_compatible_with = ["@platforms//os:linux"],
- deps = ["//aos/events:config"],
+ deps = ["//aos/events:aos_config"],
)
aos_config(
@@ -413,7 +413,7 @@
"//aos/network:timestamp_fbs",
],
target_compatible_with = ["@platforms//os:linux"],
- deps = ["//aos/events:config"],
+ deps = ["//aos/events:aos_config"],
)
cc_test(
diff --git a/aos/events/logging/logger_main.cc b/aos/events/logging/logger_main.cc
index 4874c77..aa6f25b 100644
--- a/aos/events/logging/logger_main.cc
+++ b/aos/events/logging/logger_main.cc
@@ -10,7 +10,7 @@
#include "gflags/gflags.h"
#include "glog/logging.h"
-DEFINE_string(config, "config.json", "Config file to use.");
+DEFINE_string(config, "aos_config.json", "Config file to use.");
DEFINE_bool(skip_renicing, false,
"If true, skip renicing the logger. This leaves it lower priority "
diff --git a/aos/network/BUILD b/aos/network/BUILD
index 323a334..bc68c90 100644
--- a/aos/network/BUILD
+++ b/aos/network/BUILD
@@ -354,7 +354,7 @@
"//aos/network:timestamp_fbs",
],
target_compatible_with = ["@platforms//os:linux"],
- deps = ["//aos/events:config"],
+ deps = ["//aos/events:aos_config"],
)
aos_config(
@@ -369,7 +369,7 @@
"//aos/network:timestamp_fbs",
],
target_compatible_with = ["@platforms//os:linux"],
- deps = ["//aos/events:config"],
+ deps = ["//aos/events:aos_config"],
)
cc_test(
diff --git a/aos/network/message_bridge_client.cc b/aos/network/message_bridge_client.cc
index 61a7271..301dfd9 100644
--- a/aos/network/message_bridge_client.cc
+++ b/aos/network/message_bridge_client.cc
@@ -3,7 +3,7 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-DEFINE_string(config, "config.json", "Path to the config.");
+DEFINE_string(config, "aos_config.json", "Path to the config.");
DEFINE_int32(rt_priority, -1, "If > 0, run as this RT priority");
namespace aos {
diff --git a/aos/network/message_bridge_server.cc b/aos/network/message_bridge_server.cc
index 9f336c0..fc1425d 100644
--- a/aos/network/message_bridge_server.cc
+++ b/aos/network/message_bridge_server.cc
@@ -4,7 +4,7 @@
#include "gflags/gflags.h"
#include "glog/logging.h"
-DEFINE_string(config, "config.json", "Path to the config.");
+DEFINE_string(config, "aos_config.json", "Path to the config.");
DEFINE_int32(rt_priority, -1, "If > 0, run as this RT priority");
namespace aos {
diff --git a/aos/network/web_proxy_main.cc b/aos/network/web_proxy_main.cc
index f3ad926..4482ad0 100644
--- a/aos/network/web_proxy_main.cc
+++ b/aos/network/web_proxy_main.cc
@@ -4,7 +4,7 @@
#include "aos/network/web_proxy.h"
#include "gflags/gflags.h"
-DEFINE_string(config, "./config.json", "File path of aos configuration");
+DEFINE_string(config, "./aos_config.json", "File path of aos configuration");
DEFINE_string(data_dir, "www", "Directory to serve data files from");
DEFINE_int32(buffer_size, 1000000,
"-1 if infinite, in bytes / channel. If there are no active "
diff --git a/aos/network/www/BUILD b/aos/network/www/BUILD
index f62ed67..1b00af7 100644
--- a/aos/network/www/BUILD
+++ b/aos/network/www/BUILD
@@ -158,7 +158,7 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//aos/events:config",
+ "//aos/events:aos_config",
],
)
@@ -179,7 +179,7 @@
":reflection_test_bundle.min.js",
":test_config",
"//aos/network:web_proxy_main",
- "//y2020:config",
+ "//y2020:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
)
diff --git a/aos/starter/starter.sh b/aos/starter/starter.sh
index d5812c2..9bc7605 100755
--- a/aos/starter/starter.sh
+++ b/aos/starter/starter.sh
@@ -1,62 +1,22 @@
#!/bin/bash
+set -x
+
if [[ "$(hostname)" == "roboRIO"* ]]; then
/usr/local/natinst/etc/init.d/systemWebServer stop
- ROBOT_CODE="/home/admin/robot_code"
-
- # Get the CTRE libraries in the shared library search path
- for f in $(ls *.so);
- do
- ln -f -s /home/admin/robot_code/$f /usr/local/frc/third-party/lib/$f
- done
+ ROBOT_CODE="/home/admin/bin"
+ cd "${ROBOT_CODE}"
ln -s /var/local/natinst/log/FRC_UserProgram.log /tmp/FRC_UserProgram.log
ln -s /var/local/natinst/log/FRC_UserProgram.log "${ROBOT_CODE}/FRC_UserProgram.log"
elif [[ "$(hostname)" == "pi-"* ]]; then
- function chrtirq() {
- ps -ef | grep "\\[$1\\]" | awk '{print $2}' | xargs chrt $2 -p $3
- }
-
- chrtirq "irq/20-fe00b880" -f 50
- chrtirq "irq/66-xhci_hcd" -f 1
- chrtirq "irq/50-VCHIQ do" -o 0
- chrtirq "irq/27-DMA IRQ" -f 50
- chrtirq "irq/51-mmc1" -o 0
- chrtirq "irq/51-mmc0" -o 0
- chrtirq "irq/51-s-mmc0" -o 0
- chrtirq "irq/64-v3d" -o 0
- chrtirq "irq/24-vc4 hvs" -o 0
- chrtirq "irq/42-vc4 hdmi" -o 0
- chrtirq "irq/43-vc4 hdmi" -o 0
- chrtirq "irq/39-vc4 hdmi" -o 0
- chrtirq "irq/39-s-vc4 hd" -o 0
- chrtirq "irq/38-vc4 hdmi" -o 0
- chrtirq "irq/38-s-vc4 hd" -o 0
- chrtirq "irq/29-DMA IRQ" -f 50
- chrtirq "irq/48-vc4 hdmi" -o 0
- chrtirq "irq/49-vc4 hdmi" -o 0
- chrtirq "irq/45-vc4 hdmi" -o 0
- chrtirq "irq/45-s-vc4 hd" -o 0
- chrtirq "irq/44-vc4 hdmi" -o 0
- chrtirq "irq/44-s-vc4 hd" -o 0
- chrtirq "irq/30-DMA IRQ" -f 50
- chrtirq "irq/19-fe004000" -f 50
- chrtirq "irq/34-vc4 crtc" -o 0
- chrtirq "irq/35-vc4 crtc" -o 0
- chrtirq "irq/36-vc4 crtc" -o 0
- chrtirq "irq/35-vc4 crtc" -o 0
- chrtirq "irq/37-vc4 crtc" -o 0
- chrtirq "irq/23-uart-pl0" -o 0
- chrtirq "irq/57-eth0" -f 10
- chrtirq "irq/58-eth0" -f 10
-
# We have systemd configured to handle restarting, so just exec.
- export PATH="${PATH}:/home/pi/robot_code"
+ export PATH="${PATH}:/home/pi/bin"
rm -rf /dev/shm/aos
exec starterd
else
- ROBOT_CODE="${HOME}/robot_code"
+ ROBOT_CODE="${HOME}/bin"
fi
cd "${ROBOT_CODE}"
diff --git a/aos/starter/starter_cmd.cc b/aos/starter/starter_cmd.cc
index 65861e1..b4d80d8 100644
--- a/aos/starter/starter_cmd.cc
+++ b/aos/starter/starter_cmd.cc
@@ -13,7 +13,7 @@
#include "gflags/gflags.h"
#include "starter_rpc_lib.h"
-DEFINE_string(config, "./config.json", "File path of aos configuration");
+DEFINE_string(config, "./aos_config.json", "File path of aos configuration");
// TODO(james): Bash autocompletion for node names.
DEFINE_string(
node, "",
diff --git a/aos/starter/starterd.cc b/aos/starter/starterd.cc
index a5a340a..941f5df 100644
--- a/aos/starter/starterd.cc
+++ b/aos/starter/starterd.cc
@@ -5,7 +5,7 @@
#include "gflags/gflags.h"
#include "starterd_lib.h"
-DEFINE_string(config, "./config.json", "File path of aos configuration");
+DEFINE_string(config, "./aos_config.json", "File path of aos configuration");
DEFINE_string(user, "",
"Starter runs as though this user ran a SUID binary if set.");
diff --git a/frc971/analysis/BUILD b/frc971/analysis/BUILD
index 0c87ef4..f86bc6d 100644
--- a/frc971/analysis/BUILD
+++ b/frc971/analysis/BUILD
@@ -131,7 +131,7 @@
src = "plotter_config.json",
flatbuffers = [":plot_data_fbs"],
target_compatible_with = ["@platforms//os:linux"],
- deps = ["//aos/events:config"],
+ deps = ["//aos/events:aos_config"],
)
cc_library(
diff --git a/frc971/autonomous/BUILD b/frc971/autonomous/BUILD
index 9698ed6..58dce60 100644
--- a/frc971/autonomous/BUILD
+++ b/frc971/autonomous/BUILD
@@ -46,7 +46,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "autonomous_config.json",
flatbuffers = [
"//aos/actions:actions_fbs",
diff --git a/frc971/codelab/BUILD b/frc971/codelab/BUILD
index 673e0b2..4e1da3d 100644
--- a/frc971/codelab/BUILD
+++ b/frc971/codelab/BUILD
@@ -7,7 +7,7 @@
name = "basic_test",
testonly = 1,
srcs = ["basic_test.cc"],
- data = [":config"],
+ data = [":aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":basic",
@@ -74,7 +74,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "codelab.json",
flatbuffers = [
":basic_goal_fbs",
@@ -84,6 +84,6 @@
],
target_compatible_with = ["@platforms//os:linux"],
deps = [
- "//frc971/input:config",
+ "//frc971/input:aos_config",
],
)
diff --git a/frc971/codelab/basic_test.cc b/frc971/codelab/basic_test.cc
index dc80988..6f8e6cc 100644
--- a/frc971/codelab/basic_test.cc
+++ b/frc971/codelab/basic_test.cc
@@ -93,7 +93,7 @@
public:
BasicControlLoopTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("frc971/codelab/config.json"),
+ aos::configuration::ReadConfig("frc971/codelab/aos_config.json"),
chrono::microseconds(5050)),
test_event_loop_(MakeEventLoop("test")),
goal_sender_(test_event_loop_->MakeSender<Goal>("/codelab")),
diff --git a/frc971/config/robotCommand b/frc971/config/robotCommand
index 7b726a7..cb1d6f1 100755
--- a/frc971/config/robotCommand
+++ b/frc971/config/robotCommand
@@ -1 +1 @@
-/home/admin/robot_code/starter.sh
+/home/admin/bin/starter.sh
diff --git a/frc971/config/setup_roborio.sh b/frc971/config/setup_roborio.sh
index f00212f..3434482 100755
--- a/frc971/config/setup_roborio.sh
+++ b/frc971/config/setup_roborio.sh
@@ -30,11 +30,11 @@
ssh "admin@${ROBOT_HOSTNAME}" 'echo "alias l=\"ls -la\"" >> /etc/profile'
echo "Adding symbolic link to loging directory"
ssh "admin@${ROBOT_HOSTNAME}" ln -s /media/sda1 logs
- ssh "admin@${ROBOT_HOSTNAME}" mkdir robot_code
- ssh "admin@${ROBOT_HOSTNAME}" ln -s /media/sda1/aos_log-current robot_code/aos_log-current
+ ssh "admin@${ROBOT_HOSTNAME}" mkdir bin
+ ssh "admin@${ROBOT_HOSTNAME}" ln -s /media/sda1/aos_log-current bin/aos_log-current
echo "Adding aos_dump autocomplete to profile"
- ssh "admin@${ROBOT_HOSTNAME}" 'echo "if [ -f /home/admin/robot_code/aos_dump_autocomplete.sh ]; then source /home/admin/robot_code/aos_dump_autocomplete.sh; fi;" >> /etc/profile'
- ssh "admin@${ROBOT_HOSTNAME}" 'echo "export PATH=\"\${PATH}:/home/admin/robot_code:/home/admin/bin\"" >> /etc/profile'
+ ssh "admin@${ROBOT_HOSTNAME}" 'echo "if [ -f /home/admin/bin/aos_dump_autocomplete.sh ]; then source /home/admin/bin/aos_dump_autocomplete.sh; fi;" >> /etc/profile'
+ ssh "admin@${ROBOT_HOSTNAME}" 'echo "export PATH=\"\${PATH}:/home/admin/bin\"" >> /etc/profile'
fi
ssh "admin@${ROBOT_HOSTNAME}" "sed -i 's/vm\.overcommit_memory=2/vm\.overcommit_memory=0/' /etc/sysctl.conf"
diff --git a/frc971/control_loops/drivetrain/BUILD b/frc971/control_loops/drivetrain/BUILD
index 6d48192..9eb13ef 100644
--- a/frc971/control_loops/drivetrain/BUILD
+++ b/frc971/control_loops/drivetrain/BUILD
@@ -136,13 +136,13 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- ":config",
+ ":aos_config",
":simulation_channels",
],
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "drivetrain_config.json",
flatbuffers = [
":drivetrain_goal_fbs",
@@ -160,7 +160,7 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//frc971/input:config",
+ "//frc971/input:aos_config",
],
)
diff --git a/frc971/downloader.bzl b/frc971/downloader.bzl
index aebcb87..ec93f5b 100644
--- a/frc971/downloader.bzl
+++ b/frc971/downloader.bzl
@@ -25,7 +25,7 @@
] if target_type == "roborio" else []) + start_binaries,
srcs = [
"//aos:prime_binaries",
- ] + binaries + data,
+ ] + binaries + data + ["//frc971/raspi/rootfs:chrt.sh"],
dirs = dirs,
target_type = target_type,
default_target = default_target,
@@ -40,7 +40,7 @@
[expand_label(binary) + ".stripped" for binary in start_binaries],
srcs = [
"//aos:prime_binaries_stripped",
- ] + [expand_label(binary) + ".stripped" for binary in binaries] + data,
+ ] + [expand_label(binary) + ".stripped" for binary in binaries] + data + ["//frc971/raspi/rootfs:chrt.sh"],
dirs = dirs,
target_type = target_type,
default_target = default_target,
diff --git a/frc971/downloader/downloader.py b/frc971/downloader/downloader.py
index dc14df1..4314845 100644
--- a/frc971/downloader/downloader.py
+++ b/frc971/downloader/downloader.py
@@ -69,7 +69,7 @@
user = "pi"
elif args.type == "roborio":
user = "admin"
- target_dir = "/home/" + user + "/robot_code"
+ target_dir = "/home/" + user + "/bin"
ssh_target = "%s@%s" % (user, hostname)
diff --git a/frc971/input/BUILD b/frc971/input/BUILD
index 90e5ce6..ddb1f43 100644
--- a/frc971/input/BUILD
+++ b/frc971/input/BUILD
@@ -89,7 +89,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "robot_state_config.json",
flatbuffers = [
":joystick_state_fbs",
@@ -97,5 +97,5 @@
],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
- deps = ["//aos/events:config"],
+ deps = ["//aos/events:aos_config"],
)
diff --git a/frc971/raspi/rootfs/BUILD b/frc971/raspi/rootfs/BUILD
new file mode 100644
index 0000000..ee5984a
--- /dev/null
+++ b/frc971/raspi/rootfs/BUILD
@@ -0,0 +1 @@
+exports_files(["chrt.sh"])
diff --git a/frc971/raspi/rootfs/chrt.sh b/frc971/raspi/rootfs/chrt.sh
new file mode 100755
index 0000000..535f4c6
--- /dev/null
+++ b/frc971/raspi/rootfs/chrt.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -e
+
+function chrtirq() {
+ PIDS="$(ps -ef | grep "\\[$1\\]" | awk '{print $2}')"
+
+ for PID in $PIDS; do
+ chrt $2 -p $3 "${PID}"
+
+ ps -q "${PID}" -o comm= | tr -d '[:space:]'
+ echo -n " "
+ chrt -p "${PID}"
+ done
+
+ if [ -z "${PID}" ]; then
+ echo "No such IRQ ${1}"
+ fi
+}
+
+chrtirq "irq/[0-9]*-fe00b880" -f 50
+chrtirq "irq/[0-9]*-fe204000" -f 60
+chrtirq "irq/[0-9]*-adis1650" -f 61
+chrtirq "irq/[0-9]*-xhci_hcd" -f 1
+chrtirq "irq/[0-9]*-VCHIQ do" -o 0
+chrtirq "irq/[0-9]*-DMA IRQ" -f 50
+chrtirq "irq/[0-9]*-mmc1" -o 0
+chrtirq "irq/[0-9]*-mmc0" -o 0
+chrtirq "irq/[0-9]*-s-mmc0" -o 0
+chrtirq "irq/[0-9]*-v3d" -o 0
+chrtirq "irq/24-vc4 hvs" -o 0
+chrtirq "irq/[0-9]*-vc4 hdmi" -o 0
+chrtirq "irq/[0-9]*-s-vc4 hd" -o 0
+chrtirq "irq/19-fe004000" -f 50
+chrtirq "irq/[0-9]*-vc4 crtc" -o 0
+chrtirq "irq/23-uart-pl0" -o 0
+chrtirq "irq/[0-9]*-eth0" -f 10
diff --git a/frc971/raspi/rootfs/enable_imu.sh b/frc971/raspi/rootfs/enable_imu.sh
new file mode 100755
index 0000000..3725207
--- /dev/null
+++ b/frc971/raspi/rootfs/enable_imu.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+CONFIG=/boot/config.txt
+
+if grep -q adis16505 "${CONFIG}"; then
+ echo "Already enabled"
+ exit 0;
+fi
+
+sed -i '1h;1!H;$!d;x;s/.*dtparam=spi[^\n]*/&\n\n# Enable the IMU\ndtoverlay=adis16505/' "${CONFIG}"
+
+echo "Enabled 16505"
diff --git a/frc971/raspi/rootfs/frc971.service b/frc971/raspi/rootfs/frc971.service
index cdfb347..be6b37f 100644
--- a/frc971/raspi/rootfs/frc971.service
+++ b/frc971/raspi/rootfs/frc971.service
@@ -7,8 +7,8 @@
User=pi
Group=pi
Type=simple
-WorkingDirectory=/home/pi/robot_code
-ExecStart=/home/pi/robot_code/starter.sh
+WorkingDirectory=/home/pi/bin
+ExecStart=/home/pi/bin/starter.sh
KillMode=mixed
TimeoutStopSec=10
LimitRTPRIO=60
diff --git a/frc971/raspi/rootfs/frc971chrt.service b/frc971/raspi/rootfs/frc971chrt.service
index cc68934..6086fa0 100644
--- a/frc971/raspi/rootfs/frc971chrt.service
+++ b/frc971/raspi/rootfs/frc971chrt.service
@@ -3,7 +3,7 @@
[Service]
Type=oneshot
-ExecStart=/home/pi/robot_code/chrt.sh
+ExecStart=/home/pi/bin/chrt.sh
[Install]
WantedBy=multi-user.target
diff --git a/frc971/raspi/rootfs/modify_rootfs.sh b/frc971/raspi/rootfs/modify_rootfs.sh
index fd9bec9..15bdd80 100755
--- a/frc971/raspi/rootfs/modify_rootfs.sh
+++ b/frc971/raspi/rootfs/modify_rootfs.sh
@@ -36,8 +36,13 @@
if ! grep "gpu_mem=128" "${BOOT_PARTITION}/config.txt"; then
echo "gpu_mem=128" | sudo tee -a "${BOOT_PARTITION}/config.txt"
fi
+if ! grep "enable_uart=1" "${BOOT_PARTITION}/config.txt"; then
+ echo "enable_uart=1" | sudo tee -a "${BOOT_PARTITION}/config.txt"
+fi
# For now, disable the new libcamera driver in favor of legacy ones
sudo sed -i s/^camera_auto_detect=1/#camera_auto_detect=1/ "${BOOT_PARTITION}/config.txt"
+# Enable SPI.
+sudo sed -i s/^.*dtparam=spi=on/dtparam=spi=on/ "${BOOT_PARTITION}/config.txt"
sudo tar -zxvf "${KERNEL}" --strip-components 2 -C ${BOOT_PARTITION}/ ./fat32
@@ -80,11 +85,17 @@
sudo mount -o loop,offset=${OFFSET} "${IMAGE}" "${PARTITION}"
fi
+if [[ ! -e wiringpi-2.70-1.deb ]]; then
+ wget --continue https://software.frc971.org/Build-Dependencies/wiringpi-2.70-1.deb
+fi
+
sudo cp target_configure.sh "${PARTITION}/tmp/"
+sudo cp wiringpi-2.70-1.deb "${PARTITION}/tmp/"
sudo cp dhcpcd.conf "${PARTITION}/tmp/dhcpcd.conf"
sudo cp sctp.conf "${PARTITION}/etc/sysctl.d/sctp.conf"
sudo cp logind.conf "${PARTITION}/etc/systemd/logind.conf"
sudo cp change_hostname.sh "${PARTITION}/tmp/change_hostname.sh"
+sudo cp enable_imu.sh "${PARTITION}/tmp/"
sudo cp frc971.service "${PARTITION}/etc/systemd/system/frc971.service"
sudo cp frc971chrt.service "${PARTITION}/etc/systemd/system/frc971chrt.service"
sudo cp rt.conf "${PARTITION}/etc/security/limits.d/rt.conf"
@@ -96,6 +107,8 @@
sudo rm -rf "${PARTITION}/lib/modules/"*
sudo tar -zxvf "${KERNEL}" --strip-components 4 -C "${PARTITION}/lib/modules/" ./ext4/lib/modules/
+sudo cp adis16505.ko "${PARTITION}/lib/modules/5.10.78-rt55-v8+/kernel/"
+target /usr/sbin/depmod 5.10.78-rt55-v8+
# Downloads and installs our target libraries
target /bin/bash /tmp/target_configure.sh
diff --git a/frc971/raspi/rootfs/target_configure.sh b/frc971/raspi/rootfs/target_configure.sh
index 6d9171e..388d291 100755
--- a/frc971/raspi/rootfs/target_configure.sh
+++ b/frc971/raspi/rootfs/target_configure.sh
@@ -9,9 +9,12 @@
# And provide a script to change it.
cp /tmp/change_hostname.sh /root/bin/
+cp /tmp/enable_imu.sh /root/bin/
chmod a+x /root/bin/change_hostname.sh
+chmod a+x /root/bin/enable_imu.sh
chown -R pi.pi /home/pi/.ssh
+chown -R pi.pi /home/pi/bin
apt-get update
@@ -41,13 +44,7 @@
libnice-dev \
feh
-# Install WiringPi gpio for PWM control
-if [[ ! -e "/usr/bin/gpio" ]]; then
- cd /tmp
- git clone https://github.com/WiringPi/WiringPi.git
- cd WiringPi
- ./build
-fi
+dpkg -i /tmp/wiringpi-2.70-1.deb
echo 'GOVERNOR="performance"' > /etc/default/cpufrequtils
diff --git a/frc971/wpilib/BUILD b/frc971/wpilib/BUILD
index b6e30d8..1d8f1c1 100644
--- a/frc971/wpilib/BUILD
+++ b/frc971/wpilib/BUILD
@@ -135,7 +135,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "wpilib_config.json",
flatbuffers = [
":pdp_values_fbs",
@@ -152,7 +152,7 @@
],
target_compatible_with = ["@platforms//os:linux"],
deps = [
- "//aos/events:config",
+ "//aos/events:aos_config",
],
)
diff --git a/third_party/BUILD b/third_party/BUILD
index cff81fd..8dbb529 100644
--- a/third_party/BUILD
+++ b/third_party/BUILD
@@ -24,6 +24,10 @@
cc_library(
name = "phoenix",
+ linkopts = [
+ "-Wl,-rpath",
+ "-Wl,.",
+ ],
target_compatible_with = ["//tools/platforms/hardware:roborio"],
visibility = ["//visibility:public"],
deps = [
diff --git a/third_party/gperftools/BUILD b/third_party/gperftools/BUILD
index 2022ee6..14ac821 100644
--- a/third_party/gperftools/BUILD
+++ b/third_party/gperftools/BUILD
@@ -32,6 +32,8 @@
"-Wno-switch-enum",
"-Wno-error=cast-align",
"-Wno-error=cast-qual",
+ "-Wno-deprecated-volatile",
+ "-Wno-cast-qual",
# //build_tests:tcmalloc_build_test relies on this.
"-DENABLE_LARGE_ALLOC_REPORT=1",
diff --git a/y2014/BUILD b/y2014/BUILD
index cb718a6..5be5cfa 100644
--- a/y2014/BUILD
+++ b/y2014/BUILD
@@ -76,7 +76,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "y2014.json",
flatbuffers = [
"//y2014/control_loops/shooter:shooter_goal_fbs",
@@ -91,8 +91,8 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
],
)
diff --git a/y2014/actors/autonomous_actor_main.cc b/y2014/actors/autonomous_actor_main.cc
index 1a3b97e..2566fe8 100644
--- a/y2014/actors/autonomous_actor_main.cc
+++ b/y2014/actors/autonomous_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2014::actors::AutonomousActor autonomous(&event_loop);
diff --git a/y2014/actors/shoot_actor_main.cc b/y2014/actors/shoot_actor_main.cc
index ac34356..379361d 100644
--- a/y2014/actors/shoot_actor_main.cc
+++ b/y2014/actors/shoot_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2014::actors::ShootActor shoot(&event_loop);
diff --git a/y2014/control_loops/claw/BUILD b/y2014/control_loops/claw/BUILD
index 21be558..7c530e8 100644
--- a/y2014/control_loops/claw/BUILD
+++ b/y2014/control_loops/claw/BUILD
@@ -89,7 +89,7 @@
srcs = [
"claw_lib_test.cc",
],
- data = ["//y2014:config"],
+ data = ["//y2014:aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":claw_goal_fbs",
diff --git a/y2014/control_loops/claw/claw_lib_test.cc b/y2014/control_loops/claw/claw_lib_test.cc
index a714124..3a5fdc5 100644
--- a/y2014/control_loops/claw/claw_lib_test.cc
+++ b/y2014/control_loops/claw/claw_lib_test.cc
@@ -293,7 +293,7 @@
protected:
ClawTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("y2014/config.json"),
+ aos::configuration::ReadConfig("y2014/aos_config.json"),
chrono::microseconds(5000)),
test_event_loop_(MakeEventLoop("test")),
claw_goal_sender_(test_event_loop_->MakeSender<Goal>("/claw")),
diff --git a/y2014/control_loops/claw/claw_main.cc b/y2014/control_loops/claw/claw_main.cc
index 4cffa44..16803cf 100644
--- a/y2014/control_loops/claw/claw_main.cc
+++ b/y2014/control_loops/claw/claw_main.cc
@@ -7,7 +7,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2014::control_loops::claw::ClawMotor claw(&event_loop);
diff --git a/y2014/control_loops/drivetrain/drivetrain_main.cc b/y2014/control_loops/drivetrain/drivetrain_main.cc
index 19b8e70..3f3eb52 100644
--- a/y2014/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2014/control_loops/drivetrain/drivetrain_main.cc
@@ -11,7 +11,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::frc971::control_loops::drivetrain::DeadReckonEkf localizer(
diff --git a/y2014/control_loops/shooter/BUILD b/y2014/control_loops/shooter/BUILD
index f3093ea..7552462 100644
--- a/y2014/control_loops/shooter/BUILD
+++ b/y2014/control_loops/shooter/BUILD
@@ -90,7 +90,7 @@
srcs = [
"shooter_lib_test.cc",
],
- data = ["//y2014:config"],
+ data = ["//y2014:aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":shooter_goal_fbs",
diff --git a/y2014/control_loops/shooter/shooter_lib_test.cc b/y2014/control_loops/shooter/shooter_lib_test.cc
index f7dcf20..7fd0fbf 100644
--- a/y2014/control_loops/shooter/shooter_lib_test.cc
+++ b/y2014/control_loops/shooter/shooter_lib_test.cc
@@ -331,7 +331,7 @@
protected:
ShooterTestTemplated()
: ::frc971::testing::ControlLoopTestTemplated<TestType>(
- aos::configuration::ReadConfig("y2014/config.json"),
+ aos::configuration::ReadConfig("y2014/aos_config.json"),
// TODO(austin): I think this runs at 5 ms in real life.
chrono::microseconds(5000)),
test_event_loop_(this->MakeEventLoop("test")),
diff --git a/y2014/control_loops/shooter/shooter_main.cc b/y2014/control_loops/shooter/shooter_main.cc
index be3fd41..c2817d1 100644
--- a/y2014/control_loops/shooter/shooter_main.cc
+++ b/y2014/control_loops/shooter/shooter_main.cc
@@ -7,7 +7,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2014::control_loops::shooter::ShooterMotor shooter(&event_loop);
diff --git a/y2014/hot_goal_reader.cc b/y2014/hot_goal_reader.cc
index 71380f4..16a5840 100644
--- a/y2014/hot_goal_reader.cc
+++ b/y2014/hot_goal_reader.cc
@@ -17,7 +17,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop shm_event_loop(&config.message());
diff --git a/y2014/joystick_reader.cc b/y2014/joystick_reader.cc
index fc78994..4fc3229 100644
--- a/y2014/joystick_reader.cc
+++ b/y2014/joystick_reader.cc
@@ -451,7 +451,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2014::input::joysticks::Reader reader(&event_loop);
diff --git a/y2014/wpilib_interface.cc b/y2014/wpilib_interface.cc
index 9f8e2ce..b27e381 100644
--- a/y2014/wpilib_interface.cc
+++ b/y2014/wpilib_interface.cc
@@ -670,7 +670,7 @@
void Run() override {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
// Thread 1.
::aos::ShmEventLoop joystick_sender_event_loop(&config.message());
diff --git a/y2014_bot3/actors/autonomous_actor_main.cc b/y2014_bot3/actors/autonomous_actor_main.cc
index d8205cd..bdc6353 100644
--- a/y2014_bot3/actors/autonomous_actor_main.cc
+++ b/y2014_bot3/actors/autonomous_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2014_bot3::actors::AutonomousActor autonomous(&event_loop);
diff --git a/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc b/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc
index 7c1486d..0d75499 100644
--- a/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc
@@ -11,7 +11,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::frc971::control_loops::drivetrain::DeadReckonEkf localizer(
diff --git a/y2014_bot3/control_loops/rollers/rollers_main.cc b/y2014_bot3/control_loops/rollers/rollers_main.cc
index 6caf886..c17caa9 100644
--- a/y2014_bot3/control_loops/rollers/rollers_main.cc
+++ b/y2014_bot3/control_loops/rollers/rollers_main.cc
@@ -7,7 +7,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2014_bot3::control_loops::rollers::Rollers rollers(&event_loop);
diff --git a/y2014_bot3/joystick_reader.cc b/y2014_bot3/joystick_reader.cc
index 5c27247..9b25c37 100644
--- a/y2014_bot3/joystick_reader.cc
+++ b/y2014_bot3/joystick_reader.cc
@@ -142,7 +142,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2014_bot3::input::joysticks::Reader reader(&event_loop);
diff --git a/y2014_bot3/wpilib_interface.cc b/y2014_bot3/wpilib_interface.cc
index 2c7c521..22d372e 100644
--- a/y2014_bot3/wpilib_interface.cc
+++ b/y2014_bot3/wpilib_interface.cc
@@ -291,7 +291,7 @@
}
void Run() override {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
// Thread 1.
::aos::ShmEventLoop joystick_sender_event_loop(&config.message());
diff --git a/y2016/BUILD b/y2016/BUILD
index 260a305..ed3256f 100644
--- a/y2016/BUILD
+++ b/y2016/BUILD
@@ -55,7 +55,7 @@
robot_downloader(
data = [
- ":config",
+ ":aos_config",
],
dirs = [
"//y2016/dashboard:www_files",
@@ -76,7 +76,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "y2016.json",
flatbuffers = [
"//y2016/control_loops/shooter:shooter_goal_fbs",
@@ -96,10 +96,10 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//frc971/autonomous:config",
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
- "//frc971/wpilib:config",
+ "//frc971/autonomous:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
+ "//frc971/wpilib:aos_config",
],
)
diff --git a/y2016/actors/autonomous_actor_main.cc b/y2016/actors/autonomous_actor_main.cc
index 4dc2721..ad68bd1 100644
--- a/y2016/actors/autonomous_actor_main.cc
+++ b/y2016/actors/autonomous_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2016::actors::AutonomousActor autonomous(&event_loop);
diff --git a/y2016/actors/superstructure_actor_main.cc b/y2016/actors/superstructure_actor_main.cc
index 46c3b55..58b5e8e 100644
--- a/y2016/actors/superstructure_actor_main.cc
+++ b/y2016/actors/superstructure_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2016::actors::SuperstructureActor superstructure(&event_loop);
diff --git a/y2016/actors/vision_align_actor_main.cc b/y2016/actors/vision_align_actor_main.cc
index 37c3183..1cd7aff 100644
--- a/y2016/actors/vision_align_actor_main.cc
+++ b/y2016/actors/vision_align_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2016::actors::VisionAlignActor vision_align(&event_loop);
diff --git a/y2016/control_loops/drivetrain/drivetrain_main.cc b/y2016/control_loops/drivetrain/drivetrain_main.cc
index 7edcde5..7e44ecb 100644
--- a/y2016/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2016/control_loops/drivetrain/drivetrain_main.cc
@@ -11,7 +11,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::frc971::control_loops::drivetrain::DeadReckonEkf localizer(
diff --git a/y2016/control_loops/shooter/BUILD b/y2016/control_loops/shooter/BUILD
index 5205adb..6f8d7e1 100644
--- a/y2016/control_loops/shooter/BUILD
+++ b/y2016/control_loops/shooter/BUILD
@@ -94,7 +94,7 @@
srcs = [
"shooter_lib_test.cc",
],
- data = ["//y2016:config"],
+ data = ["//y2016:aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":shooter_goal_fbs",
diff --git a/y2016/control_loops/shooter/shooter_lib_test.cc b/y2016/control_loops/shooter/shooter_lib_test.cc
index 46b96c0..1ae51fb 100644
--- a/y2016/control_loops/shooter/shooter_lib_test.cc
+++ b/y2016/control_loops/shooter/shooter_lib_test.cc
@@ -118,7 +118,7 @@
protected:
ShooterTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("y2016/config.json"),
+ aos::configuration::ReadConfig("y2016/aos_config.json"),
chrono::microseconds(5000)),
test_event_loop_(MakeEventLoop("test")),
shooter_goal_fetcher_(test_event_loop_->MakeFetcher<Goal>("/shooter")),
diff --git a/y2016/control_loops/shooter/shooter_main.cc b/y2016/control_loops/shooter/shooter_main.cc
index 2e47a6f..0c88ba8 100644
--- a/y2016/control_loops/shooter/shooter_main.cc
+++ b/y2016/control_loops/shooter/shooter_main.cc
@@ -7,7 +7,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2016::control_loops::shooter::Shooter shooter(&event_loop);
diff --git a/y2016/control_loops/superstructure/BUILD b/y2016/control_loops/superstructure/BUILD
index 5f18405..3c6a771 100644
--- a/y2016/control_loops/superstructure/BUILD
+++ b/y2016/control_loops/superstructure/BUILD
@@ -130,7 +130,7 @@
srcs = [
"superstructure_lib_test.cc",
],
- data = ["//y2016:config"],
+ data = ["//y2016:aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":superstructure_goal_fbs",
diff --git a/y2016/control_loops/superstructure/superstructure_lib_test.cc b/y2016/control_loops/superstructure/superstructure_lib_test.cc
index 12ef0a2..c5e71c5 100644
--- a/y2016/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2016/control_loops/superstructure/superstructure_lib_test.cc
@@ -353,7 +353,7 @@
protected:
SuperstructureTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("y2016/config.json"),
+ aos::configuration::ReadConfig("y2016/aos_config.json"),
chrono::microseconds(5000)),
test_event_loop_(MakeEventLoop("test")),
superstructure_goal_fetcher_(
diff --git a/y2016/control_loops/superstructure/superstructure_main.cc b/y2016/control_loops/superstructure/superstructure_main.cc
index ea871f2..ff25ae1 100644
--- a/y2016/control_loops/superstructure/superstructure_main.cc
+++ b/y2016/control_loops/superstructure/superstructure_main.cc
@@ -7,7 +7,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2016::control_loops::superstructure::Superstructure superstructure(
diff --git a/y2016/dashboard/dashboard.cc b/y2016/dashboard/dashboard.cc
index b16c66e..a7cc821 100644
--- a/y2016/dashboard/dashboard.cc
+++ b/y2016/dashboard/dashboard.cc
@@ -286,7 +286,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
@@ -301,7 +301,7 @@
server.serve("www", 1180);
#else
// Absolute directory of www folder on the robot.
- server.serve("/home/admin/robot_code/www", 1180);
+ server.serve("/home/admin/bin/www", 1180);
#endif
socket_handler.Quit();
diff --git a/y2016/joystick_reader.cc b/y2016/joystick_reader.cc
index b235f64..3daecce 100644
--- a/y2016/joystick_reader.cc
+++ b/y2016/joystick_reader.cc
@@ -466,7 +466,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2016::input::joysticks::Reader reader(&event_loop);
diff --git a/y2016/vision/target_receiver.cc b/y2016/vision/target_receiver.cc
index 75a07a8..701f7e8 100644
--- a/y2016/vision/target_receiver.cc
+++ b/y2016/vision/target_receiver.cc
@@ -299,7 +299,7 @@
void Main() {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
diff --git a/y2016/wpilib_interface.cc b/y2016/wpilib_interface.cc
index 0419950..b658573 100644
--- a/y2016/wpilib_interface.cc
+++ b/y2016/wpilib_interface.cc
@@ -605,7 +605,7 @@
void Run() override {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
// Thread 1.
::aos::ShmEventLoop joystick_sender_event_loop(&config.message());
diff --git a/y2017/BUILD b/y2017/BUILD
index df1fd4b..a557815 100644
--- a/y2017/BUILD
+++ b/y2017/BUILD
@@ -49,7 +49,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "y2017.json",
flatbuffers = [
"//y2017/control_loops/superstructure:superstructure_goal_fbs",
@@ -61,8 +61,8 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
],
)
diff --git a/y2017/actors/autonomous_actor_main.cc b/y2017/actors/autonomous_actor_main.cc
index ae13d15..81f1507 100644
--- a/y2017/actors/autonomous_actor_main.cc
+++ b/y2017/actors/autonomous_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2017::actors::AutonomousActor autonomous(&event_loop);
diff --git a/y2017/control_loops/drivetrain/drivetrain_main.cc b/y2017/control_loops/drivetrain/drivetrain_main.cc
index 4db7b95..843349c 100644
--- a/y2017/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2017/control_loops/drivetrain/drivetrain_main.cc
@@ -11,7 +11,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::frc971::control_loops::drivetrain::DeadReckonEkf localizer(
diff --git a/y2017/control_loops/superstructure/BUILD b/y2017/control_loops/superstructure/BUILD
index 5481aa0..b974b15 100644
--- a/y2017/control_loops/superstructure/BUILD
+++ b/y2017/control_loops/superstructure/BUILD
@@ -78,7 +78,7 @@
srcs = [
"superstructure_lib_test.cc",
],
- data = ["//y2017:config"],
+ data = ["//y2017:aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":superstructure_goal_fbs",
@@ -136,7 +136,7 @@
srcs = [
"vision_time_adjuster_test.cc",
],
- data = ["//y2017:config"],
+ data = ["//y2017:aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":vision_time_adjuster",
diff --git a/y2017/control_loops/superstructure/superstructure_lib_test.cc b/y2017/control_loops/superstructure/superstructure_lib_test.cc
index 05ca333..2c97475 100644
--- a/y2017/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2017/control_loops/superstructure/superstructure_lib_test.cc
@@ -521,7 +521,7 @@
protected:
SuperstructureTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("y2017/config.json"),
+ aos::configuration::ReadConfig("y2017/aos_config.json"),
chrono::microseconds(5050)),
test_event_loop_(MakeEventLoop("test")),
superstructure_goal_fetcher_(
diff --git a/y2017/control_loops/superstructure/superstructure_main.cc b/y2017/control_loops/superstructure/superstructure_main.cc
index 1a8627c..f113477 100644
--- a/y2017/control_loops/superstructure/superstructure_main.cc
+++ b/y2017/control_loops/superstructure/superstructure_main.cc
@@ -7,7 +7,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2017::control_loops::superstructure::Superstructure superstructure(
diff --git a/y2017/control_loops/superstructure/vision_time_adjuster_test.cc b/y2017/control_loops/superstructure/vision_time_adjuster_test.cc
index 49e4460..66c3627 100644
--- a/y2017/control_loops/superstructure/vision_time_adjuster_test.cc
+++ b/y2017/control_loops/superstructure/vision_time_adjuster_test.cc
@@ -17,7 +17,7 @@
public:
VisionTimeAdjusterTest()
: ::testing::Test(),
- configuration_(aos::configuration::ReadConfig("y2017/config.json")),
+ configuration_(aos::configuration::ReadConfig("y2017/aos_config.json")),
event_loop_factory_(&configuration_.message()),
simulation_event_loop_(event_loop_factory_.MakeEventLoop("drivetrain")),
drivetrain_status_sender_(
diff --git a/y2017/joystick_reader.cc b/y2017/joystick_reader.cc
index cb21d3e..fd8dc38 100644
--- a/y2017/joystick_reader.cc
+++ b/y2017/joystick_reader.cc
@@ -326,7 +326,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2017::input::joysticks::Reader reader(&event_loop);
diff --git a/y2017/vision/target_receiver.cc b/y2017/vision/target_receiver.cc
index ba09425..f21fe4e 100644
--- a/y2017/vision/target_receiver.cc
+++ b/y2017/vision/target_receiver.cc
@@ -20,7 +20,7 @@
// TODO(parker): Have this pull in a config from somewhere.
TargetFinder finder;
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
diff --git a/y2017/wpilib_interface.cc b/y2017/wpilib_interface.cc
index 6a4596e..d299c1d 100644
--- a/y2017/wpilib_interface.cc
+++ b/y2017/wpilib_interface.cc
@@ -474,7 +474,7 @@
void Run() override {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
// Thread 1.
::aos::ShmEventLoop joystick_sender_event_loop(&config.message());
diff --git a/y2018/BUILD b/y2018/BUILD
index 9c845fd..ac59493 100644
--- a/y2018/BUILD
+++ b/y2018/BUILD
@@ -118,7 +118,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "y2018.json",
flatbuffers = [
":status_light_fbs",
@@ -131,8 +131,8 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
],
)
diff --git a/y2018/actors/autonomous_actor_main.cc b/y2018/actors/autonomous_actor_main.cc
index 71f115e..f22aa57 100644
--- a/y2018/actors/autonomous_actor_main.cc
+++ b/y2018/actors/autonomous_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2018::actors::AutonomousActor autonomous(&event_loop);
diff --git a/y2018/control_loops/drivetrain/drivetrain_main.cc b/y2018/control_loops/drivetrain/drivetrain_main.cc
index 461fd34..6281b5e 100644
--- a/y2018/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2018/control_loops/drivetrain/drivetrain_main.cc
@@ -11,7 +11,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::frc971::control_loops::drivetrain::DeadReckonEkf localizer(
diff --git a/y2018/control_loops/superstructure/BUILD b/y2018/control_loops/superstructure/BUILD
index 5d64d6e..567810d 100644
--- a/y2018/control_loops/superstructure/BUILD
+++ b/y2018/control_loops/superstructure/BUILD
@@ -79,7 +79,7 @@
srcs = [
"superstructure_lib_test.cc",
],
- data = ["//y2018:config"],
+ data = ["//y2018:aos_config"],
shard_count = 5,
target_compatible_with = ["@platforms//os:linux"],
deps = [
diff --git a/y2018/control_loops/superstructure/superstructure_lib_test.cc b/y2018/control_loops/superstructure/superstructure_lib_test.cc
index c52d8db..285c8c3 100644
--- a/y2018/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2018/control_loops/superstructure/superstructure_lib_test.cc
@@ -313,7 +313,7 @@
protected:
SuperstructureTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("y2018/config.json"),
+ aos::configuration::ReadConfig("y2018/aos_config.json"),
::std::chrono::microseconds(5050)),
test_event_loop_(MakeEventLoop("test")),
superstructure_goal_fetcher_(
diff --git a/y2018/control_loops/superstructure/superstructure_main.cc b/y2018/control_loops/superstructure/superstructure_main.cc
index 25a3448..108cbdf 100644
--- a/y2018/control_loops/superstructure/superstructure_main.cc
+++ b/y2018/control_loops/superstructure/superstructure_main.cc
@@ -7,7 +7,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2018::control_loops::superstructure::Superstructure superstructure(
diff --git a/y2018/joystick_reader.cc b/y2018/joystick_reader.cc
index 3a5ed63..be7be1f 100644
--- a/y2018/joystick_reader.cc
+++ b/y2018/joystick_reader.cc
@@ -394,7 +394,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2018::input::joysticks::Reader reader(&event_loop);
diff --git a/y2018/vision/vision_status.cc b/y2018/vision/vision_status.cc
index ca11dd8..ef3fd5a 100644
--- a/y2018/vision/vision_status.cc
+++ b/y2018/vision/vision_status.cc
@@ -15,7 +15,7 @@
int Main() {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::events::RXUdpSocket video_rx(5001);
char data[65507];
diff --git a/y2018/wpilib_interface.cc b/y2018/wpilib_interface.cc
index 4ee8031..1fd72e8 100644
--- a/y2018/wpilib_interface.cc
+++ b/y2018/wpilib_interface.cc
@@ -706,7 +706,7 @@
void Run() override {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
// Thread 1.
::aos::ShmEventLoop joystick_sender_event_loop(&config.message());
diff --git a/y2019/BUILD b/y2019/BUILD
index 7d4e233..2fba6d6 100644
--- a/y2019/BUILD
+++ b/y2019/BUILD
@@ -5,7 +5,7 @@
robot_downloader(
data = [
- ":config",
+ ":aos_config",
"@ctre_phoenix_api_cpp_athena//:shared_libraries",
"@ctre_phoenix_cci_athena//:shared_libraries",
],
@@ -180,7 +180,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "y2019.json",
flatbuffers = [
":status_light_fbs",
@@ -195,10 +195,10 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//frc971/autonomous:config",
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
- "//frc971/wpilib:config",
+ "//frc971/autonomous:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
+ "//frc971/wpilib:aos_config",
],
)
diff --git a/y2019/actors/autonomous_actor_main.cc b/y2019/actors/autonomous_actor_main.cc
index d04a806..229edd3 100644
--- a/y2019/actors/autonomous_actor_main.cc
+++ b/y2019/actors/autonomous_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2019::actors::AutonomousActor autonomous(&event_loop);
diff --git a/y2019/control_loops/drivetrain/BUILD b/y2019/control_loops/drivetrain/BUILD
index a78eab9..80e9fe6 100644
--- a/y2019/control_loops/drivetrain/BUILD
+++ b/y2019/control_loops/drivetrain/BUILD
@@ -151,7 +151,7 @@
cc_test(
name = "target_selector_test",
srcs = ["target_selector_test.cc"],
- data = ["//y2019:config"],
+ data = ["//y2019:aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":target_selector",
@@ -212,7 +212,7 @@
visibility = ["//visibility:public"],
deps = [
"//frc971/control_loops/drivetrain:simulation_channels",
- "//y2019:config",
+ "//y2019:aos_config",
],
)
@@ -238,7 +238,7 @@
cc_binary(
name = "drivetrain_replay",
srcs = ["drivetrain_replay.cc"],
- data = ["//y2019:config"],
+ data = ["//y2019:aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":drivetrain_base",
diff --git a/y2019/control_loops/drivetrain/drivetrain_main.cc b/y2019/control_loops/drivetrain/drivetrain_main.cc
index a45db0c..5e3185c 100644
--- a/y2019/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2019/control_loops/drivetrain/drivetrain_main.cc
@@ -12,7 +12,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2019::control_loops::drivetrain::EventLoopLocalizer localizer(
diff --git a/y2019/control_loops/drivetrain/drivetrain_replay.cc b/y2019/control_loops/drivetrain/drivetrain_replay.cc
index 97b4c2b..f00002a 100644
--- a/y2019/control_loops/drivetrain/drivetrain_replay.cc
+++ b/y2019/control_loops/drivetrain/drivetrain_replay.cc
@@ -14,7 +14,7 @@
DEFINE_string(logfile, "/tmp/logfile.bfbs",
"Name of the logfile to read from.");
-DEFINE_string(config, "y2019/config.json",
+DEFINE_string(config, "y2019/aos_config.json",
"Name of the config file to replay using.");
DEFINE_string(output_file, "/tmp/replayed",
"Name of the logfile to write replayed data to.");
diff --git a/y2019/control_loops/drivetrain/target_selector_test.cc b/y2019/control_loops/drivetrain/target_selector_test.cc
index f33224b..b60085c 100644
--- a/y2019/control_loops/drivetrain/target_selector_test.cc
+++ b/y2019/control_loops/drivetrain/target_selector_test.cc
@@ -37,7 +37,7 @@
class TargetSelectorParamTest : public ::testing::TestWithParam<TestParams> {
public:
TargetSelectorParamTest()
- : configuration_(aos::configuration::ReadConfig("y2019/config.json")),
+ : configuration_(aos::configuration::ReadConfig("y2019/aos_config.json")),
event_loop_factory_(&configuration_.message()),
event_loop_(this->event_loop_factory_.MakeEventLoop("drivetrain")),
test_event_loop_(this->event_loop_factory_.MakeEventLoop("test")),
diff --git a/y2019/control_loops/drivetrain/trajectory_generator_main.cc b/y2019/control_loops/drivetrain/trajectory_generator_main.cc
index cc3d2bf..8f18222 100644
--- a/y2019/control_loops/drivetrain/trajectory_generator_main.cc
+++ b/y2019/control_loops/drivetrain/trajectory_generator_main.cc
@@ -15,7 +15,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
TrajectoryGenerator generator(
diff --git a/y2019/control_loops/superstructure/BUILD b/y2019/control_loops/superstructure/BUILD
index 6052545..9504c9f 100644
--- a/y2019/control_loops/superstructure/BUILD
+++ b/y2019/control_loops/superstructure/BUILD
@@ -80,7 +80,7 @@
"superstructure_lib_test.cc",
],
data = [
- "//y2019:config",
+ "//y2019:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
deps = [
diff --git a/y2019/control_loops/superstructure/superstructure_lib_test.cc b/y2019/control_loops/superstructure/superstructure_lib_test.cc
index d6b4f2d..4e51086 100644
--- a/y2019/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2019/control_loops/superstructure/superstructure_lib_test.cc
@@ -405,7 +405,7 @@
protected:
SuperstructureTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("y2019/config.json"),
+ aos::configuration::ReadConfig("y2019/aos_config.json"),
chrono::microseconds(5050)),
test_event_loop_(MakeEventLoop("test")),
superstructure_goal_fetcher_(
diff --git a/y2019/control_loops/superstructure/superstructure_main.cc b/y2019/control_loops/superstructure/superstructure_main.cc
index c55ac4b..5dc1542 100644
--- a/y2019/control_loops/superstructure/superstructure_main.cc
+++ b/y2019/control_loops/superstructure/superstructure_main.cc
@@ -7,7 +7,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2019::control_loops::superstructure::Superstructure superstructure(
diff --git a/y2019/joystick_reader.cc b/y2019/joystick_reader.cc
index 51aeffb..ed55dfc 100644
--- a/y2019/joystick_reader.cc
+++ b/y2019/joystick_reader.cc
@@ -678,7 +678,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2019::input::joysticks::Reader reader(&event_loop);
diff --git a/y2019/vision/server/server.cc b/y2019/vision/server/server.cc
index 6d436e9..817da17 100644
--- a/y2019/vision/server/server.cc
+++ b/y2019/vision/server/server.cc
@@ -135,7 +135,7 @@
void DataThread(seasocks::Server *server, WebsocketHandler *websocket_handler) {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
@@ -300,13 +300,13 @@
bool serve_www = false;
{
struct stat result;
- if (stat("/home/admin/robot_code/www", &result) == 0) {
+ if (stat("/home/admin/bin/www", &result) == 0) {
serve_www = true;
}
}
server.serve(
- serve_www ? "/home/admin/robot_code/www" : "y2019/vision/server/www",
+ serve_www ? "/home/admin/bin/www" : "y2019/vision/server/www",
1180);
return 0;
diff --git a/y2019/wpilib_interface.cc b/y2019/wpilib_interface.cc
index f37b86c..09d2225 100644
--- a/y2019/wpilib_interface.cc
+++ b/y2019/wpilib_interface.cc
@@ -744,7 +744,7 @@
void Run() override {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
// Thread 1.
::aos::ShmEventLoop joystick_sender_event_loop(&config.message());
diff --git a/y2020/BUILD b/y2020/BUILD
index 1e0e4d8..918ff79 100644
--- a/y2020/BUILD
+++ b/y2020/BUILD
@@ -9,7 +9,7 @@
"//aos/network:web_proxy_main",
],
data = [
- ":config",
+ ":aos_config",
"@ctre_phoenix_api_cpp_athena//:shared_libraries",
"@ctre_phoenix_cci_athena//:shared_libraries",
],
@@ -39,7 +39,7 @@
"//y2020/vision:viewer",
],
data = [
- ":config",
+ ":aos_config",
],
dirs = [
"//y2020/www:www_files",
@@ -152,7 +152,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "y2020.json",
flatbuffers = [
"//aos/network:message_bridge_client_fbs",
@@ -192,9 +192,9 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//aos/events:config",
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
+ "//aos/events:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
],
)
for pi in [
@@ -221,9 +221,9 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//aos/events:config",
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
+ "//aos/events:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
],
)
@@ -247,11 +247,11 @@
],
target_compatible_with = ["@platforms//os:linux"],
deps = [
- "//aos/events:config",
- "//frc971/autonomous:config",
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
- "//frc971/wpilib:config",
+ "//aos/events:aos_config",
+ "//frc971/autonomous:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
+ "//frc971/wpilib:aos_config",
],
)
@@ -266,7 +266,7 @@
name = "log_web_proxy",
srcs = ["log_web_proxy.sh"],
data = [
- ":config",
+ ":aos_config",
"//aos/network:log_web_proxy_main",
"//y2020/www:camera_main_bundle.min.js",
"//y2020/www:field_main_bundle.min.js",
@@ -279,7 +279,7 @@
name = "web_proxy",
srcs = ["web_proxy.sh"],
data = [
- ":config",
+ ":aos_config",
"//aos/network:web_proxy_main",
"//y2020/www:camera_main_bundle.min.js",
"//y2020/www:field_main_bundle.min.js",
diff --git a/y2020/actors/autonomous_actor_main.cc b/y2020/actors/autonomous_actor_main.cc
index 72384d5..f866064 100644
--- a/y2020/actors/autonomous_actor_main.cc
+++ b/y2020/actors/autonomous_actor_main.cc
@@ -9,7 +9,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2020::constants::InitValues();
diff --git a/y2020/actors/shooter_tuning_actor.cc b/y2020/actors/shooter_tuning_actor.cc
index d18c518..06e78b9 100644
--- a/y2020/actors/shooter_tuning_actor.cc
+++ b/y2020/actors/shooter_tuning_actor.cc
@@ -178,7 +178,7 @@
aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
aos::ShmEventLoop event_loop(&config.message());
y2020::constants::InitValues();
diff --git a/y2020/control_loops/drivetrain/BUILD b/y2020/control_loops/drivetrain/BUILD
index 56ac3a9..f4915da 100644
--- a/y2020/control_loops/drivetrain/BUILD
+++ b/y2020/control_loops/drivetrain/BUILD
@@ -145,7 +145,7 @@
visibility = ["//visibility:public"],
deps = [
"//frc971/control_loops/drivetrain:simulation_channels",
- "//y2020:config",
+ "//y2020:aos_config",
],
)
@@ -172,7 +172,7 @@
name = "drivetrain_replay_test",
srcs = ["drivetrain_replay_test.cc"],
data = [
- "//y2020:config",
+ "//y2020:aos_config",
"@drivetrain_replay",
],
target_compatible_with = ["@platforms//os:linux"],
@@ -195,7 +195,7 @@
cc_binary(
name = "drivetrain_replay",
srcs = ["drivetrain_replay.cc"],
- data = ["//y2020:config"],
+ data = ["//y2020:aos_config"],
target_compatible_with = ["@platforms//os:linux"],
deps = [
":drivetrain_base",
diff --git a/y2020/control_loops/drivetrain/drivetrain_main.cc b/y2020/control_loops/drivetrain/drivetrain_main.cc
index 24c876f..cd8df4d 100644
--- a/y2020/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2020/control_loops/drivetrain/drivetrain_main.cc
@@ -12,7 +12,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
std::unique_ptr<::y2020::control_loops::drivetrain::Localizer> localizer =
diff --git a/y2020/control_loops/drivetrain/drivetrain_replay.cc b/y2020/control_loops/drivetrain/drivetrain_replay.cc
index 40b50ed..d2f2880 100644
--- a/y2020/control_loops/drivetrain/drivetrain_replay.cc
+++ b/y2020/control_loops/drivetrain/drivetrain_replay.cc
@@ -19,7 +19,7 @@
#include "y2020/control_loops/drivetrain/localizer.h"
#include "y2020/control_loops/superstructure/superstructure.h"
-DEFINE_string(config, "y2020/config.json",
+DEFINE_string(config, "y2020/aos_config.json",
"Name of the config file to replay using.");
DEFINE_string(output_folder, "/tmp/replayed",
"Name of the folder to write replayed logs to.");
diff --git a/y2020/control_loops/drivetrain/drivetrain_replay_test.cc b/y2020/control_loops/drivetrain/drivetrain_replay_test.cc
index 297cf5b..08622cb 100644
--- a/y2020/control_loops/drivetrain/drivetrain_replay_test.cc
+++ b/y2020/control_loops/drivetrain/drivetrain_replay_test.cc
@@ -26,7 +26,7 @@
logfile,
"external/drivetrain_replay/",
"Name of the logfile to read from.");
-DEFINE_string(config, "y2020/config.json",
+DEFINE_string(config, "y2020/aos_config.json",
"Name of the config file to replay using.");
namespace y2020 {
diff --git a/y2020/control_loops/drivetrain/trajectory_generator_main.cc b/y2020/control_loops/drivetrain/trajectory_generator_main.cc
index adfa492..152822e 100644
--- a/y2020/control_loops/drivetrain/trajectory_generator_main.cc
+++ b/y2020/control_loops/drivetrain/trajectory_generator_main.cc
@@ -15,7 +15,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
TrajectoryGenerator generator(
diff --git a/y2020/control_loops/superstructure/BUILD b/y2020/control_loops/superstructure/BUILD
index abf24fc..9fa5969 100644
--- a/y2020/control_loops/superstructure/BUILD
+++ b/y2020/control_loops/superstructure/BUILD
@@ -108,7 +108,7 @@
"superstructure_lib_test.cc",
],
data = [
- "//y2020:config",
+ "//y2020:aos_config",
"@superstructure_replay",
],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/y2020/control_loops/superstructure/shooter/shooter_tuning_params_setter.cc b/y2020/control_loops/superstructure/shooter/shooter_tuning_params_setter.cc
index 68bb243..e919aae 100644
--- a/y2020/control_loops/superstructure/shooter/shooter_tuning_params_setter.cc
+++ b/y2020/control_loops/superstructure/shooter/shooter_tuning_params_setter.cc
@@ -34,7 +34,7 @@
aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
aos::ShmEventLoop event_loop(&config.message());
diff --git a/y2020/control_loops/superstructure/superstructure_lib_test.cc b/y2020/control_loops/superstructure/superstructure_lib_test.cc
index e41c421..1bbf42b 100644
--- a/y2020/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2020/control_loops/superstructure/superstructure_lib_test.cc
@@ -23,7 +23,7 @@
"If set, logs all channels to the provided logfile.");
DEFINE_string(replay_logfile, "external/superstructure_replay/",
"Name of the logfile to read from and replay.");
-DEFINE_string(config, "y2020/config.json",
+DEFINE_string(config, "y2020/aos_config.json",
"Name of the config file to replay using.");
namespace y2020 {
@@ -445,7 +445,7 @@
protected:
SuperstructureTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("y2020/config.json"),
+ aos::configuration::ReadConfig("y2020/aos_config.json"),
chrono::microseconds(5050)),
roborio_(aos::configuration::GetNode(configuration(), "roborio")),
test_event_loop_(MakeEventLoop("test", roborio_)),
diff --git a/y2020/control_loops/superstructure/superstructure_main.cc b/y2020/control_loops/superstructure/superstructure_main.cc
index a10237d..88dddf1 100644
--- a/y2020/control_loops/superstructure/superstructure_main.cc
+++ b/y2020/control_loops/superstructure/superstructure_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2020::constants::InitValues();
diff --git a/y2020/joystick_reader.cc b/y2020/joystick_reader.cc
index b610b64..951c5a7 100644
--- a/y2020/joystick_reader.cc
+++ b/y2020/joystick_reader.cc
@@ -340,7 +340,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2020::input::joysticks::Reader reader(&event_loop);
diff --git a/y2020/setpoint_setter.cc b/y2020/setpoint_setter.cc
index e04fe41..0ca67e7 100644
--- a/y2020/setpoint_setter.cc
+++ b/y2020/setpoint_setter.cc
@@ -13,7 +13,7 @@
aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
aos::ShmEventLoop event_loop(&config.message());
diff --git a/y2020/vision/BUILD b/y2020/vision/BUILD
index 75ef7aa..ae4e3f2 100644
--- a/y2020/vision/BUILD
+++ b/y2020/vision/BUILD
@@ -31,7 +31,7 @@
"camera_reader.h",
],
data = [
- "//y2020:config",
+ "//y2020:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//y2020:__subpackages__"] + ["//y2022:__subpackages__"],
@@ -55,7 +55,7 @@
"viewer.cc",
],
data = [
- "//y2020:config",
+ "//y2020:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//y2020:__subpackages__"],
@@ -103,7 +103,7 @@
"calibration.cc",
],
data = [
- "//y2020:config",
+ "//y2020:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
visibility = [
@@ -133,7 +133,7 @@
"viewer_replay.cc",
],
data = [
- "//y2020:config",
+ "//y2020:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//y2020:__subpackages__"],
@@ -154,7 +154,7 @@
"extrinsics_calibration.cc",
],
data = [
- "//y2020:config",
+ "//y2020:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//y2020:__subpackages__"],
diff --git a/y2020/vision/calibration.cc b/y2020/vision/calibration.cc
index 9293d50..0a12d70 100644
--- a/y2020/vision/calibration.cc
+++ b/y2020/vision/calibration.cc
@@ -16,7 +16,7 @@
DEFINE_string(calibration_folder, ".", "Folder to place calibration files.");
DEFINE_string(camera_id, "", "Camera ID in format YY-NN-- year and number.");
-DEFINE_string(config, "config.json", "Path to the config file to use.");
+DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
DEFINE_bool(display_undistorted, false,
"If true, display the undistorted image.");
DEFINE_string(pi, "", "Pi name to calibrate.");
diff --git a/y2020/vision/camera_reader_main.cc b/y2020/vision/camera_reader_main.cc
index c7fec43..b54cf4e 100644
--- a/y2020/vision/camera_reader_main.cc
+++ b/y2020/vision/camera_reader_main.cc
@@ -3,9 +3,9 @@
#include "y2020/vision/camera_reader.h"
// config used to allow running camera_reader independently. E.g.,
-// bazel run //y2020/vision:camera_reader -- --config y2020/config.json
+// bazel run //y2020/vision:camera_reader -- --config y2020/aos_config.json
// --override_hostname pi-7971-1 --ignore_timestamps true
-DEFINE_string(config, "config.json", "Path to the config file to use.");
+DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
namespace frc971 {
namespace vision {
namespace {
diff --git a/y2020/vision/extrinsics_calibration.cc b/y2020/vision/extrinsics_calibration.cc
index f2ac926..5f08527 100644
--- a/y2020/vision/extrinsics_calibration.cc
+++ b/y2020/vision/extrinsics_calibration.cc
@@ -20,7 +20,7 @@
#include "y2020/vision/sift/sift_training_generated.h"
#include "y2020/vision/tools/python_code/sift_training_data.h"
-DEFINE_string(config, "config.json", "Path to the config file to use.");
+DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
DEFINE_string(pi, "pi-7971-2", "Pi name to calibrate.");
DEFINE_bool(plot, false, "Whether to plot the resulting data.");
diff --git a/y2020/vision/galactic_search_path.py b/y2020/vision/galactic_search_path.py
index 5e8ef54..00b572a 100755
--- a/y2020/vision/galactic_search_path.py
+++ b/y2020/vision/galactic_search_path.py
@@ -77,8 +77,8 @@
AOS_SEND_PATH = "bazel-bin/aos/aos_send"
def setup_if_pi():
- if os.path.isdir("/home/pi/robot_code"):
- AOS_SEND_PATH = "/home/pi/robot_code/aos_send.stripped"
+ if os.path.isdir("/home/pi/bin"):
+ AOS_SEND_PATH = "/home/pi/bin/aos_send.stripped"
os.system("./starter_cmd stop camera_reader")
setup_if_pi()
diff --git a/y2020/vision/viewer.cc b/y2020/vision/viewer.cc
index 37ff4a3..d923407 100644
--- a/y2020/vision/viewer.cc
+++ b/y2020/vision/viewer.cc
@@ -12,7 +12,7 @@
#include "frc971/vision/vision_generated.h"
#include "y2020/vision/sift/sift_generated.h"
-DEFINE_string(config, "config.json", "Path to the config file to use.");
+DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
DEFINE_bool(show_features, true, "Show the SIFT features that matched.");
DEFINE_string(channel, "/camera", "Channel name for the image.");
diff --git a/y2020/web_proxy.sh b/y2020/web_proxy.sh
index 8e1a570..16a292a 100755
--- a/y2020/web_proxy.sh
+++ b/y2020/web_proxy.sh
@@ -1 +1 @@
-./aos/network/web_proxy_main --config=y2020/config.json --data_dir=y2020/www
+./aos/network/web_proxy_main --config=y2020/aos_config.json --data_dir=y2020/www
diff --git a/y2020/wpilib_interface.cc b/y2020/wpilib_interface.cc
index f746970..5569550 100644
--- a/y2020/wpilib_interface.cc
+++ b/y2020/wpilib_interface.cc
@@ -556,7 +556,7 @@
void Run() override {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
// Thread 1.
::aos::ShmEventLoop joystick_sender_event_loop(&config.message());
diff --git a/y2021_bot3/BUILD b/y2021_bot3/BUILD
index 07429e0..ea9c3c5 100644
--- a/y2021_bot3/BUILD
+++ b/y2021_bot3/BUILD
@@ -3,7 +3,7 @@
robot_downloader(
data = [
- ":config",
+ ":aos_config",
],
start_binaries = [
":joystick_reader",
@@ -98,7 +98,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "y2021_bot3.json",
flatbuffers = [
"//y2021_bot3/control_loops/superstructure:superstructure_goal_fbs",
@@ -108,9 +108,9 @@
],
visibility = ["//visibility:public"],
deps = [
- "//frc971/autonomous:config",
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
- "//frc971/wpilib:config",
+ "//frc971/autonomous:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
+ "//frc971/wpilib:aos_config",
],
)
diff --git a/y2021_bot3/actors/autonomous_actor_main.cc b/y2021_bot3/actors/autonomous_actor_main.cc
index daf68e0..6521443 100644
--- a/y2021_bot3/actors/autonomous_actor_main.cc
+++ b/y2021_bot3/actors/autonomous_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2021_bot3::actors::AutonomousActor autonomous(&event_loop);
diff --git a/y2021_bot3/control_loops/drivetrain/drivetrain_main.cc b/y2021_bot3/control_loops/drivetrain/drivetrain_main.cc
index f79846e..b4a8532 100644
--- a/y2021_bot3/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2021_bot3/control_loops/drivetrain/drivetrain_main.cc
@@ -11,7 +11,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::frc971::control_loops::drivetrain::DeadReckonEkf localizer(
diff --git a/y2021_bot3/control_loops/superstructure/BUILD b/y2021_bot3/control_loops/superstructure/BUILD
index 8266edc..f5b5b3b 100644
--- a/y2021_bot3/control_loops/superstructure/BUILD
+++ b/y2021_bot3/control_loops/superstructure/BUILD
@@ -84,7 +84,7 @@
"superstructure_lib_test.cc",
],
data = [
- "//y2021_bot3:config",
+ "//y2021_bot3:aos_config",
],
deps = [
":superstructure_goal_fbs",
diff --git a/y2021_bot3/control_loops/superstructure/superstructure_lib_test.cc b/y2021_bot3/control_loops/superstructure/superstructure_lib_test.cc
index e30fa1d..6554361 100644
--- a/y2021_bot3/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2021_bot3/control_loops/superstructure/superstructure_lib_test.cc
@@ -21,7 +21,7 @@
public:
SuperstructureTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("y2021_bot3/config.json"),
+ aos::configuration::ReadConfig("y2021_bot3/aos_config.json"),
std::chrono::microseconds(5050)),
superstructure_event_loop(MakeEventLoop("Superstructure")),
superstructure_(superstructure_event_loop.get()),
diff --git a/y2021_bot3/control_loops/superstructure/superstructure_main.cc b/y2021_bot3/control_loops/superstructure/superstructure_main.cc
index c366e53..be37e92 100644
--- a/y2021_bot3/control_loops/superstructure/superstructure_main.cc
+++ b/y2021_bot3/control_loops/superstructure/superstructure_main.cc
@@ -7,7 +7,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2021_bot3::control_loops::superstructure::Superstructure superstructure(
diff --git a/y2021_bot3/joystick_reader.cc b/y2021_bot3/joystick_reader.cc
index 7cdb296..0e5076a 100644
--- a/y2021_bot3/joystick_reader.cc
+++ b/y2021_bot3/joystick_reader.cc
@@ -67,7 +67,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2021_bot3::input::joysticks::Reader reader(&event_loop);
diff --git a/y2021_bot3/wpilib_interface.cc b/y2021_bot3/wpilib_interface.cc
index 05a8895..1a7837c 100644
--- a/y2021_bot3/wpilib_interface.cc
+++ b/y2021_bot3/wpilib_interface.cc
@@ -259,7 +259,7 @@
void Run() override {
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
// Thread 1.
::aos::ShmEventLoop joystick_sender_event_loop(&config.message());
diff --git a/y2022/BUILD b/y2022/BUILD
index af57a74..1aa4fa1 100644
--- a/y2022/BUILD
+++ b/y2022/BUILD
@@ -7,7 +7,7 @@
"//aos/network:web_proxy_main",
],
data = [
- ":config",
+ ":aos_config",
"@ctre_phoenix_api_cpp_athena//:shared_libraries",
"@ctre_phoenix_cci_athena//:shared_libraries",
],
@@ -38,7 +38,7 @@
"//y2022/control_loops/localizer:localizer_main",
],
data = [
- ":config",
+ ":aos_config",
],
start_binaries = [
"//aos/events/logging:logger_main",
@@ -52,7 +52,7 @@
)
aos_config(
- name = "config",
+ name = "aos_config",
src = "y2022.json",
flatbuffers = [
"//aos/network:message_bridge_client_fbs",
@@ -91,9 +91,9 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//aos/events:config",
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
+ "//aos/events:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
],
)
for pi in [
@@ -118,8 +118,8 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//aos/events:config",
- "//frc971/control_loops/drivetrain:config",
+ "//aos/events:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
],
)
@@ -137,9 +137,9 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- "//aos/events:config",
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
+ "//aos/events:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
],
)
@@ -159,11 +159,11 @@
],
target_compatible_with = ["@platforms//os:linux"],
deps = [
- "//aos/events:config",
- "//frc971/autonomous:config",
- "//frc971/control_loops/drivetrain:config",
- "//frc971/input:config",
- "//frc971/wpilib:config",
+ "//aos/events:aos_config",
+ "//frc971/autonomous:aos_config",
+ "//frc971/control_loops/drivetrain:aos_config",
+ "//frc971/input:aos_config",
+ "//frc971/wpilib:aos_config",
],
)
diff --git a/y2022/actors/autonomous_actor_main.cc b/y2022/actors/autonomous_actor_main.cc
index bf4a782..ae45ee8 100644
--- a/y2022/actors/autonomous_actor_main.cc
+++ b/y2022/actors/autonomous_actor_main.cc
@@ -8,7 +8,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2022::actors::AutonomousActor autonomous(&event_loop);
diff --git a/y2022/control_loops/drivetrain/BUILD b/y2022/control_loops/drivetrain/BUILD
index 661aee9..5381254 100644
--- a/y2022/control_loops/drivetrain/BUILD
+++ b/y2022/control_loops/drivetrain/BUILD
@@ -107,7 +107,7 @@
visibility = ["//visibility:public"],
deps = [
"//frc971/control_loops/drivetrain:simulation_channels",
- "//y2022:config",
+ "//y2022:aos_config",
],
)
diff --git a/y2022/control_loops/drivetrain/drivetrain_main.cc b/y2022/control_loops/drivetrain/drivetrain_main.cc
index fc448eb..a422eaa 100644
--- a/y2022/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2022/control_loops/drivetrain/drivetrain_main.cc
@@ -12,7 +12,7 @@
aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
aos::ShmEventLoop event_loop(&config.message());
std::unique_ptr<::y2022::control_loops::drivetrain::Localizer> localizer =
diff --git a/y2022/control_loops/drivetrain/trajectory_generator_main.cc b/y2022/control_loops/drivetrain/trajectory_generator_main.cc
index c2837dd..9a59811 100644
--- a/y2022/control_loops/drivetrain/trajectory_generator_main.cc
+++ b/y2022/control_loops/drivetrain/trajectory_generator_main.cc
@@ -15,7 +15,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
TrajectoryGenerator generator(
diff --git a/y2022/control_loops/localizer/BUILD b/y2022/control_loops/localizer/BUILD
index 034c779..8e7ec95 100644
--- a/y2022/control_loops/localizer/BUILD
+++ b/y2022/control_loops/localizer/BUILD
@@ -87,7 +87,7 @@
name = "localizer_test",
srcs = ["localizer_test.cc"],
data = [
- "//y2022:config",
+ "//y2022:aos_config",
],
shard_count = 10,
deps = [
@@ -102,7 +102,7 @@
name = "localizer_replay",
srcs = ["localizer_replay.cc"],
data = [
- "//y2020:config",
+ "//y2020:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
deps = [
diff --git a/y2022/control_loops/localizer/localizer_main.cc b/y2022/control_loops/localizer/localizer_main.cc
index 0cc53bb..187a441 100644
--- a/y2022/control_loops/localizer/localizer_main.cc
+++ b/y2022/control_loops/localizer/localizer_main.cc
@@ -3,7 +3,7 @@
#include "y2022/control_loops/localizer/localizer.h"
#include "y2022/control_loops/drivetrain/drivetrain_base.h"
-DEFINE_string(config, "config.json", "Path to the config file to use.");
+DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
int main(int argc, char *argv[]) {
aos::InitGoogle(&argc, &argv);
diff --git a/y2022/control_loops/localizer/localizer_replay.cc b/y2022/control_loops/localizer/localizer_replay.cc
index 67fb35a..c438e53 100644
--- a/y2022/control_loops/localizer/localizer_replay.cc
+++ b/y2022/control_loops/localizer/localizer_replay.cc
@@ -11,7 +11,7 @@
#include "gflags/gflags.h"
#include "y2020/control_loops/drivetrain/drivetrain_base.h"
-DEFINE_string(config, "y2020/config.json",
+DEFINE_string(config, "y2020/aos_config.json",
"Name of the config file to replay using.");
DEFINE_int32(team, 7971, "Team number to use for logfile replay.");
DEFINE_string(output_folder, "/tmp/replayed",
diff --git a/y2022/control_loops/localizer/localizer_test.cc b/y2022/control_loops/localizer/localizer_test.cc
index 5857bda..79a69b5 100644
--- a/y2022/control_loops/localizer/localizer_test.cc
+++ b/y2022/control_loops/localizer/localizer_test.cc
@@ -284,7 +284,7 @@
class EventLoopLocalizerTest : public ::testing::Test {
protected:
EventLoopLocalizerTest()
- : configuration_(aos::configuration::ReadConfig("y2022/config.json")),
+ : configuration_(aos::configuration::ReadConfig("y2022/aos_config.json")),
event_loop_factory_(&configuration_.message()),
roborio_node_(
aos::configuration::GetNode(&configuration_.message(), "roborio")),
diff --git a/y2022/control_loops/superstructure/BUILD b/y2022/control_loops/superstructure/BUILD
index 644b53b..e5992ef 100644
--- a/y2022/control_loops/superstructure/BUILD
+++ b/y2022/control_loops/superstructure/BUILD
@@ -97,7 +97,7 @@
"superstructure_lib_test.cc",
],
data = [
- "//y2022:config",
+ "//y2022:aos_config",
],
deps = [
":superstructure_goal_fbs",
diff --git a/y2022/control_loops/superstructure/superstructure_lib_test.cc b/y2022/control_loops/superstructure/superstructure_lib_test.cc
index 493fe95..2ddbc3e 100644
--- a/y2022/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2022/control_loops/superstructure/superstructure_lib_test.cc
@@ -252,7 +252,7 @@
public:
SuperstructureTest()
: ::frc971::testing::ControlLoopTest(
- aos::configuration::ReadConfig("y2022/config.json"),
+ aos::configuration::ReadConfig("y2022/aos_config.json"),
std::chrono::microseconds(5050)),
values_(std::make_shared<constants::Values>(constants::MakeValues(
frc971::control_loops::testing::kTeamNumber))),
diff --git a/y2022/control_loops/superstructure/superstructure_main.cc b/y2022/control_loops/superstructure/superstructure_main.cc
index c6c12b7..3aa9517 100644
--- a/y2022/control_loops/superstructure/superstructure_main.cc
+++ b/y2022/control_loops/superstructure/superstructure_main.cc
@@ -6,7 +6,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
std::shared_ptr<const y2022::constants::Values> values =
diff --git a/y2022/joystick_reader.cc b/y2022/joystick_reader.cc
index e5b09ac..80747a8 100644
--- a/y2022/joystick_reader.cc
+++ b/y2022/joystick_reader.cc
@@ -67,7 +67,7 @@
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
::aos::ShmEventLoop event_loop(&config.message());
::y2022::input::joysticks::Reader reader(&event_loop);
diff --git a/y2022/localizer/imu.cc b/y2022/localizer/imu.cc
index eb76e00..fed9ceb 100644
--- a/y2022/localizer/imu.cc
+++ b/y2022/localizer/imu.cc
@@ -20,6 +20,8 @@
imu_sender_(
event_loop_->MakeSender<frc971::IMUValuesBatch>("/localizer")) {
event_loop->SetRuntimeRealtimePriority(30);
+ PCHECK(system("sudo chmod 644 /dev/adis16505") == 0)
+ << ": Failed to set read permissions on IMU device.";
imu_fd_ = open("/dev/adis16505", O_RDONLY | O_NONBLOCK);
PCHECK(imu_fd_ != -1) << ": Failed to open SPI device for IMU.";
aos::internal::EPoll *epoll = event_loop_->epoll();
diff --git a/y2022/localizer/imu_main.cc b/y2022/localizer/imu_main.cc
index bba2dd7..5bdab41 100644
--- a/y2022/localizer/imu_main.cc
+++ b/y2022/localizer/imu_main.cc
@@ -2,7 +2,7 @@
#include "aos/init.h"
#include "y2022/localizer/imu.h"
-DEFINE_string(config, "config.json", "Path to the config file to use.");
+DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
int main(int argc, char *argv[]) {
aos::InitGoogle(&argc, &argv);
diff --git a/y2022/localizer/kernel/Makefile b/y2022/localizer/kernel/Makefile
new file mode 100644
index 0000000..ad4b9b0
--- /dev/null
+++ b/y2022/localizer/kernel/Makefile
@@ -0,0 +1,9 @@
+obj-m += adis16505.o
+
+PWD := $(CURDIR)
+
+all:
+ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -C ../../../../linux M=$(PWD) modules
+
+clean:
+ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -C ../../../../linux M=$(PWD) clean
diff --git a/y2022/localizer/kernel/README b/y2022/localizer/kernel/README
new file mode 100644
index 0000000..10f4e7b
--- /dev/null
+++ b/y2022/localizer/kernel/README
@@ -0,0 +1 @@
+As of 2022.02.08 this is the current version of the imu kernel driver being used
diff --git a/y2022/localizer/kernel/adis16505.c b/y2022/localizer/kernel/adis16505.c
new file mode 100644
index 0000000..a91006e
--- /dev/null
+++ b/y2022/localizer/kernel/adis16505.c
@@ -0,0 +1,325 @@
+/*
+ * adis16505.c - Driver for the adis16505 IMU used by 971.
+ */
+#include <linux/cdev.h>
+#include <linux/debugfs.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h> /* Needed for pr_info() */
+#include <linux/kfifo.h>
+#include <linux/module.h> /* Needed by all modules */
+#include <linux/poll.h>
+
+#include <linux/of_gpio.h>
+#include <linux/spi/spi.h>
+#include <linux/of_address.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("frc971");
+MODULE_DESCRIPTION("adis16505 rp2040 driver");
+
+#define MODULE_NAME "adis16505"
+
+//! filter for the device tree class
+static struct of_device_id adis16505_match[] = {
+ {.compatible = "frc971,adis16505"}, {}};
+
+MODULE_DEVICE_TABLE(of, adis16505_match);
+
+#define TRANSFER_SIZE 42
+struct imu_sample {
+ char time[8];
+ char d[TRANSFER_SIZE];
+};
+
+struct adis16505_state {
+ dev_t character_device;
+ struct class *device_class;
+ struct cdev handle_cdev;
+
+ struct spi_device *spi;
+
+ struct spi_message spi_msg;
+
+ struct spi_transfer spi_xfer;
+
+ char tx_buff[128];
+ char rx_buff[128];
+
+ int count;
+
+ spinlock_t lock;
+
+ wait_queue_head_t wq;
+
+ spinlock_t fifo_read_lock;
+ DECLARE_KFIFO(fifo, struct imu_sample, 32);
+};
+
+static int adis16505_dev_open(struct inode *in, struct file *f) {
+ struct adis16505_state *ts =
+ container_of(in->i_cdev, struct adis16505_state, handle_cdev);
+ int count;
+
+ f->private_data = ts;
+
+ spin_lock(&ts->lock);
+ count = ts->count;
+ if (count == 0) {
+ ++(ts->count);
+ }
+ spin_unlock(&ts->lock);
+
+ printk("open %p, count %d\n", ts, count);
+ if (count > 0) {
+ return -EBUSY;
+ }
+ return 0;
+}
+
+static int adis16505_dev_release(struct inode *in, struct file *f) {
+ struct adis16505_state *ts;
+ ts = container_of(in->i_cdev, struct adis16505_state, handle_cdev);
+
+ printk("release %p\n", ts);
+ spin_lock(&ts->lock);
+ --(ts->count);
+ spin_unlock(&ts->lock);
+
+ return 0;
+}
+
+static ssize_t adis16505_dev_read(struct file *f, char *d, size_t s,
+ loff_t *of) {
+ struct adis16505_state *ts = f->private_data;
+ int err;
+
+ if (s != sizeof(struct imu_sample)) {
+ return -EINVAL;
+ }
+
+ while (true) {
+ struct imu_sample sample;
+ int elements;
+
+ spin_lock(&ts->fifo_read_lock);
+ elements = kfifo_get(&ts->fifo, &sample);
+ spin_unlock(&ts->fifo_read_lock);
+
+ if (elements == 0) {
+ bool empty;
+ if (f->f_flags & O_NONBLOCK) {
+ return -EAGAIN;
+ }
+
+ err = wait_event_interruptible(ts->wq,
+ (spin_lock(&ts->fifo_read_lock),
+ empty = !kfifo_is_empty(&ts->fifo),
+ spin_unlock(&ts->fifo_read_lock), empty));
+ if (err != 0) {
+ return err;
+ }
+ continue;
+ }
+
+ memcpy(d, &sample, sizeof(sample));
+ return sizeof(sample);
+ }
+}
+
+static unsigned int adis16505_dev_poll(struct file *f,
+ struct poll_table_struct *wait) {
+ struct adis16505_state *ts = f->private_data;
+ __poll_t mask = 0;
+
+ poll_wait(f, &ts->wq, wait);
+
+ spin_lock(&ts->fifo_read_lock);
+ if (!kfifo_is_empty(&ts->fifo)) {
+ mask |= (POLLIN | POLLRDNORM);
+ }
+ spin_unlock(&ts->fifo_read_lock);
+
+ return mask;
+}
+
+static const struct file_operations adis16505_cdev_opps = {
+ .read = adis16505_dev_read,
+ .open = adis16505_dev_open,
+ .release = adis16505_dev_release,
+ .poll = adis16505_dev_poll,
+};
+
+static void all_done(void *ts_ptr) {
+ // struct adis16505_state *ts = ts_ptr;
+ // printk("All done %x %x\n", ts->rx_buff[0], ts->rx_buff[1]);
+}
+
+static irqreturn_t adis16505_irq(int irq, void *handle) {
+ struct adis16505_state *ts = handle;
+ struct imu_sample s;
+ int err;
+ int i;
+
+ u64 time = ktime_get_ns();
+ memcpy(&s.time, &time, sizeof(time));
+
+ spi_message_init(&ts->spi_msg);
+ for (i = 0; i < TRANSFER_SIZE; ++i) {
+ ts->tx_buff[i] = i;
+ }
+
+ ts->spi_xfer.tx_buf = ts->tx_buff;
+ ts->spi_xfer.rx_buf = ts->rx_buff;
+ ts->spi_xfer.len = TRANSFER_SIZE;
+
+ spi_message_add_tail(&ts->spi_xfer, &ts->spi_msg);
+
+ ts->spi_msg.complete = all_done;
+ ts->spi_msg.context = ts;
+
+ err = spi_sync(ts->spi, &ts->spi_msg);
+
+ // TODO(austin): Timestamp. Also decode the packet for real.
+ for (i = 0; i < TRANSFER_SIZE; ++i) {
+ s.d[i] = ts->rx_buff[i];
+ }
+
+ // Attempt to emplace. If it fails, just drop the data.
+ kfifo_put(&ts->fifo, s);
+
+ wake_up_interruptible(&ts->wq);
+
+ return IRQ_HANDLED;
+}
+
+static int adis16505_probe(struct spi_device *spi) {
+ int err;
+ struct adis16505_state *ts;
+
+ if (!spi->irq) {
+ dev_dbg(&spi->dev, "no IRQ?\n");
+ return -EINVAL;
+ }
+
+ if (spi->max_speed_hz > 10000000) {
+ dev_err(&spi->dev, "f(sample) %d KHz?\n", spi->max_speed_hz / 1000);
+ return -EINVAL;
+ }
+
+ spi->bits_per_word = 8;
+ spi->mode = SPI_MODE_3;
+ spi->max_speed_hz = 2000000;
+
+ err = spi_setup(spi);
+ if (err < 0) {
+ return err;
+ }
+
+ ts = kzalloc(sizeof(struct adis16505_state), GFP_KERNEL);
+
+ if (!ts) {
+ err = -ENOMEM;
+ goto err_free_mem;
+ }
+
+ printk("Ts allocated %p\n", ts);
+
+ spin_lock_init(&ts->lock);
+ spin_lock_init(&ts->fifo_read_lock);
+ ts->count = 0;
+ INIT_KFIFO(ts->fifo);
+ init_waitqueue_head(&ts->wq);
+
+ spi_set_drvdata(spi, ts);
+ ts->spi = spi;
+
+ // Flags are sourced from the device tree.
+ err = request_threaded_irq(spi->irq, NULL, adis16505_irq, IRQF_ONESHOT,
+ spi->dev.driver->name, ts);
+
+ if (!ts) {
+ dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
+ goto err_free_mem;
+ }
+
+ err = alloc_chrdev_region(&ts->character_device, 0, 1, "adis16505");
+ if (err < 0) {
+ dev_dbg(&spi->dev, "alloc_chrdev_region error %i", err);
+ goto err_free_irq;
+ }
+
+ // create device class
+ if ((ts->device_class = class_create(THIS_MODULE, "adis16505_class")) ==
+ NULL) {
+ dev_dbg(&spi->dev, "class_create error");
+ goto error_classCreate;
+ }
+
+ if (NULL == device_create(ts->device_class, NULL, ts->character_device, NULL,
+ "adis16505")) {
+ dev_dbg(&spi->dev, "device_create error");
+ goto error_deviceCreate;
+ }
+
+ cdev_init(&ts->handle_cdev, &adis16505_cdev_opps);
+ err = cdev_add(&ts->handle_cdev, ts->character_device, 1);
+ if (-1 == err) {
+ dev_dbg(&spi->dev, "cdev_add error %i", err);
+ goto error_device_add;
+ return -1;
+ }
+
+ dev_dbg(&spi->dev, "Probed adis16505\n");
+
+ if (err < 0) {
+ goto err_free_mem;
+ }
+
+ return 0;
+
+error_device_add:
+ device_destroy(ts->device_class, ts->character_device);
+error_deviceCreate:
+ class_destroy(ts->device_class);
+error_classCreate:
+ unregister_chrdev_region(ts->character_device, 1);
+err_free_irq:
+ free_irq(spi->irq, ts);
+
+err_free_mem:
+ kfree(ts);
+ return err;
+}
+
+static int adis16505_remove(struct spi_device *spi) {
+ struct adis16505_state *ts = spi_get_drvdata(spi);
+
+ device_destroy(ts->device_class, ts->character_device);
+
+ class_destroy(ts->device_class);
+
+ unregister_chrdev_region(ts->character_device, 1);
+
+ free_irq(spi->irq, ts);
+
+ kfree(ts);
+
+ dev_dbg(&spi->dev, "unregistered adis16505\n");
+ return 0;
+}
+
+static struct spi_driver adis16505_driver = {
+ .driver =
+ {
+ .name = "adis16505",
+ .of_match_table = of_match_ptr(adis16505_match),
+ },
+ .probe = adis16505_probe,
+ .remove = adis16505_remove,
+};
+
+module_spi_driver(adis16505_driver);
diff --git a/y2022/vision/BUILD b/y2022/vision/BUILD
index 965cc67..284dd66 100644
--- a/y2022/vision/BUILD
+++ b/y2022/vision/BUILD
@@ -89,7 +89,7 @@
"gpio.h",
],
data = [
- "//y2022:config",
+ "//y2022:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//y2022:__subpackages__"],
@@ -170,7 +170,7 @@
"viewer.cc",
],
data = [
- "//y2022:config",
+ "//y2022:aos_config",
],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//y2022:__subpackages__"],
diff --git a/y2022/vision/camera_reader_main.cc b/y2022/vision/camera_reader_main.cc
index a82d2ac..d5ba448 100644
--- a/y2022/vision/camera_reader_main.cc
+++ b/y2022/vision/camera_reader_main.cc
@@ -3,9 +3,9 @@
#include "y2022/vision/camera_reader.h"
// config used to allow running camera_reader independently. E.g.,
-// bazel run //y2022/vision:camera_reader -- --config y2022/config.json
+// bazel run //y2022/vision:camera_reader -- --config y2022/aos_config.json
// --override_hostname pi-7971-1 --ignore_timestamps true
-DEFINE_string(config, "config.json", "Path to the config file to use.");
+DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
DEFINE_double(duty_cycle, 0.5, "Duty cycle of the LEDs");
DEFINE_uint32(exposure, 5,
"Exposure time, in 100us increments; 0 implies auto exposure");
diff --git a/y2022/vision/viewer.cc b/y2022/vision/viewer.cc
index 2a6f0a6..f655f91 100644
--- a/y2022/vision/viewer.cc
+++ b/y2022/vision/viewer.cc
@@ -15,7 +15,7 @@
DEFINE_string(capture, "",
"If set, capture a single image and save it to this filename.");
DEFINE_string(channel, "/camera", "Channel name for the image.");
-DEFINE_string(config, "config.json", "Path to the config file to use.");
+DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
DEFINE_string(png_dir, "", "Path to a set of images to display.");
DEFINE_bool(show_features, true, "Show the blobs.");
diff --git a/y2022/wpilib_interface.cc b/y2022/wpilib_interface.cc
index 8de396c..032b686 100644
--- a/y2022/wpilib_interface.cc
+++ b/y2022/wpilib_interface.cc
@@ -465,7 +465,7 @@
std::make_shared<const Values>(constants::MakeValues());
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig("config.json");
+ aos::configuration::ReadConfig("aos_config.json");
// Thread 1.
::aos::ShmEventLoop joystick_sender_event_loop(&config.message());