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/y2023/autonomous/auto_splines.h b/y2023/autonomous/auto_splines.h
index 6921e64..13c24c0 100644
--- a/y2023/autonomous/auto_splines.h
+++ b/y2023/autonomous/auto_splines.h
@@ -13,8 +13,7 @@
*/
-namespace y2023 {
-namespace autonomous {
+namespace y2023::autonomous {
class AutonomousSplines {
public:
@@ -95,7 +94,6 @@
aos::FlatbufferDetachedBuffer<frc971::MultiSpline> splinecable_4_;
};
-} // namespace autonomous
-} // namespace y2023
+} // namespace y2023::autonomous
#endif // Y2023_AUTONOMOUS_AUTO_SPLINES_H_
diff --git a/y2023/autonomous/autonomous_actor.h b/y2023/autonomous/autonomous_actor.h
index 5a5cd06..829cd0e 100644
--- a/y2023/autonomous/autonomous_actor.h
+++ b/y2023/autonomous/autonomous_actor.h
@@ -11,8 +11,7 @@
#include "y2023/control_loops/superstructure/superstructure_goal_generated.h"
#include "y2023/control_loops/superstructure/superstructure_status_generated.h"
-namespace y2023 {
-namespace autonomous {
+namespace y2023::autonomous {
class AutonomousActor
: public ::frc971::autonomous::UserButtonLocalizedAutonomousActor {
@@ -83,7 +82,6 @@
const ::std::vector<::Eigen::Matrix<double, 3, 1>> points_;
};
-} // namespace autonomous
-} // namespace y2023
+} // namespace y2023::autonomous
#endif // Y2023_AUTONOMOUS_AUTONOMOUS_ACTOR_H_
diff --git a/y2023/constants.h b/y2023/constants.h
index 92428db..402fc73 100644
--- a/y2023/constants.h
+++ b/y2023/constants.h
@@ -15,8 +15,7 @@
#include "y2023/control_loops/superstructure/roll/roll_plant.h"
#include "y2023/control_loops/superstructure/wrist/wrist_plant.h"
-namespace y2023 {
-namespace constants {
+namespace y2023::constants {
constexpr uint16_t kCompTeamNumber = 971;
constexpr uint16_t kPracticeTeamNumber = 9971;
@@ -236,7 +235,6 @@
// Calls MakeValues with aos::network::GetTeamNumber()
Values MakeValues();
-} // namespace constants
-} // namespace y2023
+} // namespace y2023::constants
#endif // Y2023_CONSTANTS_H_
diff --git a/y2023/control_loops/drivetrain/drivetrain_base.h b/y2023/control_loops/drivetrain/drivetrain_base.h
index 98f984e..00d4d0e 100644
--- a/y2023/control_loops/drivetrain/drivetrain_base.h
+++ b/y2023/control_loops/drivetrain/drivetrain_base.h
@@ -3,15 +3,11 @@
#include "frc971/control_loops/drivetrain/drivetrain_config.h"
-namespace y2023 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2023::control_loops::drivetrain {
const ::frc971::control_loops::drivetrain::DrivetrainConfig<double> &
GetDrivetrainConfig();
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2023
+} // namespace y2023::control_loops::drivetrain
#endif // Y2023_CONTROL_LOOPS_DRIVETRAIN_DRIVETRAIN_BASE_H_
diff --git a/y2023/control_loops/superstructure/arm/arm.h b/y2023/control_loops/superstructure/arm/arm.h
index 6153400..2160b38 100644
--- a/y2023/control_loops/superstructure/arm/arm.h
+++ b/y2023/control_loops/superstructure/arm/arm.h
@@ -15,10 +15,7 @@
using frc971::control_loops::arm::EKF;
-namespace y2023 {
-namespace control_loops {
-namespace superstructure {
-namespace arm {
+namespace y2023::control_loops::superstructure::arm {
class Arm {
public:
@@ -116,9 +113,6 @@
EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
};
-} // namespace arm
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2023
+} // namespace y2023::control_loops::superstructure::arm
#endif // Y2023_CONTROL_LOOPS_SUPERSTRUCTURE_ARM_ARM_H_
diff --git a/y2023/control_loops/superstructure/arm/arm_constants.h b/y2023/control_loops/superstructure/arm/arm_constants.h
index fc716af..d5b11cb 100644
--- a/y2023/control_loops/superstructure/arm/arm_constants.h
+++ b/y2023/control_loops/superstructure/arm/arm_constants.h
@@ -3,10 +3,7 @@
#include "frc971/control_loops/double_jointed_arm/dynamics.h"
-namespace y2023 {
-namespace control_loops {
-namespace superstructure {
-namespace arm {
+namespace y2023::control_loops::superstructure::arm {
constexpr double kEfficiencyTweak = 0.95;
constexpr double kStallTorque = 4.69 * kEfficiencyTweak;
@@ -45,9 +42,6 @@
.num_distal_motors = 1.0,
};
-} // namespace arm
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2023
+} // namespace y2023::control_loops::superstructure::arm
#endif // Y2023_CONTROL_LOOPS_SUPERSTRUCTURE_ARM_ARM_CONSTANTS_H_
diff --git a/y2023/control_loops/superstructure/arm/trajectory.h b/y2023/control_loops/superstructure/arm/trajectory.h
index 7994d60..7b56789 100644
--- a/y2023/control_loops/superstructure/arm/trajectory.h
+++ b/y2023/control_loops/superstructure/arm/trajectory.h
@@ -16,10 +16,7 @@
#include "frc971/control_loops/state_feedback_loop.h"
#include "y2023/control_loops/superstructure/arm/arm_trajectories_generated.h"
-namespace y2023 {
-namespace control_loops {
-namespace superstructure {
-namespace arm {
+namespace y2023::control_loops::superstructure::arm {
using frc971::control_loops::Binomial;
using frc971::control_loops::GaussianQuadrature5;
@@ -623,9 +620,6 @@
int failed_solutions_ = 0;
};
-} // namespace arm
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2023
+} // namespace y2023::control_loops::superstructure::arm
#endif // Y2023_CONTROL_LOOPS_SUPERSTRUCTURE_ARM_TRAJECTORY_H_
diff --git a/y2023/control_loops/superstructure/end_effector.h b/y2023/control_loops/superstructure/end_effector.h
index da0ce5e..04cde94 100644
--- a/y2023/control_loops/superstructure/end_effector.h
+++ b/y2023/control_loops/superstructure/end_effector.h
@@ -9,9 +9,7 @@
#include "y2023/control_loops/superstructure/superstructure_status_generated.h"
#include "y2023/vision/game_pieces_generated.h"
-namespace y2023 {
-namespace control_loops {
-namespace superstructure {
+namespace y2023::control_loops::superstructure {
class EndEffector {
public:
@@ -39,8 +37,6 @@
bool beambreak_;
};
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2023
+} // namespace y2023::control_loops::superstructure
#endif // Y2023_CONTROL_LOOPS_SUPERSTRUCTURE_END_EFFECTOR_H_
diff --git a/y2023/control_loops/superstructure/superstructure.h b/y2023/control_loops/superstructure/superstructure.h
index bcee3ea..349131b 100644
--- a/y2023/control_loops/superstructure/superstructure.h
+++ b/y2023/control_loops/superstructure/superstructure.h
@@ -22,9 +22,7 @@
using y2023::control_loops::superstructure::arm::ArmTrajectories;
using y2023::control_loops::superstructure::arm::TrajectoryAndParams;
-namespace y2023 {
-namespace control_loops {
-namespace superstructure {
+namespace y2023::control_loops::superstructure {
class Superstructure
: public ::frc971::controls::ControlLoop<Goal, Position, Status, Output> {
@@ -86,8 +84,6 @@
DISALLOW_COPY_AND_ASSIGN(Superstructure);
};
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2023
+} // namespace y2023::control_loops::superstructure
#endif // Y2023_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_
diff --git a/y2023/vision/aprilrobotics.h b/y2023/vision/aprilrobotics.h
index 123f352..e11bfcc 100644
--- a/y2023/vision/aprilrobotics.h
+++ b/y2023/vision/aprilrobotics.h
@@ -21,8 +21,7 @@
#include "frc971/vision/visualize_robot.h"
#include "y2023/constants/constants_generated.h"
-namespace y2023 {
-namespace vision {
+namespace y2023::vision {
class AprilRoboticsDetector {
public:
@@ -97,5 +96,4 @@
frc971::vision::VisualizeRobot vis_robot_;
};
-} // namespace vision
-} // namespace y2023
+} // namespace y2023::vision
diff --git a/y2023/vision/game_pieces.h b/y2023/vision/game_pieces.h
index 442d95c..45bf894 100644
--- a/y2023/vision/game_pieces.h
+++ b/y2023/vision/game_pieces.h
@@ -6,8 +6,7 @@
#include "y2023/vision/game_pieces_generated.h"
#include "y2023/vision/yolov5.h"
-namespace y2023 {
-namespace vision {
+namespace y2023::vision {
using namespace frc971::vision;
@@ -23,6 +22,5 @@
aos::Sender<GamePieces> game_pieces_sender_;
std::unique_ptr<YOLOV5> model;
};
-} // namespace vision
-} // namespace y2023
+} // namespace y2023::vision
#endif
diff --git a/y2023/vision/yolov5.h b/y2023/vision/yolov5.h
index 9853b4f..2d7f641 100644
--- a/y2023/vision/yolov5.h
+++ b/y2023/vision/yolov5.h
@@ -13,8 +13,7 @@
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
-namespace y2023 {
-namespace vision {
+namespace y2023::vision {
struct Detection {
cv::Rect box;
@@ -36,7 +35,6 @@
std::unique_ptr<YOLOV5> MakeYOLOV5();
-} // namespace vision
-} // namespace y2023
+} // namespace y2023::vision
#endif // Y2023_VISION_YOLOV5_H_