Nest all namespaces

The compiler supports this now.  We can type less going forward.
No functional changes.

Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I29d6fa4f9aacc0e381f1a7637294db0392466995
diff --git a/y2019/actors/auto_splines.cc b/y2019/actors/auto_splines.cc
index 67f9e85..02fc3d0 100644
--- a/y2019/actors/auto_splines.cc
+++ b/y2019/actors/auto_splines.cc
@@ -2,8 +2,7 @@
 
 #include "frc971/control_loops/control_loops_generated.h"
 
-namespace y2019 {
-namespace actors {
+namespace y2019::actors {
 
 void MaybeFlipSpline(
     aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
@@ -806,5 +805,4 @@
   return multispline_builder.Finish();
 }
 
-}  // namespace actors
-}  // namespace y2019
+}  // namespace y2019::actors
diff --git a/y2019/actors/autonomous_actor.cc b/y2019/actors/autonomous_actor.cc
index b8024ec..5200fed 100644
--- a/y2019/actors/autonomous_actor.cc
+++ b/y2019/actors/autonomous_actor.cc
@@ -10,8 +10,7 @@
 #include "y2019/actors/auto_splines.h"
 #include "y2019/control_loops/drivetrain/drivetrain_base.h"
 
-namespace y2019 {
-namespace actors {
+namespace y2019::actors {
 
 using ::aos::monotonic_clock;
 using ::frc971::ProfileParametersT;
@@ -392,5 +391,4 @@
   return true;
 }
 
-}  // namespace actors
-}  // namespace y2019
+}  // namespace y2019::actors
diff --git a/y2019/constants.cc b/y2019/constants.cc
index 0332252..26188de 100644
--- a/y2019/constants.cc
+++ b/y2019/constants.cc
@@ -20,8 +20,7 @@
 #include "y2019/control_loops/superstructure/wrist/integral_wrist_plant.h"
 #include "y2019/vision/constants.h"
 
-namespace y2019 {
-namespace constants {
+namespace y2019::constants {
 
 using ::frc971::zeroing::PotAndAbsoluteEncoderZeroingEstimator;
 
@@ -428,5 +427,4 @@
   }
 }
 
-}  // namespace constants
-}  // namespace y2019
+}  // namespace y2019::constants
diff --git a/y2019/control_loops/drivetrain/drivetrain_base.cc b/y2019/control_loops/drivetrain/drivetrain_base.cc
index 089bdf0..77085a6 100644
--- a/y2019/control_loops/drivetrain/drivetrain_base.cc
+++ b/y2019/control_loops/drivetrain/drivetrain_base.cc
@@ -13,9 +13,7 @@
 
 namespace chrono = ::std::chrono;
 
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2019::control_loops::drivetrain {
 
 using ::frc971::constants::ShifterHallEffect;
 
@@ -58,6 +56,4 @@
   return kDrivetrainConfig;
 };
 
-}  // namespace drivetrain
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::drivetrain
diff --git a/y2019/control_loops/drivetrain/event_loop_localizer.cc b/y2019/control_loops/drivetrain/event_loop_localizer.cc
index 634cedb..a916914 100644
--- a/y2019/control_loops/drivetrain/event_loop_localizer.cc
+++ b/y2019/control_loops/drivetrain/event_loop_localizer.cc
@@ -2,9 +2,7 @@
 
 #include <functional>
 
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2019::control_loops::drivetrain {
 constexpr size_t EventLoopLocalizer::kMaxTargetsPerFrame;
 
 ::std::array<EventLoopLocalizer::Camera, constants::Values::kNumCameras>
@@ -110,6 +108,4 @@
   localizer_.UpdateTargets(cameras_[camera], views, t);
 }
 
