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/y2020/actors/auto_splines.h b/y2020/actors/auto_splines.h
index e7bef0a..396fe4b 100644
--- a/y2020/actors/auto_splines.h
+++ b/y2020/actors/auto_splines.h
@@ -13,8 +13,7 @@
*/
-namespace y2020 {
-namespace actors {
+namespace y2020::actors {
class AutonomousSplines {
public:
@@ -89,7 +88,6 @@
aos::FlatbufferDetachedBuffer<frc971::MultiSpline> far_side_fender_;
};
-} // namespace actors
-} // namespace y2020
+} // namespace y2020::actors
#endif // y2020_ACTORS_AUTO_SPLINES_H_
diff --git a/y2020/actors/autonomous_actor.h b/y2020/actors/autonomous_actor.h
index abf9ea0..9368a8e 100644
--- a/y2020/actors/autonomous_actor.h
+++ b/y2020/actors/autonomous_actor.h
@@ -11,8 +11,7 @@
#include "y2020/control_loops/superstructure/superstructure_goal_generated.h"
#include "y2020/control_loops/superstructure/superstructure_status_generated.h"
-namespace y2020 {
-namespace actors {
+namespace y2020::actors {
using frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystemGoal;
@@ -104,7 +103,6 @@
std::optional<Eigen::Vector3d> starting_position_;
};
-} // namespace actors
-} // namespace y2020
+} // namespace y2020::actors
#endif // y2020_ACTORS_AUTONOMOUS_ACTOR_H_
diff --git a/y2020/constants.h b/y2020/constants.h
index 7332b4f..efae264 100644
--- a/y2020/constants.h
+++ b/y2020/constants.h
@@ -21,8 +21,7 @@
using ::frc971::shooter_interpolation::InterpolationTable;
-namespace y2020 {
-namespace constants {
+namespace y2020::constants {
struct Values {
static const uint16_t kCompTeamNumber = 971;
@@ -241,7 +240,6 @@
// InitValues() before calling this.
const Values &GetValues();
-} // namespace constants
-} // namespace y2020
+} // namespace y2020::constants
#endif // y2020_CONSTANTS_H_
diff --git a/y2020/control_loops/drivetrain/drivetrain_base.h b/y2020/control_loops/drivetrain/drivetrain_base.h
index e35c2af..321e7cc 100644
--- a/y2020/control_loops/drivetrain/drivetrain_base.h
+++ b/y2020/control_loops/drivetrain/drivetrain_base.h
@@ -3,15 +3,11 @@
#include "frc971/control_loops/drivetrain/drivetrain_config.h"
-namespace y2020 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2020::control_loops::drivetrain {
const ::frc971::control_loops::drivetrain::DrivetrainConfig<double> &
GetDrivetrainConfig();
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::drivetrain
#endif // y2020_CONTROL_LOOPS_DRIVETRAIN_DRIVETRAIN_BASE_H_
diff --git a/y2020/control_loops/drivetrain/localizer.h b/y2020/control_loops/drivetrain/localizer.h
index de57091..bc12fd6 100644
--- a/y2020/control_loops/drivetrain/localizer.h
+++ b/y2020/control_loops/drivetrain/localizer.h
@@ -13,9 +13,7 @@
#include "y2020/control_loops/superstructure/superstructure_status_generated.h"
#include "y2020/vision/sift/sift_generated.h"
-namespace y2020 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2020::control_loops::drivetrain {
// This class handles the localization for the 2020 robot. In order to handle
// camera updates, we get the ImageMatchResult message from the cameras and then
@@ -164,8 +162,6 @@
Statistics statistics_;
};
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::drivetrain
#endif // Y2020_CONTROL_LOOPS_DRIVETRAIN_LOCALIZER_H_
diff --git a/y2020/control_loops/superstructure/shooter/shooter.h b/y2020/control_loops/superstructure/shooter/shooter.h
index a1d7be3..3280c69 100644
--- a/y2020/control_loops/superstructure/shooter/shooter.h
+++ b/y2020/control_loops/superstructure/shooter/shooter.h
@@ -9,10 +9,7 @@
#include "y2020/control_loops/superstructure/superstructure_position_generated.h"
#include "y2020/control_loops/superstructure/superstructure_status_generated.h"
-namespace y2020 {
-namespace control_loops {
-namespace superstructure {
-namespace shooter {
+namespace y2020::control_loops::superstructure::shooter {
// Handles all flywheels together.
class Shooter {
@@ -60,9 +57,6 @@
DISALLOW_COPY_AND_ASSIGN(Shooter);
};
-} // namespace shooter
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::superstructure::shooter
#endif // Y2020_CONTROL_LOOPS_SHOOTER_SHOOTER_H_
diff --git a/y2020/control_loops/superstructure/superstructure.h b/y2020/control_loops/superstructure/superstructure.h
index 8a00bf0..ff38770 100644
--- a/y2020/control_loops/superstructure/superstructure.h
+++ b/y2020/control_loops/superstructure/superstructure.h
@@ -17,9 +17,7 @@
#include "y2020/control_loops/superstructure/superstructure_status_generated.h"
#include "y2020/control_loops/superstructure/turret/aiming.h"
-namespace y2020 {
-namespace control_loops {
-namespace superstructure {
+namespace y2020::control_loops::superstructure {
class Superstructure
: public ::frc971::controls::ControlLoop<Goal, Position, Status, Output> {
@@ -88,8 +86,6 @@
DISALLOW_COPY_AND_ASSIGN(Superstructure);
};
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::superstructure
#endif // y2020_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_
diff --git a/y2020/control_loops/superstructure/turret/aiming.h b/y2020/control_loops/superstructure/turret/aiming.h
index 45f690f..98ebb2f 100644
--- a/y2020/control_loops/superstructure/turret/aiming.h
+++ b/y2020/control_loops/superstructure/turret/aiming.h
@@ -9,10 +9,7 @@
#include "frc971/input/joystick_state_generated.h"
#include "y2020/control_loops/superstructure/superstructure_status_generated.h"
-namespace y2020 {
-namespace control_loops {
-namespace superstructure {
-namespace turret {
+namespace y2020::control_loops::superstructure::turret {
// Returns the port that we want to score on given our current alliance. The yaw
// of the port will be such that the positive x axis points out the back of the
@@ -68,8 +65,5 @@
Eigen::Matrix<double, 2, 2> Tlr_to_la_;
};
-} // namespace turret
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::superstructure::turret
#endif // y2020_CONTROL_LOOPS_SUPERSTRUCTURE_TURRET_AIMING_H_
diff --git a/y2020/vision/camera_reader.h b/y2020/vision/camera_reader.h
index 9a8cf6f..81dfa1a 100644
--- a/y2020/vision/camera_reader.h
+++ b/y2020/vision/camera_reader.h
@@ -17,8 +17,7 @@
#include "y2020/vision/sift/sift_training_generated.h"
#include "y2020/vision/tools/python_code/sift_training_data.h"
-namespace frc971 {
-namespace vision {
+namespace frc971::vision {
class CameraReader {
public:
@@ -170,6 +169,5 @@
new frc971::vision::SIFT971_Impl()};
};
-} // namespace vision
-} // namespace frc971
+} // namespace frc971::vision
#endif // Y2020_VISION_CAMERA_READER_H_
diff --git a/y2020/vision/sift/fast_gaussian.h b/y2020/vision/sift/fast_gaussian.h
index f243e53..d9a5f07 100644
--- a/y2020/vision/sift/fast_gaussian.h
+++ b/y2020/vision/sift/fast_gaussian.h
@@ -8,8 +8,7 @@
#include "HalideBuffer.h"
-namespace frc971 {
-namespace vision {
+namespace frc971::vision {
// Returns a Halide buffer representing the data in mat.
template <typename T>
@@ -39,7 +38,6 @@
void FastGaussianAndSubtract(const cv::Mat &source, cv::Mat *blurred,
cv::Mat *difference, double sigma);
-} // namespace vision
-} // namespace frc971
+} // namespace frc971::vision
#endif // Y2020_VISION_SIFT_FAST_GAUSSIAN_H_
diff --git a/y2020/vision/sift/get_gaussian_kernel.h b/y2020/vision/sift/get_gaussian_kernel.h
index c13c588..9252e24 100644
--- a/y2020/vision/sift/get_gaussian_kernel.h
+++ b/y2020/vision/sift/get_gaussian_kernel.h
@@ -4,8 +4,7 @@
#include <cmath>
#include <vector>
-namespace frc971 {
-namespace vision {
+namespace frc971::vision {
// A reimplementation of cv::getGaussianKernel for CV_32F without external
// dependencies. See fast_gaussian_halide_generator.sh for details why we want
@@ -24,7 +23,6 @@
return result;
}
-} // namespace vision
-} // namespace frc971
+} // namespace frc971::vision
#endif // Y2020_VISION_SIFT_GET_GAUSSIAN_KERNEL_H_
diff --git a/y2020/vision/sift/sift971.h b/y2020/vision/sift/sift971.h
index b351d70..a235afb 100644
--- a/y2020/vision/sift/sift971.h
+++ b/y2020/vision/sift/sift971.h
@@ -6,8 +6,7 @@
#include <opencv2/core/types.hpp>
#include <opencv2/features2d.hpp>
-namespace frc971 {
-namespace vision {
+namespace frc971::vision {
/*!
SIFT implementation.
@@ -66,7 +65,6 @@
bool use_fast_pyramid_difference_ = true;
};
-} // namespace vision
-} // namespace frc971
+} // namespace frc971::vision
#endif // Y2020_VISION_SIFT_SIFT971_H_