Nest some more namespaces

Did someone previously suggest that all namespace had been
nested?  Silly.

Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I22278c1caaeba8b47dc46fb2ed3078c20a11e190
diff --git a/y2019/actors/auto_splines.h b/y2019/actors/auto_splines.h
index 7b56c11..4d6fbc1 100644
--- a/y2019/actors/auto_splines.h
+++ b/y2019/actors/auto_splines.h
@@ -11,8 +11,7 @@
 
 */
 
-namespace y2019 {
-namespace actors {
+namespace y2019::actors {
 
 class AutonomousSplines {
  public:
@@ -88,7 +87,6 @@
           *builder);
 };
 
-}  // namespace actors
-}  // namespace y2019
+}  // namespace y2019::actors
 
 #endif  // Y2019_ACTORS_AUTO_SPLINES_H_
diff --git a/y2019/actors/autonomous_actor.h b/y2019/actors/autonomous_actor.h
index 99b1364..53aa9de 100644
--- a/y2019/actors/autonomous_actor.h
+++ b/y2019/actors/autonomous_actor.h
@@ -13,8 +13,7 @@
 #include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
 #include "y2019/control_loops/superstructure/superstructure_status_generated.h"
 
-namespace y2019 {
-namespace actors {
+namespace y2019::actors {
 
 using ::frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystemGoal;
 
@@ -250,7 +249,6 @@
       superstructure_status_fetcher_;
 };
 
-}  // namespace actors
-}  // namespace y2019
+}  // namespace y2019::actors
 
 #endif  // Y2019_ACTORS_AUTONOMOUS_ACTOR_H_
diff --git a/y2019/constants.h b/y2019/constants.h
index a36e4b3..0555d4e 100644
--- a/y2019/constants.h
+++ b/y2019/constants.h
@@ -17,8 +17,7 @@
 #include "y2019/control_loops/superstructure/stilts/stilts_plant.h"
 #include "y2019/control_loops/superstructure/wrist/wrist_plant.h"
 
-namespace y2019 {
-namespace constants {
+namespace y2019::constants {
 
 // Has all of our "constants", except the ones that come from other places. The
 // ones which change between robots are put together with a workable way to
@@ -215,7 +214,6 @@
 // them.
 const Values &GetValuesForTeam(uint16_t team_number);
 
-}  // namespace constants
-}  // namespace y2019
+}  // namespace y2019::constants
 
 #endif  // Y2019_CONSTANTS_H_
diff --git a/y2019/control_loops/drivetrain/drivetrain_base.h b/y2019/control_loops/drivetrain/drivetrain_base.h
index 3a8bd6b..80aa1a8 100644
--- a/y2019/control_loops/drivetrain/drivetrain_base.h
+++ b/y2019/control_loops/drivetrain/drivetrain_base.h
@@ -3,15 +3,11 @@
 
 #include "frc971/control_loops/drivetrain/drivetrain_config.h"
 
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2019::control_loops::drivetrain {
 
 const ::frc971::control_loops::drivetrain::DrivetrainConfig<double> &
 GetDrivetrainConfig();
 
-}  // namespace drivetrain
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::drivetrain
 
 #endif  // Y2019_CONTROL_LOOPS_DRIVETRAIN_DRIVETRAIN_BASE_H_
diff --git a/y2019/control_loops/drivetrain/event_loop_localizer.h b/y2019/control_loops/drivetrain/event_loop_localizer.h
index 0847479..61caf87 100644
--- a/y2019/control_loops/drivetrain/event_loop_localizer.h
+++ b/y2019/control_loops/drivetrain/event_loop_localizer.h
@@ -7,9 +7,7 @@
 #include "y2019/control_loops/drivetrain/localizer.h"
 #include "y2019/control_loops/drivetrain/target_selector.h"
 
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2019::control_loops::drivetrain {
 
 // Wrap the localizer to allow it to fetch camera frames from the queues.
 // TODO(james): Provide a way of resetting the current position and
@@ -89,7 +87,5 @@
 ::std::array<EventLoopLocalizer::Camera, constants::Values::kNumCameras>
 MakeCameras(EventLoopLocalizer::Pose *pose);
 
-}  // namespace drivetrain
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::drivetrain
 #endif  // Y2019_CONTROL_LOOPS_DRIVETRAIN_EVENT_LOOP_LOCALIZER_H_