-}  // namespace drivetrain
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::drivetrain
diff --git a/y2019/control_loops/drivetrain/localized_drivetrain_test.cc b/y2019/control_loops/drivetrain/localized_drivetrain_test.cc
index 016e3b7..5aaafd7 100644
--- a/y2019/control_loops/drivetrain/localized_drivetrain_test.cc
+++ b/y2019/control_loops/drivetrain/localized_drivetrain_test.cc
@@ -15,10 +15,7 @@
 // drivetrain, will behave properly. The purpose of this test is to make sure
 // that all the pieces fit together, not to test the algorithms themselves.
 
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
-namespace testing {
+namespace y2019::control_loops::drivetrain::testing {
 
 using frc971::control_loops::drivetrain::DrivetrainConfig;
 using frc971::control_loops::drivetrain::Goal;
@@ -399,7 +396,4 @@
   EXPECT_NEAR(HPSlotLeft().abs_pos().y(), drivetrain_plant_.state().y(), 0.2);
 }
 
-}  // namespace testing
-}  // namespace drivetrain
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::drivetrain::testing
diff --git a/y2019/control_loops/drivetrain/localizer_test.cc b/y2019/control_loops/drivetrain/localizer_test.cc
index 28f0235..7f0b13d 100644
--- a/y2019/control_loops/drivetrain/localizer_test.cc
+++ b/y2019/control_loops/drivetrain/localizer_test.cc
@@ -19,9 +19,7 @@
 
 DEFINE_bool(plot, false, "If true, plot");
 
-namespace y2019 {
-namespace control_loops {
-namespace testing {
+namespace y2019::control_loops::testing {
 
 using ::y2019::constants::Field;
 
@@ -694,6 +692,4 @@
             /*goal_tolerance=*/0.7,
         })));
 
-}  // namespace testing
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::testing
diff --git a/y2019/control_loops/drivetrain/replay_localizer.cc b/y2019/control_loops/drivetrain/replay_localizer.cc
index b7d269b..80cf221 100644
--- a/y2019/control_loops/drivetrain/replay_localizer.cc
+++ b/y2019/control_loops/drivetrain/replay_localizer.cc
@@ -25,9 +25,7 @@
 DEFINE_int32(start_offset, 0,
              "Time, in seconds, to start replay plot after the first enable.");
 
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2019::control_loops::drivetrain {
 using ::y2019::constants::Field;
 
 typedef TypedLocalizer<constants::Values::kNumCameras, Field::kNumTargets,
@@ -386,9 +384,7 @@
   ::std::vector<double> long_accel_;
 };
 
