From 7a5207d2f468908eeaa6f363d0a5735fffd9435c Mon Sep 17 00:00:00 2001 From: Taiga Takano Date: Tue, 19 Nov 2024 20:34:43 +0900 Subject: [PATCH 1/9] Replace the redundant type with "auto". --- .../openscenario_visualization_condition_groups_plugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp index 0d1c54a46f5..7c53a12c9f8 100644 --- a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp +++ b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp @@ -60,21 +60,21 @@ VisualizationConditionGroupsDisplay::VisualizationConditionGroupsDisplay() * The purpose of this calculation is to position the top edge of the panel at an appropriate place on the screen, * again scaling according to screen resolution to maintain a consistent look across different devices. */ - const int top = static_cast(std::round(450 * scale)); + const auto top = static_cast(std::round(450 * scale)); /** * @note Define initial value of horizontal length of condition results panel. * The reason 2000 is hard-coded here is because that number displayed most beautifully when we tested the operation on a 4K/non 4K display. * Also, this number can be set via the rviz GUI. */ - const int length = static_cast(std::round(2000 * scale)); + const auto length = static_cast(std::round(2000 * scale)); /** * @note Define initial value of width of condition results panel. * The reason 2000 is hard-coded here is because that number displayed most beautifully when we tested the operation on a 4K/non 4K display. * Also, this number can be set via the rviz GUI. */ - const int width = static_cast(std::round(2000 * scale)); + const auto width = static_cast(std::round(2000 * scale)); property_topic_name_ = std::make_unique( "Topic", "/simulation/context", "The topic on which to publish simulation context.", this, From ece15207d18ac19d8f632acb67aa0bdfcb610999 Mon Sep 17 00:00:00 2001 From: Taiga Takano Date: Tue, 19 Nov 2024 20:35:22 +0900 Subject: [PATCH 2/9] implicit conversion loses floating-point precision: 'double' to 'float' --- .../openscenario_visualization_condition_groups_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp index 7c53a12c9f8..0b2dd16792f 100644 --- a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp +++ b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp @@ -48,7 +48,7 @@ VisualizationConditionGroupsDisplay::VisualizationConditionGroupsDisplay() * but the initial value of 35.0 is set to ensure a default size that is likely suitable for most screens. * The scaling factor adjusts this size to ensure readability across various resolutions. */ - const float text_size = scale * 35.0; + const float text_size = scale * 35.0f; /// @note Define initial value of left edge position of condition results panel const int left = 0; @@ -99,7 +99,7 @@ VisualizationConditionGroupsDisplay::VisualizationConditionGroupsDisplay() "This property controls the scaling factor for the text size on the panel. Setting a higher " "value results in larger text, making the displayed information easier to read.", this, SLOT(updateVisualization()), this); - property_value_scale_->setMin(0.01); + property_value_scale_->setMin(0.01f); } VisualizationConditionGroupsDisplay::~VisualizationConditionGroupsDisplay() From fcaccef95d986b0200a68425de7342b8181af002 Mon Sep 17 00:00:00 2001 From: Taiga Takano Date: Tue, 19 Nov 2024 20:43:53 +0900 Subject: [PATCH 3/9] Remove this redundant cast. --- .../openscenario_visualization_condition_groups_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp index 0b2dd16792f..a5b13ac1e43 100644 --- a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp +++ b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp @@ -174,7 +174,7 @@ void VisualizationConditionGroupsDisplay::processMessage(const Context::ConstSha // QColor text_color = property_text_color_->getColor(); QColor text_color(property_text_color_->getColor()); text_color.setAlpha(255); - painter.setPen(QPen(text_color, static_cast(2), Qt::SolidLine)); + painter.setPen(QPen(text_color, 2, Qt::SolidLine)); QFont font = painter.font(); font.setPixelSize(std::max(static_cast(property_value_scale_->getFloat()), 1)); font.setBold(true); From b6c99767c537955f12e345fd0ac62ab8a974d8f4 Mon Sep 17 00:00:00 2001 From: Taiga Takano Date: Tue, 19 Nov 2024 20:45:42 +0900 Subject: [PATCH 4/9] remove unused exception parameter 'e' --- .../openscenario_visualization_condition_groups_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp index a5b13ac1e43..f398518a3b7 100644 --- a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp +++ b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp @@ -262,7 +262,7 @@ void VisualizationConditionGroupsDisplay::processEvent(const YAML::Node & event_ std::string event_name; try { event_name = event_node["name"].as(); - } catch (const YAML::BadConversion & e) { + } catch (const YAML::BadConversion & ) { event_name = ""; } if (event_name.empty()) { From a1d558309aab9c3caecdb71ae3cafc5392d862ed Mon Sep 17 00:00:00 2001 From: Taiga Takano Date: Thu, 21 Nov 2024 17:15:47 +0900 Subject: [PATCH 5/9] fix sonor cloud issue (#1455) --- .../src/spline/catmull_rom_spline.cpp | 24 +++++++++---------- ..._visualization_condition_groups_plugin.cpp | 3 +-- .../visualization/visualization_component.cpp | 9 ++++--- .../random_test_runner/lanelet_utils.hpp | 12 +++++----- .../metrics/ego_collision_metric.hpp | 4 ++-- .../random_test_runner/src/lanelet_utils.cpp | 18 +++++++------- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/common/math/geometry/src/spline/catmull_rom_spline.cpp b/common/math/geometry/src/spline/catmull_rom_spline.cpp index d9cd6025150..3e0b2078730 100644 --- a/common/math/geometry/src/spline/catmull_rom_spline.cpp +++ b/common/math/geometry/src/spline/catmull_rom_spline.cpp @@ -470,8 +470,8 @@ auto CatmullRomSpline::getSquaredDistanceIn2D( } return line_segments_[0].getSquaredDistanceIn2D(point, s, true); default: - const auto index_and_s = getCurveIndexAndS(s); - return curves_[index_and_s.first].getSquaredDistanceIn2D(point, index_and_s.second, true); + const auto [index, sValue] = getCurveIndexAndS(s); + return curves_[index].getSquaredDistanceIn2D(point, sValue, true); } } @@ -508,8 +508,8 @@ auto CatmullRomSpline::getSquaredDistanceVector( } return line_segments_[0].getSquaredDistanceVector(point, s, true); default: - const auto index_and_s = getCurveIndexAndS(s); - return curves_[index_and_s.first].getSquaredDistanceVector(point, index_and_s.second, true); + const auto [index, sValue] = getCurveIndexAndS(s); + return curves_[index].getSquaredDistanceVector(point, sValue, true); } } @@ -542,8 +542,8 @@ auto CatmullRomSpline::getPoint(const double s) const -> geometry_msgs::msg::Poi } return line_segments_[0].getPoint(s, true); default: - const auto index_and_s = getCurveIndexAndS(s); - return curves_[index_and_s.first].getPoint(index_and_s.second, true); + const auto [index, sValue] = getCurveIndexAndS(s); + return curves_[index].getPoint(sValue, true); } } @@ -597,8 +597,8 @@ auto CatmullRomSpline::getNormalVector(const double s) const -> geometry_msgs::m "This message is not originally intended to be displayed, if you see it, please " "contact the developer of traffic_simulator."); default: - const auto index_and_s = getCurveIndexAndS(s); - return curves_[index_and_s.first].getNormalVector(index_and_s.second, true); + const auto [index, sValue] = getCurveIndexAndS(s); + return curves_[index].getNormalVector(sValue, true); } } @@ -634,8 +634,8 @@ auto CatmullRomSpline::getTangentVector(const double s) const -> geometry_msgs:: "This message is not originally intended to be displayed, if you see it, please " "contact the developer of traffic_simulator."); default: - const auto index_and_s = getCurveIndexAndS(s); - return curves_[index_and_s.first].getTangentVector(index_and_s.second, true); + const auto [index, sValue] = getCurveIndexAndS(s); + return curves_[index].getTangentVector(sValue, true); } } @@ -665,8 +665,8 @@ auto CatmullRomSpline::getPose(const double s, const bool fill_pitch) const } return line_segments_[0].getPose(s, true, fill_pitch); default: - const auto index_and_s = getCurveIndexAndS(s); - return curves_[index_and_s.first].getPose(index_and_s.second, true, fill_pitch); + const auto [index, sValue] = getCurveIndexAndS(s); + return curves_[index].getPose(sValue, true, fill_pitch); } } diff --git a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp index f398518a3b7..2c9cf6dd306 100644 --- a/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp +++ b/rviz_plugins/openscenario_visualization/src/openscenario_visualization_condition_groups_plugin/openscenario_visualization_condition_groups_plugin.cpp @@ -171,7 +171,6 @@ void VisualizationConditionGroupsDisplay::processMessage(const Context::ConstSha QPainter painter(&hud); painter.setRenderHint(QPainter::Antialiasing, true); - // QColor text_color = property_text_color_->getColor(); QColor text_color(property_text_color_->getColor()); text_color.setAlpha(255); painter.setPen(QPen(text_color, 2, Qt::SolidLine)); @@ -262,7 +261,7 @@ void VisualizationConditionGroupsDisplay::processEvent(const YAML::Node & event_ std::string event_name; try { event_name = event_node["name"].as(); - } catch (const YAML::BadConversion & ) { + } catch (const YAML::BadConversion &) { event_name = ""; } if (event_name.empty()) { diff --git a/simulation/traffic_simulator/src/visualization/visualization_component.cpp b/simulation/traffic_simulator/src/visualization/visualization_component.cpp index 2af92b13bfe..15d276bf272 100644 --- a/simulation/traffic_simulator/src/visualization/visualization_component.cpp +++ b/simulation/traffic_simulator/src/visualization/visualization_component.cpp @@ -74,14 +74,14 @@ void VisualizationComponent::entityStatusCallback( entity_name_lists.emplace_back(data.status.name); } std::vector erase_names; - for (const auto & marker : markers_) { - auto itr = std::find(entity_name_lists.begin(), entity_name_lists.end(), marker.first); + for (const auto & [key, marker] : markers_) { + auto itr = std::find(entity_name_lists.begin(), entity_name_lists.end(), key); if (itr == entity_name_lists.end()) { - auto delete_marker = generateDeleteMarker(marker.first); + auto delete_marker = generateDeleteMarker(key); std::copy( delete_marker.markers.begin(), delete_marker.markers.end(), std::back_inserter(current_marker.markers)); - erase_names.emplace_back(marker.first); + erase_names.emplace_back(key); } } for (const auto & name : erase_names) { @@ -336,7 +336,6 @@ const visualization_msgs::msg::MarkerArray VisualizationComponent::generateMarke arrow.id = 2; arrow.action = visualization_msgs::msg::Marker::ADD; - // constexpr double arrow_size = 0.3; double arrow_size = 0.4 * status.bounding_box.dimensions.y; constexpr double arrow_ratio = 1.0; geometry_msgs::msg::Point pf, pl, pr; diff --git a/test_runner/random_test_runner/include/random_test_runner/lanelet_utils.hpp b/test_runner/random_test_runner/include/random_test_runner/lanelet_utils.hpp index 5203d1068cd..02019010163 100644 --- a/test_runner/random_test_runner/include/random_test_runner/lanelet_utils.hpp +++ b/test_runner/random_test_runner/include/random_test_runner/lanelet_utils.hpp @@ -51,19 +51,19 @@ class LaneletUtils double computeDistance( const traffic_simulator_msgs::msg::LaneletPose & p1, - const traffic_simulator_msgs::msg::LaneletPose & p2); + const traffic_simulator_msgs::msg::LaneletPose & p2) const; std::optional getOppositeLaneLet( const traffic_simulator_msgs::msg::LaneletPose & pose); std::vector getLanesWithinDistance( const traffic_simulator_msgs::msg::LaneletPose & pose, double min_distance, double max_distance); - std::vector getLaneletIds(); + std::vector getLaneletIds() const; geometry_msgs::msg::PoseStamped toMapPose( - const traffic_simulator_msgs::msg::LaneletPose & lanelet_pose, const bool fill_pitch); - std::vector getRoute(int64_t from_lanelet_id, int64_t to_lanelet_id); - double getLaneletLength(int64_t lanelet_id); - bool isInLanelet(int64_t lanelet_id, double s); + const traffic_simulator_msgs::msg::LaneletPose & lanelet_pose, const bool fill_pitch) const; + std::vector getRoute(int64_t from_lanelet_id, int64_t to_lanelet_id) const; + double getLaneletLength(int64_t lanelet_id) const; + bool isInLanelet(int64_t lanelet_id, double s) const; private: lanelet::LaneletMapPtr lanelet_map_ptr_; diff --git a/test_runner/random_test_runner/include/random_test_runner/metrics/ego_collision_metric.hpp b/test_runner/random_test_runner/include/random_test_runner/metrics/ego_collision_metric.hpp index 779322cc4e3..c7911980b4e 100644 --- a/test_runner/random_test_runner/include/random_test_runner/metrics/ego_collision_metric.hpp +++ b/test_runner/random_test_runner/include/random_test_runner/metrics/ego_collision_metric.hpp @@ -24,8 +24,8 @@ class EgoCollisionMetric { timeoutCollisions(current_time); - auto npc_insertion_data = npc_last_collision_type_map_.emplace(npc_name, current_time); - if (npc_insertion_data.second) { + auto [_, was_inserted] = npc_last_collision_type_map_.emplace(npc_name, current_time); + if (was_inserted) { return true; } npc_last_collision_type_map_[npc_name] = current_time; diff --git a/test_runner/random_test_runner/src/lanelet_utils.cpp b/test_runner/random_test_runner/src/lanelet_utils.cpp index dd462c9ff00..c783b1dc01d 100644 --- a/test_runner/random_test_runner/src/lanelet_utils.cpp +++ b/test_runner/random_test_runner/src/lanelet_utils.cpp @@ -47,27 +47,30 @@ LaneletUtils::LaneletUtils(const boost::filesystem::path & filename) std::make_shared(filename, geographic_msgs::msg::GeoPoint()); } -std::vector LaneletUtils::getLaneletIds() { return hdmap_utils_ptr_->getLaneletIds(); } +std::vector LaneletUtils::getLaneletIds() const +{ + return hdmap_utils_ptr_->getLaneletIds(); +} geometry_msgs::msg::PoseStamped LaneletUtils::toMapPose( - const traffic_simulator_msgs::msg::LaneletPose & lanelet_pose, const bool fill_pitch) + const traffic_simulator_msgs::msg::LaneletPose & lanelet_pose, const bool fill_pitch) const { return hdmap_utils_ptr_->toMapPose(lanelet_pose, fill_pitch); } -std::vector LaneletUtils::getRoute(int64_t from_lanelet_id, int64_t to_lanelet_id) +std::vector LaneletUtils::getRoute(int64_t from_lanelet_id, int64_t to_lanelet_id) const { return hdmap_utils_ptr_->getRoute(from_lanelet_id, to_lanelet_id); } -double LaneletUtils::getLaneletLength(int64_t lanelet_id) +double LaneletUtils::getLaneletLength(int64_t lanelet_id) const { return hdmap_utils_ptr_->getLaneletLength(lanelet_id); } double LaneletUtils::computeDistance( const traffic_simulator_msgs::msg::LaneletPose & p1, - const traffic_simulator_msgs::msg::LaneletPose & p2) + const traffic_simulator_msgs::msg::LaneletPose & p2) const { auto p1_g = hdmap_utils_ptr_->toMapPose(p1).pose.position; auto p2_g = hdmap_utils_ptr_->toMapPose(p2).pose.position; @@ -78,7 +81,7 @@ double LaneletUtils::computeDistance( return std::sqrt(d.x * d.x + d.y * d.y + d.z * d.z); } -bool LaneletUtils::isInLanelet(int64_t lanelet_id, double s) +bool LaneletUtils::isInLanelet(int64_t lanelet_id, double s) const { return hdmap_utils_ptr_->isInLanelet(lanelet_id, s); } @@ -278,8 +281,7 @@ std::vector LaneletUtils::getLanesWithinDistance( } std::vector ret; - for (const auto & lanelet_part_key_value : lanelets_within_distance) { - const auto & lanelet_part = lanelet_part_key_value.second; + for (const auto & [_, lanelet_part] : lanelets_within_distance) { ret.emplace_back( LaneletPart{lanelet_part.lanelet.id(), lanelet_part.start_s, lanelet_part.end_s}); } From 002a14fdae0bb658bcce1dd04bc2d450083e967b Mon Sep 17 00:00:00 2001 From: Taiga Takano Date: Thu, 21 Nov 2024 18:55:42 +0900 Subject: [PATCH 6/9] Annotate this function with "override" or "final". --- .../geometry/include/geometry/spline/catmull_rom_spline.hpp | 2 +- .../include/traffic_simulator/entity/pedestrian_entity.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/math/geometry/include/geometry/spline/catmull_rom_spline.hpp b/common/math/geometry/include/geometry/spline/catmull_rom_spline.hpp index 9018f938855..998b0c53a49 100644 --- a/common/math/geometry/include/geometry/spline/catmull_rom_spline.hpp +++ b/common/math/geometry/include/geometry/spline/catmull_rom_spline.hpp @@ -61,7 +61,7 @@ class CatmullRomSpline : public CatmullRomSplineInterface auto getPolygon(const double width, const size_t num_points = 30, const double z_offset = 0) -> std::vector; const std::vector control_points; - virtual ~CatmullRomSpline() = default; + virtual ~CatmullRomSpline() override = default; private: auto getRightBounds(const double width, const size_t num_points = 30, const double z_offset = 0) diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/pedestrian_entity.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/pedestrian_entity.hpp index 4a142aed640..13f4ec5f235 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/pedestrian_entity.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/pedestrian_entity.hpp @@ -80,13 +80,13 @@ class PedestrianEntity : public EntityBase void setTrafficLights(const std::shared_ptr & ptr) override; - auto getBehaviorParameter() const -> traffic_simulator_msgs::msg::BehaviorParameter; + auto getBehaviorParameter() const -> traffic_simulator_msgs::msg::BehaviorParameter override; auto getMaxAcceleration() const -> double override; auto getMaxDeceleration() const -> double override; - void setBehaviorParameter(const traffic_simulator_msgs::msg::BehaviorParameter &); + void setBehaviorParameter(const traffic_simulator_msgs::msg::BehaviorParameter &) override; void setVelocityLimit(double linear_velocity) override; From 012b148fd03757b709cddf0141ec35b4637089bb Mon Sep 17 00:00:00 2001 From: Taiga <53041471+TakanoTaiga@users.noreply.github.com> Date: Tue, 26 Nov 2024 20:14:01 +0900 Subject: [PATCH 7/9] fix sonor cloud issue --- .../geometry/include/geometry/spline/catmull_rom_spline.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/math/geometry/include/geometry/spline/catmull_rom_spline.hpp b/common/math/geometry/include/geometry/spline/catmull_rom_spline.hpp index 998b0c53a49..5ba0a1c3e2e 100644 --- a/common/math/geometry/include/geometry/spline/catmull_rom_spline.hpp +++ b/common/math/geometry/include/geometry/spline/catmull_rom_spline.hpp @@ -61,7 +61,7 @@ class CatmullRomSpline : public CatmullRomSplineInterface auto getPolygon(const double width, const size_t num_points = 30, const double z_offset = 0) -> std::vector; const std::vector control_points; - virtual ~CatmullRomSpline() override = default; + ~CatmullRomSpline() override = default; private: auto getRightBounds(const double width, const size_t num_points = 30, const double z_offset = 0) From 1439f689251422df3b8b6f50fca20f5fee5e02cd Mon Sep 17 00:00:00 2001 From: Taiga Takano Date: Wed, 27 Nov 2024 21:18:28 +0900 Subject: [PATCH 8/9] Renamed the variable to snake_case. --- .../math/geometry/src/spline/catmull_rom_spline.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/math/geometry/src/spline/catmull_rom_spline.cpp b/common/math/geometry/src/spline/catmull_rom_spline.cpp index 3e0b2078730..f3fac64b95f 100644 --- a/common/math/geometry/src/spline/catmull_rom_spline.cpp +++ b/common/math/geometry/src/spline/catmull_rom_spline.cpp @@ -470,7 +470,7 @@ auto CatmullRomSpline::getSquaredDistanceIn2D( } return line_segments_[0].getSquaredDistanceIn2D(point, s, true); default: - const auto [index, sValue] = getCurveIndexAndS(s); + const auto [index, s_value] = getCurveIndexAndS(s); return curves_[index].getSquaredDistanceIn2D(point, sValue, true); } } @@ -508,7 +508,7 @@ auto CatmullRomSpline::getSquaredDistanceVector( } return line_segments_[0].getSquaredDistanceVector(point, s, true); default: - const auto [index, sValue] = getCurveIndexAndS(s); + const auto [index, s_value] = getCurveIndexAndS(s); return curves_[index].getSquaredDistanceVector(point, sValue, true); } } @@ -542,7 +542,7 @@ auto CatmullRomSpline::getPoint(const double s) const -> geometry_msgs::msg::Poi } return line_segments_[0].getPoint(s, true); default: - const auto [index, sValue] = getCurveIndexAndS(s); + const auto [index, s_value] = getCurveIndexAndS(s); return curves_[index].getPoint(sValue, true); } } @@ -597,7 +597,7 @@ auto CatmullRomSpline::getNormalVector(const double s) const -> geometry_msgs::m "This message is not originally intended to be displayed, if you see it, please " "contact the developer of traffic_simulator."); default: - const auto [index, sValue] = getCurveIndexAndS(s); + const auto [index, s_value] = getCurveIndexAndS(s); return curves_[index].getNormalVector(sValue, true); } } @@ -634,7 +634,7 @@ auto CatmullRomSpline::getTangentVector(const double s) const -> geometry_msgs:: "This message is not originally intended to be displayed, if you see it, please " "contact the developer of traffic_simulator."); default: - const auto [index, sValue] = getCurveIndexAndS(s); + const auto [index, s_value] = getCurveIndexAndS(s); return curves_[index].getTangentVector(sValue, true); } } @@ -665,7 +665,7 @@ auto CatmullRomSpline::getPose(const double s, const bool fill_pitch) const } return line_segments_[0].getPose(s, true, fill_pitch); default: - const auto [index, sValue] = getCurveIndexAndS(s); + const auto [index, s_value] = getCurveIndexAndS(s); return curves_[index].getPose(sValue, true, fill_pitch); } } From e06e3cf92fa59c69495f4540d23049eed1aef7aa Mon Sep 17 00:00:00 2001 From: Taiga <53041471+TakanoTaiga@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:52:35 +0900 Subject: [PATCH 9/9] fix typo --- .../math/geometry/src/spline/catmull_rom_spline.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/math/geometry/src/spline/catmull_rom_spline.cpp b/common/math/geometry/src/spline/catmull_rom_spline.cpp index f3fac64b95f..d7c8a607540 100644 --- a/common/math/geometry/src/spline/catmull_rom_spline.cpp +++ b/common/math/geometry/src/spline/catmull_rom_spline.cpp @@ -471,7 +471,7 @@ auto CatmullRomSpline::getSquaredDistanceIn2D( return line_segments_[0].getSquaredDistanceIn2D(point, s, true); default: const auto [index, s_value] = getCurveIndexAndS(s); - return curves_[index].getSquaredDistanceIn2D(point, sValue, true); + return curves_[index].getSquaredDistanceIn2D(point, s_value, true); } } @@ -509,7 +509,7 @@ auto CatmullRomSpline::getSquaredDistanceVector( return line_segments_[0].getSquaredDistanceVector(point, s, true); default: const auto [index, s_value] = getCurveIndexAndS(s); - return curves_[index].getSquaredDistanceVector(point, sValue, true); + return curves_[index].getSquaredDistanceVector(point, s_value, true); } } @@ -543,7 +543,7 @@ auto CatmullRomSpline::getPoint(const double s) const -> geometry_msgs::msg::Poi return line_segments_[0].getPoint(s, true); default: const auto [index, s_value] = getCurveIndexAndS(s); - return curves_[index].getPoint(sValue, true); + return curves_[index].getPoint(s_value, true); } } @@ -598,7 +598,7 @@ auto CatmullRomSpline::getNormalVector(const double s) const -> geometry_msgs::m "contact the developer of traffic_simulator."); default: const auto [index, s_value] = getCurveIndexAndS(s); - return curves_[index].getNormalVector(sValue, true); + return curves_[index].getNormalVector(s_value, true); } } @@ -635,7 +635,7 @@ auto CatmullRomSpline::getTangentVector(const double s) const -> geometry_msgs:: "contact the developer of traffic_simulator."); default: const auto [index, s_value] = getCurveIndexAndS(s); - return curves_[index].getTangentVector(sValue, true); + return curves_[index].getTangentVector(s_value, true); } } @@ -666,7 +666,7 @@ auto CatmullRomSpline::getPose(const double s, const bool fill_pitch) const return line_segments_[0].getPose(s, true, fill_pitch); default: const auto [index, s_value] = getCurveIndexAndS(s); - return curves_[index].getPose(sValue, true, fill_pitch); + return curves_[index].getPose(s_value, true, fill_pitch); } }