diff --git a/y2019/control_loops/drivetrain/localizer.h b/y2019/control_loops/drivetrain/localizer.h
index 2e7c3a5..f4c7a8a 100644
--- a/y2019/control_loops/drivetrain/localizer.h
+++ b/y2019/control_loops/drivetrain/localizer.h
@@ -17,8 +17,7 @@
 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #endif
 
-namespace y2019 {
-namespace control_loops {
+namespace y2019::control_loops {
 
 template <int num_cameras, int num_targets, int num_obstacles,
           int max_targets_per_frame, typename Scalar = double>
@@ -576,7 +575,6 @@
 #pragma GCC diagnostic pop
 #endif
 
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops
 
 #endif  // Y2019_CONTROL_LOOPS_DRIVETRAIN_LOCALIZATER_H_
diff --git a/y2019/control_loops/drivetrain/target_selector.h b/y2019/control_loops/drivetrain/target_selector.h
index b8d89c7..ba6d970 100644
--- a/y2019/control_loops/drivetrain/target_selector.h
+++ b/y2019/control_loops/drivetrain/target_selector.h
@@ -8,8 +8,7 @@
 #include "y2019/control_loops/drivetrain/target_selector_generated.h"
 #include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
 
-namespace y2019 {
-namespace control_loops {
+namespace y2019::control_loops {
 
 // A class to identify which target the driver is currently driving towards so
 // that we can guide them into the target.
@@ -75,7 +74,6 @@
   drivetrain::SelectionHint target_hint_ = drivetrain::SelectionHint::NONE;
 };
 
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops
 
 #endif  // Y2019_CONTROL_LOOPS_DRIVETRAIN_TARGET_SELECTOR_H_
diff --git a/y2019/control_loops/superstructure/collision_avoidance.h b/y2019/control_loops/superstructure/collision_avoidance.h
index ac88cec..e872e8c 100644
--- a/y2019/control_loops/superstructure/collision_avoidance.h
+++ b/y2019/control_loops/superstructure/collision_avoidance.h
@@ -9,9 +9,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 {
 
 // CollisionAvoidance computes the min and max allowable ranges for various
 // subsystems to avoid collisions.  It also shoves the elevator up to let the
@@ -108,8 +106,6 @@
   double max_intake_goal_;
 };
 
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::superstructure
 
 #endif  // Y2019_CONTROL_LOOPS_SUPERSTRUCTURE_COLLISION_AVOIDANCE_H_
diff --git a/y2019/control_loops/superstructure/superstructure.h b/y2019/control_loops/superstructure/superstructure.h
index 4d59132..ab80eb4 100644
--- a/y2019/control_loops/superstructure/superstructure.h
+++ b/y2019/control_loops/superstructure/superstructure.h
@@ -16,9 +16,7 @@
 #include "y2019/control_loops/superstructure/vacuum.h"
 #include "y2019/status_light_generated.h"
 
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
+namespace y2019::control_loops::superstructure {
 
 class Superstructure
     : public ::frc971::controls::ControlLoop<Goal, Position, Status, Output> {
@@ -68,8 +66,6 @@
   DISALLOW_COPY_AND_ASSIGN(Superstructure);
 };
 
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::superstructure
 
 #endif  // Y2019_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_
diff --git a/y2019/control_loops/superstructure/vacuum.h b/y2019/control_loops/superstructure/vacuum.h
index c4671ab..58ad109 100644
--- a/y2019/control_loops/superstructure/vacuum.h
+++ b/y2019/control_loops/superstructure/vacuum.h
@@ -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 {
 
 class Vacuum {
  public:
@@ -55,8 +53,6 @@
   DISALLOW_COPY_AND_ASSIGN(Vacuum);
 };
 
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2019
+}  // namespace y2019::control_loops::superstructure
 
 #endif  // Y2019_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_
diff --git a/y2019/jevois/camera/image_stream.h b/y2019/jevois/camera/image_stream.h
index f1ab0af..5b29070 100644
--- a/y2019/jevois/camera/image_stream.h
+++ b/y2019/jevois/camera/image_stream.h
@@ -7,8 +7,7 @@
 #include "aos/vision/image/camera_params.pb.h"
 #include "y2019/jevois/camera/reader.h"
 
-namespace y2019 {
-namespace camera {
+namespace y2019::camera {
 
 // Converts a camera reader into a virtual base class that calls ProcessImage
 // on each new image.
@@ -48,7 +47,6 @@
   std::unique_ptr<Reader> reader_;
 };
 
-}  // namespace camera
-}  // namespace y2019
+}  // namespace y2019::camera
 
 #endif  // Y2019_JEVOIS_CAMERA_IMAGE_STREAM_H_
diff --git a/y2019/jevois/camera/reader.h b/y2019/jevois/camera/reader.h
index ef4f34d..77f0799 100644
--- a/y2019/jevois/camera/reader.h
+++ b/y2019/jevois/camera/reader.h
@@ -10,8 +10,7 @@
 #include "aos/vision/image/camera_params.pb.h"
 #include "aos/vision/image/image_types.h"
 
-namespace y2019 {
-namespace camera {
+namespace y2019::camera {
 
 aos::vision::CameraParams MakeCameraParams(int32_t width, int32_t height,
                                            int32_t exposure, int32_t brightness,
@@ -65,7 +64,6 @@
   aos::vision::CameraParams params_;
 };
 
-}  // namespace camera
-}  // namespace y2019
+}  // namespace y2019::camera
 
 #endif  // AOS_VISION_IMAGE_READER_H_
diff --git a/y2019/jevois/cobs.h b/y2019/jevois/cobs.h
index c429622..271a41f 100644
--- a/y2019/jevois/cobs.h
+++ b/y2019/jevois/cobs.h
@@ -11,8 +11,7 @@
 // Stuffing data. <http://www.stuartcheshire.org/papers/cobsforton.pdf> has
 // details on what this entails and why it's a good idea.
 
-namespace frc971 {
-namespace jevois {
+namespace frc971::jevois {
 
 constexpr size_t CobsMaxEncodedSize(size_t decoded_size) {
   return decoded_size + ((decoded_size + 253) / 254);
@@ -213,7 +212,6 @@
   }
 }
 
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois
 
 #endif  // Y2019_JEVOIS_COBS_H_
diff --git a/y2019/jevois/spi.h b/y2019/jevois/spi.h
index 62e5ea7..fd999de 100644
--- a/y2019/jevois/spi.h
+++ b/y2019/jevois/spi.h
@@ -14,8 +14,7 @@
 //
 // Our SPI transfers are fixed-size to simplify everything.
 
-namespace frc971 {
-namespace jevois {
+namespace frc971::jevois {
 
 constexpr size_t spi_transfer_size() {
   // The teensy->RoboRIO side is way bigger, so just calculate that.
@@ -33,7 +32,6 @@
 std::optional<RoborioToTeensy> SpiUnpackToTeensy(
     absl::Span<const char> transfer);
 
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois
 
 #endif  // Y2019_JEVOIS_SPI_H_
diff --git a/y2019/jevois/structures.h b/y2019/jevois/structures.h
index 85cca21..a8d2843 100644
--- a/y2019/jevois/structures.h
+++ b/y2019/jevois/structures.h
@@ -11,8 +11,7 @@
 #include "aos/containers/sized_array.h"
 #include "aos/time/time.h"
 
-namespace frc971 {
-namespace jevois {
+namespace frc971::jevois {
 
 // The overall flow to get data to the roboRIO consists of:
 //  1.  Camera captures a frame and grabs an absolute timestamp.
@@ -233,7 +232,6 @@
   CameraCommand camera_command;
 };
 
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois
 
 #endif  // Y2019_JEVOIS_STRUCTURES_H_
diff --git a/y2019/jevois/uart.h b/y2019/jevois/uart.h
index d3eebee..7bacbd1 100644
--- a/y2019/jevois/uart.h
+++ b/y2019/jevois/uart.h
@@ -12,8 +12,7 @@
 // This file manages serializing and deserializing the various structures for
 // transport via UART.
 
-namespace frc971 {
-namespace jevois {
+namespace frc971::jevois {
 
 constexpr size_t uart_to_teensy_size() {
   return 1 /* number of targets */ +
@@ -38,7 +37,6 @@
 std::optional<CameraCalibration> UartUnpackToCamera(
     absl::Span<const char> buffer);
 
-}  // namespace jevois
-}  // namespace frc971
+}  // namespace frc971::jevois
 
 #endif  // Y2019_JEVOIS_UART_H_
diff --git a/y2019/joystick_angle.h b/y2019/joystick_angle.h
index dfd8bb9..2dad968 100644
--- a/y2019/joystick_angle.h
+++ b/y2019/joystick_angle.h
@@ -6,9 +6,7 @@
 using ::frc971::input::driver_station::Data;
 using ::frc971::input::driver_station::JoystickAxis;
 
-namespace y2019 {
-namespace input {
-namespace joysticks {
+namespace y2019::input::joysticks {
 bool AngleCloseTo(double angle, double near, double range);
 
 enum class JoystickAngle {
@@ -25,8 +23,6 @@
                                   const JoystickAxis &y_axis, const Data &data);
 JoystickAngle GetJoystickPosition(float x_axis, float y_axis);
 
-}  // namespace joysticks
-}  // namespace input
-}  // namespace y2019
+}  // namespace y2019::input::joysticks
 
 #endif  // Y2019_JOYSTICK_ANGLE_H_
diff --git a/y2019/vision/constants.h b/y2019/vision/constants.h
index 959f5b7..7078d6b 100644
--- a/y2019/vision/constants.h
+++ b/y2019/vision/constants.h
@@ -6,8 +6,7 @@
 #include <cstdint>
 #include <string>
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 // Position of the idealized camera in 3d space.
 struct CameraGeometry {
@@ -107,7 +106,6 @@
 void DumpCameraConstants(const char *fname, int camera_id,
                          const CameraCalibration &value);
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 
 #endif  // _Y2019_VISION_CONSTANTS_H_
diff --git a/y2019/vision/image_writer.h b/y2019/vision/image_writer.h
index 1192368..27dcb4a 100644
--- a/y2019/vision/image_writer.h
+++ b/y2019/vision/image_writer.h
@@ -5,8 +5,7 @@
 
 #include "aos/vision/image/image_types.h"
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 class ImageWriter {
  public:
@@ -23,7 +22,6 @@
   unsigned int image_count_ = 0;
 };
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 
 #endif  // Y2019_VISION_IMAGE_WRITER_H_
diff --git a/y2019/vision/target_finder.h b/y2019/vision/target_finder.h
index fdcfbde..20bf87a 100644
--- a/y2019/vision/target_finder.h
+++ b/y2019/vision/target_finder.h
@@ -16,8 +16,7 @@
 class Context;
 
 }  // namespace ceres
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 using aos::vision::BlobList;
 using aos::vision::ContourNode;
@@ -115,7 +114,6 @@
   int current_exposure_ = 0;
 };
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 
 #endif
diff --git a/y2019/vision/target_types.h b/y2019/vision/target_types.h
index 5019646..fb57b71 100644
--- a/y2019/vision/target_types.h
+++ b/y2019/vision/target_types.h
@@ -7,8 +7,7 @@
 #include "aos/vision/math/vector.h"
 #include "y2019/vision/constants.h"
 
-namespace y2019 {
-namespace vision {
+namespace y2019::vision {
 
 // This polynomial exists in transpose space.
 struct TargetComponent {
@@ -239,7 +238,6 @@
                                   240.0 - res.y() * scale);
 }
 
-}  // namespace vision
-}  // namespace y2019
+}  // namespace y2019::vision
 
 #endif