From 4dfaccff88919fe69e7c418817ddd8ca9c6aefaa Mon Sep 17 00:00:00 2001 From: Sid Parikh Date: Mon, 13 Nov 2023 23:38:08 -0500 Subject: [PATCH 1/2] rect --- rj_geometry/include/rj_geometry/rect.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rj_geometry/include/rj_geometry/rect.hpp b/rj_geometry/include/rj_geometry/rect.hpp index 056e3a067fc..63bd8fe7c65 100644 --- a/rj_geometry/include/rj_geometry/rect.hpp +++ b/rj_geometry/include/rj_geometry/rect.hpp @@ -29,10 +29,10 @@ class Rect : public Shape { pt[1] = p2; } - Rect(const Rect& other) { - pt[0] = other.pt[0]; - pt[1] = other.pt[1]; - } + Rect(const Rect& other) = default; + Rect(Rect&& other) = default; + Rect& operator=(const Rect& other) = default; + Rect& operator=(Rect&& other) = default; Shape* clone() const override; From dbb031403508e8eec0631c9b0945aabe32363354 Mon Sep 17 00:00:00 2001 From: Sid Parikh Date: Mon, 13 Nov 2023 23:51:54 -0500 Subject: [PATCH 2/2] W-reorder-ctor --- soccer/src/rj_vision_filter/robot/kalman_robot.cpp | 8 ++++---- soccer/src/rj_vision_filter/robot/world_robot.cpp | 2 +- soccer/src/soccer/debug_drawer.hpp | 4 +--- .../soccer/planning/primitives/robo_cup_state_space.hpp | 5 ++--- soccer/src/soccer/processor.cpp | 2 +- soccer/src/soccer/radio/sim_radio.cpp | 4 ++-- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/soccer/src/rj_vision_filter/robot/kalman_robot.cpp b/soccer/src/rj_vision_filter/robot/kalman_robot.cpp index fc50545bb51..93e47a4044b 100644 --- a/soccer/src/rj_vision_filter/robot/kalman_robot.cpp +++ b/soccer/src/rj_vision_filter/robot/kalman_robot.cpp @@ -14,13 +14,13 @@ using kalman_robot::PARAM_max_time_outside_vision; KalmanRobot::KalmanRobot(unsigned int camera_id, RJ::Time creation_time, CameraRobot init_measurement, const WorldRobot& previous_world_robot) - : camera_id_(camera_id), - health_(filter::health::PARAM_init), - last_update_time_(creation_time), + : last_update_time_(creation_time), last_predict_time_(creation_time), + previous_measurements_(kick::detector::PARAM_slow_kick_hist_length), unwrap_theta_ctr_(0), + health_(filter::health::PARAM_init), robot_id_(init_measurement.get_robot_id()), - previous_measurements_(kick::detector::PARAM_slow_kick_hist_length) { + camera_id_(camera_id) { rj_geometry::Pose init_pose = init_measurement.get_pose(); rj_geometry::Twist init_twist(0, 0, 0); diff --git a/soccer/src/rj_vision_filter/robot/world_robot.cpp b/soccer/src/rj_vision_filter/robot/world_robot.cpp index 315f08d328f..60bb03ca10b 100644 --- a/soccer/src/rj_vision_filter/robot/world_robot.cpp +++ b/soccer/src/rj_vision_filter/robot/world_robot.cpp @@ -16,7 +16,7 @@ WorldRobot::WorldRobot() : is_valid_(false) {} WorldRobot::WorldRobot(RJ::Time calc_time, Team team, int robot_id, const std::list& kalman_robots) - : team_(team), robot_id_(robot_id), is_valid_(true), time_(calc_time) { + : team_(team), robot_id_(robot_id), time_(calc_time), is_valid_(true) { // Theta's are converted to rect coords then back to polar to convert rj_geometry::Point pos_cartesian_avg; rj_geometry::Point theta_cartesian_avg; diff --git a/soccer/src/soccer/debug_drawer.hpp b/soccer/src/soccer/debug_drawer.hpp index 7e12cd63b08..97a35245147 100644 --- a/soccer/src/soccer/debug_drawer.hpp +++ b/soccer/src/soccer/debug_drawer.hpp @@ -18,9 +18,7 @@ struct Context; class DebugDrawer { public: - DebugDrawer(Context* context) : context_(context), num_debug_layers_(0) { - reset_log_frame(); - } + DebugDrawer(Context* context) : num_debug_layers_(0), context_(context) { reset_log_frame(); } const QStringList& debug_layers() const { return debug_layers_; } diff --git a/soccer/src/soccer/planning/primitives/robo_cup_state_space.hpp b/soccer/src/soccer/planning/primitives/robo_cup_state_space.hpp index 3853d423b8a..9e84c9945fb 100644 --- a/soccer/src/soccer/planning/primitives/robo_cup_state_space.hpp +++ b/soccer/src/soccer/planning/primitives/robo_cup_state_space.hpp @@ -12,9 +12,8 @@ namespace planning { */ class RoboCupStateSpace : public RRT::StateSpace { public: - RoboCupStateSpace(const FieldDimensions& dims, - const rj_geometry::ShapeSet& obstacles) - : field_dimensions_(dims), obstacles_(obstacles) {} + RoboCupStateSpace(const FieldDimensions& dims, const rj_geometry::ShapeSet& obstacles) + : obstacles_(obstacles), field_dimensions_(dims) {} rj_geometry::Point randomState() const override { double x = field_dimensions_.floor_width() * (drand48() - 0.5f); diff --git a/soccer/src/soccer/processor.cpp b/soccer/src/soccer/processor.cpp index 62acc5eb63e..df947c2cdea 100644 --- a/soccer/src/soccer/processor.cpp +++ b/soccer/src/soccer/processor.cpp @@ -19,7 +19,7 @@ using namespace google::protobuf; FieldDimensions* current_dimensions = &FieldDimensions::current_dimensions; Processor::Processor(bool sim, bool blue_team, const std::string& read_log_file) - : loop_mutex_(), read_log_file_(read_log_file) { + : read_log_file_(read_log_file), loop_mutex_() { // Set the logger to ros2. rj_utils::set_spdlog_default_ros2("processor"); diff --git a/soccer/src/soccer/radio/sim_radio.cpp b/soccer/src/soccer/radio/sim_radio.cpp index 1eb4d8169a0..7fdd43524e0 100644 --- a/soccer/src/soccer/radio/sim_radio.cpp +++ b/soccer/src/soccer/radio/sim_radio.cpp @@ -70,9 +70,9 @@ static SimulatorCommand convert_placement_to_proto( SimRadio::SimRadio(bool blue_team) : Radio(), - blue_team_(blue_team), socket_(io_service_, ip::udp::endpoint(ip::udp::v4(), blue_team ? kSimBlueStatusPort - : kSimYellowStatusPort)) { + : kSimYellowStatusPort)), + blue_team_(blue_team) { for (size_t i = 0; i < kNumShells; ++i) { last_sent_diff_.emplace_back(RJ::now()); }