-}  // namespace drivetrain
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::drivetrain
 
 int main(int argc, char *argv[]) {
   gflags::ParseCommandLineFlags(&argc, &argv, false);
diff --git a/y2019/control_loops/drivetrain/target_selector.cc b/y2019/control_loops/drivetrain/target_selector.cc
index 87115ae..b078dba 100644
--- a/y2019/control_loops/drivetrain/target_selector.cc
+++ b/y2019/control_loops/drivetrain/target_selector.cc
@@ -2,8 +2,7 @@
 
 #include "aos/json_to_flatbuffer.h"
 
-namespace y2019 {
-namespace control_loops {
+namespace y2019::control_loops {
 
 constexpr double TargetSelector::kFakeFov;
 
@@ -100,5 +99,4 @@
   return true;
 }
 
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops
diff --git a/y2019/control_loops/drivetrain/target_selector_test.cc b/y2019/control_loops/drivetrain/target_selector_test.cc
index d4ef6da..b0767e5 100644
--- a/y2019/control_loops/drivetrain/target_selector_test.cc
+++ b/y2019/control_loops/drivetrain/target_selector_test.cc
@@ -5,9 +5,7 @@
 #include "aos/events/simulated_event_loop.h"
 #include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
 
-namespace y2019 {
-namespace control_loops {
-namespace testing {
+namespace y2019::control_loops::testing {
 
 typedef ::frc971::control_loops::TypedPose<double> Pose;
 typedef ::Eigen::Matrix<double, 5, 1> State;
@@ -190,6 +188,4 @@
                    true, CargoNearLeft(),
                    /*expected_radius=*/0.0}));
 
-}  // namespace testing
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::testing
diff --git a/y2019/control_loops/superstructure/collision_avoidance.cc b/y2019/control_loops/superstructure/collision_avoidance.cc
index 9c2bf93..c52141b 100644
--- a/y2019/control_loops/superstructure/collision_avoidance.cc
+++ b/y2019/control_loops/superstructure/collision_avoidance.cc
@@ -7,9 +7,7 @@
 #include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
 #include "y2019/control_loops/superstructure/superstructure_status_generated.h"
 
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
+namespace y2019::control_loops::superstructure {
 
 constexpr double CollisionAvoidance::kElevatorClearHeight;
 constexpr double CollisionAvoidance::kElevatorClearWristDownHeight;
@@ -188,6 +186,4 @@
   }
 }
 
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::superstructure
diff --git a/y2019/control_loops/superstructure/collision_avoidance_tests.cc b/y2019/control_loops/superstructure/collision_avoidance_tests.cc
index 68449d6..f22e9ba 100644
--- a/y2019/control_loops/superstructure/collision_avoidance_tests.cc
+++ b/y2019/control_loops/superstructure/collision_avoidance_tests.cc
@@ -6,10 +6,7 @@
 #include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
 #include "y2019/control_loops/superstructure/superstructure_status_generated.h"
 
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
-namespace testing {
+namespace y2019::control_loops::superstructure::testing {
 
 using aos::FlatbufferDetachedBuffer;
 using frc971::control_loops::AbsoluteEncoderProfiledJointStatus;
@@ -484,7 +481,4 @@
 INSTANTIATE_TEST_SUITE_P(CollisionAvoidancePieceTest, CollisionAvoidanceTests,
                          ::testing::Bool());
 
-}  // namespace testing
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::superstructure::testing
diff --git a/y2019/control_loops/superstructure/superstructure.cc b/y2019/control_loops/superstructure/superstructure.cc
index e796f0b..8a38e7a 100644
--- a/y2019/control_loops/superstructure/superstructure.cc
+++ b/y2019/control_loops/superstructure/superstructure.cc
@@ -6,9 +6,7 @@
 #include "frc971/control_loops/static_zeroing_single_dof_profiled_subsystem.h"
 #include "y2019/status_light_generated.h"
 
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
+namespace y2019::control_loops::superstructure {
 
 using frc971::control_loops::AbsoluteEncoderProfiledJointStatus;
 using frc971::control_loops::PotAndAbsoluteEncoderProfiledJointStatus;
@@ -214,6 +212,4 @@
   }
 }
 
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::superstructure
diff --git a/y2019/control_loops/superstructure/superstructure_lib_test.cc b/y2019/control_loops/superstructure/superstructure_lib_test.cc
index a09913b..c2bf988 100644
--- a/y2019/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2019/control_loops/superstructure/superstructure_lib_test.cc
@@ -17,10 +17,7 @@
 #include "y2019/control_loops/superstructure/superstructure.h"
 #include "y2019/control_loops/superstructure/wrist/wrist_plant.h"
 
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
-namespace testing {
+namespace y2019::control_loops::superstructure::testing {
 
 namespace {
 constexpr double kNoiseScalar = 0.01;
@@ -1010,7 +1007,4 @@
   RunFor(chrono::seconds(2));
 }
 
-}  // namespace testing
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::superstructure::testing
diff --git a/y2019/control_loops/superstructure/vacuum.cc b/y2019/control_loops/superstructure/vacuum.cc
index fda123e..a9fbd8c 100644
--- a/y2019/control_loops/superstructure/vacuum.cc
+++ b/y2019/control_loops/superstructure/vacuum.cc
@@ -7,9 +7,7 @@
 #include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
 #include "y2019/control_loops/superstructure/superstructure_output_generated.h"
 
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
+namespace y2019::control_loops::superstructure {
 
 namespace chrono = ::std::chrono;
 
@@ -86,6 +84,4 @@
       monotonic_now < last_disable_has_piece_time_ + chrono::milliseconds(250);
 }
 
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::superstructure
diff --git a/y2019/jevois/camera/image_stream.cc b/y2019/jevois/camera/image_stream.cc
index 44fd8e5..3268a67 100644
--- a/y2019/jevois/camera/image_stream.cc
+++ b/y2019/jevois/camera/image_stream.cc
@@ -2,8 +2,7 @@
 
 #include "aos/logging/logging.h"
 
-namespace y2019 {
-namespace camera {
+namespace y2019::camera {
 
 void ImageStreamEvent::ProcessHelper(
     aos::vision::DataRef data, aos::monotonic_clock::time_point timestamp) {
@@ -14,5 +13,4 @@
   ProcessImage(data, timestamp);
 }
 
-}  // namespace camera
-}  // namespace y2019
+}  // namespace y2019::camera
diff --git a/y2019/jevois/camera/reader.cc b/y2019/jevois/camera/reader.cc
index 84bf7fe..09e07db 100644
--- a/y2019/jevois/camera/reader.cc
+++ b/y2019/jevois/camera/reader.cc
@@ -19,8 +19,7 @@
 
 #define CLEAR(x) memset(&(x), 0, sizeof(x))
 
-namespace y2019 {
-namespace camera {
+namespace y2019::camera {
 
 using ::camera::xioctl;
 
@@ -296,5 +295,4 @@
   }
 }
 
-}  // namespace camera
-}  // namespace y2019
+}  // namespace y2019::camera
diff --git a/y2019/jevois/cobs_test.cc b/y2019/jevois/cobs_test.cc
index 303c4d3..61604ad 100644
--- a/y2019/jevois/cobs_test.cc
+++ b/y2019/jevois/cobs_test.cc
@@ -5,8 +5,7 @@
 
 #include "aos/testing/test_logging.h"
 
-namespace frc971 {
-namespace jevois {
+namespace frc971::jevois {
 
 // Tests the size conversions for some known, simple values.
 TEST(CobsMaxEncodedSizeTest, Simple) {
@@ -289,5 +288,4 @@
             packetizer.received_packet());
 }
 
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois
diff --git a/y2019/jevois/serial.cc b/y2019/jevois/serial.cc
index cd0bb99..3bcc87e 100644
--- a/y2019/jevois/serial.cc
+++ b/y2019/jevois/serial.cc
@@ -8,8 +8,7 @@
 
 #include "aos/logging/logging.h"
 
-namespace y2019 {
-namespace jevois {
+namespace y2019::jevois {
 
 int open_via_terminos(const char *tty_name) {
   int itsDev = ::open(tty_name, O_RDWR | O_NOCTTY | O_NONBLOCK);
@@ -75,5 +74,4 @@
   return itsDev;
 }
 
-}  // namespace jevois
-}  // namespace y2019
+}  // namespace y2019::jevois
diff --git a/y2019/jevois/serial.h b/y2019/jevois/serial.h
index 14e2f98..04114cc 100644
--- a/y2019/jevois/serial.h
+++ b/y2019/jevois/serial.h
@@ -1,12 +1,10 @@
 #ifndef Y2019_JEVOIS_SERIAL_H_
 #define Y2019_JEVOIS_SERIAL_H_
 
-namespace y2019 {
-namespace jevois {
+namespace y2019::jevois {
 
 int open_via_terminos(const char *tty_name);
 
-}  // namespace jevois
-}  // namespace y2019
+}  // namespace y2019::jevois
 
 #endif  // Y2019_JEVOIS_SERIAL_H_
diff --git a/y2019/jevois/spi.cc b/y2019/jevois/spi.cc
index b3b6550..85ad988 100644
--- a/y2019/jevois/spi.cc
+++ b/y2019/jevois/spi.cc
@@ -39,8 +39,7 @@
 //   Note that empty frames are still sent to indicate that the camera is
 //   still working even though it doesn't see any targets.
 
-namespace frc971 {
-namespace jevois {
+namespace frc971::jevois {
 namespace {
 
 constexpr float heading_min() { return -3; }
@@ -312,5 +311,4 @@
   return message;
 }
 
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois
diff --git a/y2019/jevois/spi_test.cc b/y2019/jevois/spi_test.cc
index c600869..3c69993 100644
--- a/y2019/jevois/spi_test.cc
+++ b/y2019/jevois/spi_test.cc
@@ -4,9 +4,7 @@
 
 #include "gtest/gtest.h"
 
-namespace frc971 {
-namespace jevois {
-namespace testing {
+namespace frc971::jevois::testing {
 
 // Tests packing and then unpacking an empty message.
 TEST(SpiToRoborioPackTest, Empty) {
@@ -228,6 +226,4 @@
   EXPECT_EQ(input_message, output_message.value());
 }
 
-}  // namespace testing
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois::testing
diff --git a/y2019/jevois/teensy.cc b/y2019/jevois/teensy.cc
index 7c71ae8..9d755a3 100644
--- a/y2019/jevois/teensy.cc
+++ b/y2019/jevois/teensy.cc
@@ -22,8 +22,7 @@
 
 // All indices here refer to the ports as numbered on the PCB.
 
-namespace frc971 {
-namespace jevois {
+namespace frc971::jevois {
 namespace {
 
 // Holds all of our hardware UARTs. There is exactly one global instance for
@@ -1022,5 +1021,4 @@
 }  // extern "C"
 
 }  // namespace
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois
diff --git a/y2019/jevois/uart.cc b/y2019/jevois/uart.cc
index 0fc25c9..93e0072 100644
--- a/y2019/jevois/uart.cc
+++ b/y2019/jevois/uart.cc
@@ -13,8 +13,7 @@
 #define AOS_CHECK_GE(...)
 #endif
 
-namespace frc971 {
-namespace jevois {
+namespace frc971::jevois {
 
 UartToTeensyBuffer UartPackToTeensy(const CameraFrame &message) {
   std::array<char, uart_to_teensy_size()> buffer;
@@ -197,5 +196,4 @@
   return message;
 }
 
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois
diff --git a/y2019/jevois/uart_test.cc b/y2019/jevois/uart_test.cc
index 5a3a330..621412d 100644
--- a/y2019/jevois/uart_test.cc
+++ b/y2019/jevois/uart_test.cc
@@ -4,9 +4,7 @@
 
 #include "gtest/gtest.h"
 
-namespace frc971 {
-namespace jevois {
-namespace testing {
+namespace frc971::jevois::testing {
 
 // Tests packing and then unpacking a message with arbitrary values.
 TEST(UartToTeensyTest, Basic) {
@@ -123,6 +121,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois::testing
diff --git a/y2019/joystick_angle.cc b/y2019/joystick_angle.cc
index 986a3fa..9baf9ed 100644
--- a/y2019/joystick_angle.cc
+++ b/y2019/joystick_angle.cc
@@ -4,9 +4,7 @@
 
 #include "frc971/zeroing/wrap.h"
 
-namespace y2019 {
-namespace input {
-namespace joysticks {
+namespace y2019::input::joysticks {
 
 using ::frc971::zeroing::Wrap;
 
@@ -47,6 +45,4 @@
 
   return JoystickAngle::kDefault;
 }
-}  // namespace joysticks
-}  // namespace input
-}  // namespace y2019
+}  // namespace y2019::input::joysticks
diff --git a/y2019/joystick_reader.cc b/y2019/joystick_reader.cc
index 12f590f..b44d084 100644
--- a/y2019/joystick_reader.cc
+++ b/y2019/joystick_reader.cc
@@ -41,9 +41,7 @@
 
 namespace chrono = ::std::chrono;
 
-namespace y2019 {
-namespace input {
-namespace joysticks {
+namespace y2019::input::joysticks {
 
 namespace superstructure = y2019::control_loops::superstructure;
 
@@ -669,9 +667,7 @@
       ::aos::monotonic_clock::time_point::min();
 };
 
-}  // namespace joysticks
-}  // namespace input
-}  // namespace y2019
+}  // namespace y2019::input::joysticks
 
 int main(int argc, char **argv) {
   ::aos::InitGoogle(&argc, &argv);
diff --git a/y2019/vision/constants.cc b/y2019/vision/constants.cc
index 3fa99a7..504af1e 100644
--- a/y2019/vision/constants.cc
+++ b/y2019/vision/constants.cc
@@ -1,7 +1,6 @@
 #include "y2019/vision/constants.h"
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 static constexpr double kInchesToMeters = 0.0254;
 
@@ -320,5 +319,4 @@
   }
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
diff --git a/y2019/vision/constants_formatting.cc b/y2019/vision/constants_formatting.cc
index ebda53f..52db9d5 100644
--- a/y2019/vision/constants_formatting.cc
+++ b/y2019/vision/constants_formatting.cc
@@ -3,8 +3,7 @@
 
 #include "y2019/vision/constants.h"
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 namespace {
 // 64 should be enough for any mortal.
@@ -57,8 +56,7 @@
   std::ofstream o(fname);
   o << R"(#include "y2019/vision/constants.h"
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 static constexpr double kInchesToMeters = 0.0254;
 )";
@@ -90,11 +88,9 @@
   }
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 )";
   o.close();
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
diff --git a/y2019/vision/debug_serial.cc b/y2019/vision/debug_serial.cc
index 9b88260..79849b9 100644
--- a/y2019/vision/debug_serial.cc
+++ b/y2019/vision/debug_serial.cc
@@ -13,8 +13,7 @@
 #include "y2019/jevois/structures.h"
 #include "y2019/jevois/uart.h"
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 void main(int argc, char **argv) {
   (void)argc;
@@ -85,7 +84,6 @@
   }
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 
 int main(int argc, char **argv) { y2019::vision::main(argc, argv); }
diff --git a/y2019/vision/debug_viewer.cc b/y2019/vision/debug_viewer.cc
index b2ad1be..1a93f87 100644
--- a/y2019/vision/debug_viewer.cc
+++ b/y2019/vision/debug_viewer.cc
@@ -21,8 +21,7 @@
 
 DEFINE_int32(camera, 10, "The camera to use the intrinsics for");
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 std::vector<PixelRef> GetNColors(size_t num_colors) {
   std::vector<PixelRef> colors;
@@ -358,8 +357,7 @@
   bool draw_results_ = true;
 };
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 
 int main(int argc, char **argv) {
   ::gflags::ParseCommandLineFlags(&argc, &argv, true);
diff --git a/y2019/vision/global_calibration.cc b/y2019/vision/global_calibration.cc
index b8f5b3c..bb3259e 100644
--- a/y2019/vision/global_calibration.cc
+++ b/y2019/vision/global_calibration.cc
@@ -52,8 +52,7 @@
 using ceres::Solve;
 using ceres::Solver;
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 namespace {
 
 constexpr double kInchesToMeters = 0.0254;
@@ -293,7 +292,6 @@
   DumpCameraConstants(FLAGS_constants.c_str(), info.camera_id, results);
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 
 int main(int argc, char **argv) { y2019::vision::main(argc, argv); }
diff --git a/y2019/vision/image_writer.cc b/y2019/vision/image_writer.cc
index 4ca9b96..9b73a81 100644
--- a/y2019/vision/image_writer.cc
+++ b/y2019/vision/image_writer.cc
@@ -6,8 +6,7 @@
 
 #include "glog/logging.h"
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 ImageWriter::ImageWriter() {
   LOG(INFO) << "Initializing image writer";
@@ -38,5 +37,4 @@
   }
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
diff --git a/y2019/vision/server/server.cc b/y2019/vision/server/server.cc
index c9e7091..309a90c 100644
--- a/y2019/vision/server/server.cc
+++ b/y2019/vision/server/server.cc
@@ -28,8 +28,7 @@
 #include "y2019/control_loops/superstructure/superstructure_status_generated.h"
 #include "y2019/vision/server/server_data.pb.h"
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 namespace chrono = ::std::chrono;
 
@@ -279,8 +278,7 @@
   event_loop.Run();
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 
 int main(int argc, char **argv) {
   // Make sure to reference this to force the linker to include it.
diff --git a/y2019/vision/server/www/generate_camera.cc b/y2019/vision/server/www/generate_camera.cc
index 455b0a9..c673aec 100644
--- a/y2019/vision/server/www/generate_camera.cc
+++ b/y2019/vision/server/www/generate_camera.cc
@@ -4,8 +4,7 @@
 #include "y2019/constants.h"
 #include "y2019/vision/constants.h"
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 void DumpPose(std::basic_ostream<char> *o, const vision::CameraGeometry &pose) {
   *o << "{x: " << pose.location[0] << ", y: " << pose.location[1]
      << ", theta: " << pose.heading << "}";
@@ -23,8 +22,7 @@
   }
   out_file << "];\n";
 }
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 
 int main(int argc, char *argv[]) {
   if (argc != 2) {
diff --git a/y2019/vision/target_finder.cc b/y2019/vision/target_finder.cc
index b59792c..7efc38a 100644
--- a/y2019/vision/target_finder.cc
+++ b/y2019/vision/target_finder.cc
@@ -6,8 +6,7 @@
 
 using namespace aos::vision;
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 TargetFinder::TargetFinder()
     : target_template_(Target::MakeTemplate()),
@@ -632,5 +631,4 @@
   return needs_update;
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
diff --git a/y2019/vision/target_geometry.cc b/y2019/vision/target_geometry.cc
index e562f49..52d9b8d 100644
--- a/y2019/vision/target_geometry.cc
+++ b/y2019/vision/target_geometry.cc
@@ -11,8 +11,7 @@
 using ceres::Solve;
 using ceres::Solver;
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 static constexpr double kInchesToMeters = 0.0254;
 
@@ -349,5 +348,4 @@
   return IR;
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
diff --git a/y2019/wpilib_interface.cc b/y2019/wpilib_interface.cc
index b3a5953..16102f4 100644
--- a/y2019/wpilib_interface.cc
+++ b/y2019/wpilib_interface.cc
@@ -66,8 +66,7 @@
 namespace chrono = ::std::chrono;
 using std::make_unique;
 
-namespace y2019 {
-namespace wpilib {
+namespace y2019::wpilib {
 namespace {
 
 constexpr double kMaxBringupPower = 12.0;
@@ -821,7 +820,6 @@
 };
 
 }  // namespace
-}  // namespace wpilib
-}  // namespace y2019
+}  // namespace y2019::wpilib
 
 AOS_ROBOT_CLASS(::y2019::wpilib::WPILibRobot);