Run clang-format on the entire repo
This patch clang-formats the entire repo. Third-party code is
excluded.
I needed to fix up the .clang-format file so that all the header
includes are ordered properly. I could have sworn that it used to work
without the extra modification, but I guess not.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I64bb9f2c795401393f9dfe2fefc4f04cb36b52f6
diff --git a/y2023/control_loops/superstructure/arm/arm_trajectory_gen.cc b/y2023/control_loops/superstructure/arm/arm_trajectory_gen.cc
index 578bf1f..699cfcf 100644
--- a/y2023/control_loops/superstructure/arm/arm_trajectory_gen.cc
+++ b/y2023/control_loops/superstructure/arm/arm_trajectory_gen.cc
@@ -1,13 +1,14 @@
#include <iostream>
#include <memory>
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/events/shm_event_loop.h"
#include "aos/flatbuffers.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
#include "frc971/control_loops/double_jointed_arm/graph.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
#include "y2023/constants.h"
#include "y2023/control_loops/superstructure/arm/arm_constants.h"
#include "y2023/control_loops/superstructure/arm/arm_trajectories_generated.h"
diff --git a/y2023/control_loops/superstructure/arm/trajectory.cc b/y2023/control_loops/superstructure/arm/trajectory.cc
index 88e3d1b..cbdfee8 100644
--- a/y2023/control_loops/superstructure/arm/trajectory.cc
+++ b/y2023/control_loops/superstructure/arm/trajectory.cc
@@ -1,12 +1,13 @@
#include "y2023/control_loops/superstructure/arm/trajectory.h"
#include "Eigen/Dense"
+#include "gflags/gflags.h"
+
#include "aos/logging/logging.h"
#include "frc971/control_loops/dlqr.h"
#include "frc971/control_loops/double_jointed_arm/dynamics.h"
#include "frc971/control_loops/jacobian.h"
#include "frc971/control_loops/runge_kutta.h"
-#include "gflags/gflags.h"
#include "y2023/control_loops/superstructure/arm/arm_trajectories_generated.h"
DEFINE_double(lqr_proximal_pos, 0.5, "Position LQR gain");
diff --git a/y2023/control_loops/superstructure/arm/trajectory.h b/y2023/control_loops/superstructure/arm/trajectory.h
index e498168..7994d60 100644
--- a/y2023/control_loops/superstructure/arm/trajectory.h
+++ b/y2023/control_loops/superstructure/arm/trajectory.h
@@ -8,6 +8,7 @@
#include <vector>
#include "Eigen/Dense"
+
#include "frc971/control_loops/binomial.h"
#include "frc971/control_loops/double_jointed_arm/dynamics.h"
#include "frc971/control_loops/fixed_quadrature.h"
diff --git a/y2023/control_loops/superstructure/arm/trajectory_plot.cc b/y2023/control_loops/superstructure/arm/trajectory_plot.cc
index 24bc8dd..16c8771 100644
--- a/y2023/control_loops/superstructure/arm/trajectory_plot.cc
+++ b/y2023/control_loops/superstructure/arm/trajectory_plot.cc
@@ -1,10 +1,11 @@
+#include "gflags/gflags.h"
+
#include "aos/init.h"
#include "frc971/analysis/in_process_plotter.h"
#include "frc971/control_loops/binomial.h"
#include "frc971/control_loops/double_jointed_arm/dynamics.h"
#include "frc971/control_loops/double_jointed_arm/ekf.h"
#include "frc971/control_loops/fixed_quadrature.h"
-#include "gflags/gflags.h"
#include "y2023/control_loops/superstructure/arm/arm_constants.h"
#include "y2023/control_loops/superstructure/arm/generated_graph.h"
#include "y2023/control_loops/superstructure/arm/trajectory.h"
@@ -62,7 +63,8 @@
<< ", kAlpha2Max=" << FLAGS_alpha2_max;
const ::Eigen::DiagonalMatrix<double, 3> alpha_unitizer(
- (::Eigen::DiagonalMatrix<double, 3>().diagonal() << (1.0 / FLAGS_alpha0_max),
+ (::Eigen::DiagonalMatrix<double, 3>().diagonal()
+ << (1.0 / FLAGS_alpha0_max),
(1.0 / FLAGS_alpha1_max), (1.0 / FLAGS_alpha2_max))
.finished());
trajectory.OptimizeTrajectory(alpha_unitizer, FLAGS_vmax_plan);
diff --git a/y2023/control_loops/superstructure/arm/trajectory_test.cc b/y2023/control_loops/superstructure/arm/trajectory_test.cc
index bcf338c..8af7ba7 100644
--- a/y2023/control_loops/superstructure/arm/trajectory_test.cc
+++ b/y2023/control_loops/superstructure/arm/trajectory_test.cc
@@ -1,8 +1,9 @@
#include "y2023/control_loops/superstructure/arm/trajectory.h"
+#include "gtest/gtest.h"
+
#include "frc971/control_loops/double_jointed_arm/dynamics.h"
#include "frc971/control_loops/double_jointed_arm/ekf.h"
-#include "gtest/gtest.h"
#include "y2023/control_loops/superstructure/arm/arm_constants.h"
#include "y2023/control_loops/superstructure/roll/integral_hybrid_roll_plant.h"
#include "y2023/control_loops/superstructure/roll/integral_roll_plant.h"
diff --git a/y2023/control_loops/superstructure/end_effector.cc b/y2023/control_loops/superstructure/end_effector.cc
index b600bbb..8628359 100644
--- a/y2023/control_loops/superstructure/end_effector.cc
+++ b/y2023/control_loops/superstructure/end_effector.cc
@@ -18,9 +18,9 @@
beambreak_(false) {}
void EndEffector::RunIteration(
- const ::aos::monotonic_clock::time_point timestamp,
- RollerGoal roller_goal, double falcon_current, double cone_position,
- bool beambreak, double *roller_voltage, bool preloaded_with_cone) {
+ const ::aos::monotonic_clock::time_point timestamp, RollerGoal roller_goal,
+ double falcon_current, double cone_position, bool beambreak,
+ double *roller_voltage, bool preloaded_with_cone) {
*roller_voltage = 0.0;
constexpr double kMinCurrent = 40.0;
diff --git a/y2023/control_loops/superstructure/led_indicator.h b/y2023/control_loops/superstructure/led_indicator.h
index dfdf4b1..eb5f037 100644
--- a/y2023/control_loops/superstructure/led_indicator.h
+++ b/y2023/control_loops/superstructure/led_indicator.h
@@ -1,10 +1,11 @@
#ifndef Y2023_CONTROL_LOOPS_SUPERSTRUCTURE_LED_INDICATOR_H_
#define Y2023_CONTROL_LOOPS_SUPERSTRUCTURE_LED_INDICATOR_H_
+#include "ctre/phoenix/led/CANdle.h"
+
#include "aos/events/event_loop.h"
#include "aos/network/message_bridge_client_generated.h"
#include "aos/network/message_bridge_server_generated.h"
-#include "ctre/phoenix/led/CANdle.h"
#include "frc971/control_loops/control_loop.h"
#include "frc971/control_loops/control_loops_generated.h"
#include "frc971/control_loops/drivetrain/drivetrain_output_generated.h"
diff --git a/y2023/control_loops/superstructure/superstructure_lib_test.cc b/y2023/control_loops/superstructure/superstructure_lib_test.cc
index b555277..26b88f3 100644
--- a/y2023/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2023/control_loops/superstructure/superstructure_lib_test.cc
@@ -1,13 +1,14 @@
#include <chrono>
#include <memory>
+#include "gtest/gtest.h"
+
#include "aos/events/logging/log_writer.h"
#include "frc971/control_loops/capped_test_plant.h"
#include "frc971/control_loops/control_loop_test.h"
#include "frc971/control_loops/position_sensor_sim.h"
#include "frc971/control_loops/subsystem_simulator.h"
#include "frc971/control_loops/team_number_test_environment.h"
-#include "gtest/gtest.h"
#include "y2023/constants/simulated_constants_sender.h"
#include "y2023/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
#include "y2023/control_loops/superstructure/roll/integral_roll_plant.h"
diff --git a/y2023/control_loops/superstructure/superstructure_replay.cc b/y2023/control_loops/superstructure/superstructure_replay.cc
index 9bd3ae2..6f23ec2 100644
--- a/y2023/control_loops/superstructure/superstructure_replay.cc
+++ b/y2023/control_loops/superstructure/superstructure_replay.cc
@@ -3,6 +3,8 @@
// replayed, so that it can then be run through the plotting tool or analyzed
// in some other way. The original superstructure status data will be on the
// /original/superstructure channel.
+#include "gflags/gflags.h"
+
#include "aos/events/logging/log_reader.h"
#include "aos/events/logging/log_writer.h"
#include "aos/events/simulated_event_loop.h"
@@ -10,7 +12,6 @@
#include "aos/json_to_flatbuffer.h"
#include "aos/logging/log_message_generated.h"
#include "aos/network/team_number.h"
-#include "gflags/gflags.h"
#include "y2023/constants.h"
#include "y2023/control_loops/superstructure/superstructure.h"