Moving analysis from frc971 to aos, cleanup
bazel run -c opt //aos/analysis:in_process_plotter_demo
now works.
Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: Icbe7255ea3988b8fe575253f99b30310a6720bd8
diff --git a/aos/analysis/in_process_plotter.cc b/aos/analysis/in_process_plotter.cc
index a2ed68c..88591b3 100644
--- a/aos/analysis/in_process_plotter.cc
+++ b/aos/analysis/in_process_plotter.cc
@@ -2,11 +2,11 @@
#include "aos/configuration.h"
-namespace frc971::analysis {
+namespace aos::analysis {
namespace {
-const char *kDataPath = "frc971/analysis/cpp_plot";
-const char *kConfigPath = "frc971/analysis/plotter.json";
+const char *kDataPath = "aos/analysis/cpp_plot";
+const char *kConfigPath = "aos/analysis/plotter.json";
} // namespace
Plotter::Plotter()
@@ -167,4 +167,4 @@
next_top_ = 0;
}
-} // namespace frc971::analysis
+} // namespace aos::analysis
diff --git a/aos/analysis/in_process_plotter.h b/aos/analysis/in_process_plotter.h
index fdfde8c..0d00deb 100644
--- a/aos/analysis/in_process_plotter.h
+++ b/aos/analysis/in_process_plotter.h
@@ -1,5 +1,5 @@
-#ifndef FRC971_ANALYSIS_IN_PROCESS_PLOTTER_H_
-#define FRC971_ANALYSIS_IN_PROCESS_PLOTTER_H_
+#ifndef AOS_ANALYSIS_IN_PROCESS_PLOTTER_H_
+#define AOS_ANALYSIS_IN_PROCESS_PLOTTER_H_
#include <vector>
@@ -7,7 +7,7 @@
#include "aos/events/simulated_event_loop.h"
#include "aos/network/web_proxy.h"
-namespace frc971::analysis {
+namespace aos::analysis {
// This class wraps the WebProxy class to provide a convenient C++ interface to
// dynamically generate plots.
@@ -95,5 +95,5 @@
std::vector<ColorWheelColor> color_wheel_;
};
-} // namespace frc971::analysis
-#endif // FRC971_ANALYSIS_IN_PROCESS_PLOTTER_H_
+} // namespace aos::analysis
+#endif // AOS_ANALYSIS_IN_PROCESS_PLOTTER_H_
diff --git a/aos/analysis/in_process_plotter_demo.cc b/aos/analysis/in_process_plotter_demo.cc
index a02451a..6141d6a 100644
--- a/aos/analysis/in_process_plotter_demo.cc
+++ b/aos/analysis/in_process_plotter_demo.cc
@@ -8,7 +8,7 @@
// each plot.
int main(int argc, char *argv[]) {
aos::InitGoogle(&argc, &argv);
- frc971::analysis::Plotter plotter;
+ aos::analysis::Plotter plotter;
plotter.Title("TITLE!");
plotter.AddFigure("Fig Foo");
plotter.ShareXAxis(true);
diff --git a/aos/analysis/plot_data.fbs b/aos/analysis/plot_data.fbs
index 641cd6e..20689c5 100644
--- a/aos/analysis/plot_data.fbs
+++ b/aos/analysis/plot_data.fbs
@@ -3,7 +3,7 @@
// the data to plot is all packaged within a single Plot message. Each Plot
// message will correspond to a single view/tab on the web-page, and can have
// multiple figures, each of which can have multiple lines.
-namespace frc971.analysis;
+namespace aos.analysis;
// Position within the web-page to plot a figure at. [0, 0] will be the upper
// left corner of the allowable places where plots can be put, and should
diff --git a/aos/analysis/plot_data_utils.ts b/aos/analysis/plot_data_utils.ts
index 25131fb..0153cdb 100644
--- a/aos/analysis/plot_data_utils.ts
+++ b/aos/analysis/plot_data_utils.ts
@@ -1,5 +1,5 @@
// Provides a plot which handles plotting the plot defined by a
-// frc971.analysis.Plot message.
+// aos.analysis.Plot message.
import {Plot as PlotFb} from './plot_data_generated';
import {MessageHandler, TimestampedMessage} from '../../aos/network/www/aos_plotter';
import {ByteBuffer} from 'flatbuffers';
@@ -28,7 +28,7 @@
parentDiv.appendChild(plotDiv);
conn.addReliableHandler(
- '/analysis', 'frc971.analysis.Plot', (data: Uint8Array, time: number) => {
+ '/analysis', 'aos.analysis.Plot', (data: Uint8Array, time: number) => {
const plotFb = PlotFb.getRootAsPlot(new ByteBuffer(data));
const name = (!plotFb.title()) ? 'Plot ' + plots.size : plotFb.title();
const div = document.createElement('div');
diff --git a/aos/analysis/plotter_config.json b/aos/analysis/plotter_config.json
index fef4a50..2ebde74 100644
--- a/aos/analysis/plotter_config.json
+++ b/aos/analysis/plotter_config.json
@@ -2,7 +2,7 @@
"channels": [
{
"name": "/analysis",
- "type": "frc971.analysis.Plot",
+ "type": "aos.analysis.Plot",
"max_size": 1000000000
}
],
diff --git a/aos/analysis/py_log_reader.cc b/aos/analysis/py_log_reader.cc
index 57d57d0..4a97a0f 100644
--- a/aos/analysis/py_log_reader.cc
+++ b/aos/analysis/py_log_reader.cc
@@ -27,7 +27,7 @@
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
-namespace frc971::analysis {
+namespace aos::analysis {
namespace {
// All the data corresponding to a single message.
@@ -299,8 +299,8 @@
}
} // namespace
-} // namespace frc971::analysis
+} // namespace aos::analysis
PyMODINIT_FUNC PyInit_py_log_reader(void) {
- return frc971::analysis::InitModule();
+ return aos::analysis::InitModule();
}
diff --git a/aos/events/logging/timestamp_plot.cc b/aos/events/logging/timestamp_plot.cc
index 8aee90d..5b5cdc2 100644
--- a/aos/events/logging/timestamp_plot.cc
+++ b/aos/events/logging/timestamp_plot.cc
@@ -5,7 +5,7 @@
#include "aos/init.h"
#include "aos/util/file.h"
-using frc971::analysis::Plotter;
+using aos::analysis::Plotter;
DEFINE_bool(all, false, "If true, plot *all* the nodes at once");
DEFINE_bool(bounds, false, "If true, plot the noncausal bounds too.");
diff --git a/aos/flatbuffers/static_flatbuffers_test.cc b/aos/flatbuffers/static_flatbuffers_test.cc
index 2acc3c8..6072be0 100644
--- a/aos/flatbuffers/static_flatbuffers_test.cc
+++ b/aos/flatbuffers/static_flatbuffers_test.cc
@@ -796,17 +796,17 @@
// Try to cover ~all supported scalar/flatbuffer types using JSON convenience
// functions.
TEST_F(StaticFlatbuffersTest, FlatbufferTypeCoverage) {
- VerifyJson<frc971::testing::ConfigurationStatic>("{\n\n}");
+ VerifyJson<aos::testing::ConfigurationStatic>("{\n\n}");
std::string populated_config =
aos::util::ReadFileToStringOrDie(aos::testing::ArtifactPath(
"aos/flatbuffers/test_dir/type_coverage.json"));
// Get rid of a pesky new line.
populated_config = populated_config.substr(0, populated_config.size() - 1);
- VerifyJson<frc971::testing::ConfigurationStatic>(populated_config);
+ VerifyJson<aos::testing::ConfigurationStatic>(populated_config);
// And now play around with mutating the buffer.
- Builder<frc971::testing::ConfigurationStatic> builder =
- aos::JsonToStaticFlatbuffer<frc971::testing::ConfigurationStatic>(
+ Builder<aos::testing::ConfigurationStatic> builder =
+ aos::JsonToStaticFlatbuffer<aos::testing::ConfigurationStatic>(
populated_config);
ASSERT_TRUE(builder.Verify());
builder.get()->clear_foo_float();
diff --git a/aos/flatbuffers/test_dir/type_coverage.fbs b/aos/flatbuffers/test_dir/type_coverage.fbs
index d364fd5..96f6890 100644
--- a/aos/flatbuffers/test_dir/type_coverage.fbs
+++ b/aos/flatbuffers/test_dir/type_coverage.fbs
@@ -3,7 +3,7 @@
// other sources.
// Use a namespace that has no overlap with the aos::fbs namespace of the underlying code.
-namespace frc971.testing;
+namespace aos.testing;
enum BaseType : byte {
None,
diff --git a/frc971/control_loops/drivetrain/spline_test.cc b/frc971/control_loops/drivetrain/spline_test.cc
index fcd0030..b47f4ac 100644
--- a/frc971/control_loops/drivetrain/spline_test.cc
+++ b/frc971/control_loops/drivetrain/spline_test.cc
@@ -22,7 +22,7 @@
public:
static void SetUpTestSuite() {
if (FLAGS_plot) {
- plotter_ = std::make_unique<analysis::Plotter>();
+ plotter_ = std::make_unique<aos::analysis::Plotter>();
}
}
@@ -52,14 +52,14 @@
}
}
- static std::unique_ptr<analysis::Plotter> plotter_;
+ static std::unique_ptr<aos::analysis::Plotter> plotter_;
::Eigen::Matrix<double, 2, 4> control_points_;
NSpline<4> spline4_;
NSpline<6> spline6_;
};
-std::unique_ptr<analysis::Plotter> SplineTest::plotter_;
+std::unique_ptr<aos::analysis::Plotter> SplineTest::plotter_;
// Tests that the derivitives of xy integrate back up to the position.
TEST_F(SplineTest, XYIntegral) {
diff --git a/frc971/vision/extrinsics_calibration.cc b/frc971/vision/extrinsics_calibration.cc
index 5c4ae31..619ea89 100644
--- a/frc971/vision/extrinsics_calibration.cc
+++ b/frc971/vision/extrinsics_calibration.cc
@@ -393,7 +393,7 @@
// TODO<Jim>: Could probably still do a bit more work on naming
// conventions and what is being shown here
- frc971::analysis::Plotter plotter;
+ aos::analysis::Plotter plotter;
plotter.AddFigure("bot (imu) position");
plotter.AddLine(times_, x, "x_hat(0)");
plotter.AddLine(times_, y, "x_hat(1)");
diff --git a/y2018/control_loops/superstructure/arm/trajectory_plot.cc b/y2018/control_loops/superstructure/arm/trajectory_plot.cc
index 29dc085..eeb0fbc 100644
--- a/y2018/control_loops/superstructure/arm/trajectory_plot.cc
+++ b/y2018/control_loops/superstructure/arm/trajectory_plot.cc
@@ -255,7 +255,7 @@
}
if (FLAGS_plot) {
- frc971::analysis::Plotter plotter;
+ aos::analysis::Plotter plotter;
plotter.AddFigure();
plotter.Title("Trajectory");
diff --git a/y2023/control_loops/superstructure/arm/arm_design.cc b/y2023/control_loops/superstructure/arm/arm_design.cc
index d17535a..8c5664e 100644
--- a/y2023/control_loops/superstructure/arm/arm_design.cc
+++ b/y2023/control_loops/superstructure/arm/arm_design.cc
@@ -20,7 +20,7 @@
namespace y2023::control_loops::superstructure::arm {
int Main() {
- frc971::analysis::Plotter plotter;
+ aos::analysis::Plotter plotter;
frc971::control_loops::arm::Dynamics dynamics(kArmConstants);
diff --git a/y2023/control_loops/superstructure/arm/trajectory_plot.cc b/y2023/control_loops/superstructure/arm/trajectory_plot.cc
index 9b99660..8488d72 100644
--- a/y2023/control_loops/superstructure/arm/trajectory_plot.cc
+++ b/y2023/control_loops/superstructure/arm/trajectory_plot.cc
@@ -396,7 +396,7 @@
}
if (FLAGS_plot) {
- frc971::analysis::Plotter plotter;
+ aos::analysis::Plotter plotter;
plotter.AddFigure();
plotter.Title("Input spline");