From 8ab3347b09e7b5b7e2c67086387b41322b0ec83c Mon Sep 17 00:00:00 2001 From: Masaya Kataoka Date: Wed, 6 Nov 2024 17:07:37 +0900 Subject: [PATCH 1/5] fix problem about https://sonarcloud.io/project/issues?open=AZINWTGyjvEq9OQMnL_U&id=tier4_scenario_simulator_v2 Signed-off-by: Masaya Kataoka --- simulation/do_nothing_plugin/src/plugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simulation/do_nothing_plugin/src/plugin.cpp b/simulation/do_nothing_plugin/src/plugin.cpp index 8cc19f6a727..c47663ddd41 100644 --- a/simulation/do_nothing_plugin/src/plugin.cpp +++ b/simulation/do_nothing_plugin/src/plugin.cpp @@ -152,7 +152,10 @@ auto interpolateEntityStatusFromPolylineTrajectory( } // namespace follow_trajectory } // namespace do_nothing_behavior -void DoNothingBehavior::configure(const rclcpp::Logger &) {} +void DoNothingBehavior::configure(const rclcpp::Logger &) +{ + /// @note The do nothing plugin currently does not use rclcpp::Logger and the configure function is no operation. +} void DoNothingBehavior::update(double current_time, double step_time) { From 83acb736cf5f7bccfb94cff1e4a19369b9e5072c Mon Sep 17 00:00:00 2001 From: Masaya Kataoka Date: Wed, 6 Nov 2024 17:13:31 +0900 Subject: [PATCH 2/5] fix warnings about https://sonarcloud.io/project/issues?open=AZJwAY5JlcZ2d3dSAT63&id=tier4_scenario_simulator_v2 Signed-off-by: Masaya Kataoka --- .../include/traffic_simulator/entity/entity_base.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp index 8614ed3fd1d..c8183b266a8 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp @@ -141,7 +141,13 @@ class EntityBase virtual void requestAssignRoute(const std::vector &) = 0; - virtual void requestLaneChange(const lanelet::Id) {} + virtual void requestLaneChange(const lanelet::Id) + { + /** + * @note There are Entities such as MiscObjectEntity for which lane change is not possible, + * and since it is necessary to implement appropriate overrides for each Entity, no operation is performed on the base type. + */ + } virtual void requestLaneChange(const traffic_simulator::lane_change::Parameter &){}; From 4bd85df37b3aa72a745a86d17697df81043781d4 Mon Sep 17 00:00:00 2001 From: Masaya Kataoka Date: Wed, 6 Nov 2024 17:14:35 +0900 Subject: [PATCH 3/5] fix problems about https://sonarcloud.io/project/issues?open=AZINWTDsjvEq9OQMnL7a&id=tier4_scenario_simulator_v2 Signed-off-by: Masaya Kataoka --- .../include/traffic_simulator/entity/entity_base.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp index c8183b266a8..a07b426a596 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp @@ -149,7 +149,12 @@ class EntityBase */ } - virtual void requestLaneChange(const traffic_simulator::lane_change::Parameter &){}; + virtual void requestLaneChange(const traffic_simulator::lane_change::Parameter &){ + /** + * @note There are Entities such as MiscObjectEntity for which lane change is not possible, + * and since it is necessary to implement appropriate overrides for each Entity, no operation is performed on the base type. + */ + }; /* */ void requestLaneChange( const lane_change::AbsoluteTarget &, const lane_change::TrajectoryShape, From 38157967f62a09127c7e0bb93cda13f6639601fa Mon Sep 17 00:00:00 2001 From: Masaya Kataoka Date: Wed, 6 Nov 2024 17:17:01 +0900 Subject: [PATCH 4/5] fix problem about https://sonarcloud.io/project/issues?open=AZJwAY5JlcZ2d3dSAT64&id=tier4_scenario_simulator_v2 Signed-off-by: Masaya Kataoka --- .../traffic_simulator/entity/entity_base.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp index a07b426a596..059a8150752 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp @@ -149,12 +149,13 @@ class EntityBase */ } - virtual void requestLaneChange(const traffic_simulator::lane_change::Parameter &){ + virtual void requestLaneChange(const traffic_simulator::lane_change::Parameter &) + { /** * @note There are Entities such as MiscObjectEntity for which lane change is not possible, * and since it is necessary to implement appropriate overrides for each Entity, no operation is performed on the base type. */ - }; + } /* */ void requestLaneChange( const lane_change::AbsoluteTarget &, const lane_change::TrajectoryShape, @@ -175,7 +176,13 @@ class EntityBase virtual void requestSpeedChange(const speed_change::RelativeTargetSpeed &, bool); - virtual void requestClearRoute() {} + virtual void requestClearRoute() + { + /** + * @note Since there are Entities such as MiscObjectEntity that do not perform routing, + * and routing methods differ from Entity to Entity, this function performs no operation in the base type. + */ + } virtual auto isControlledBySimulator() const -> bool; From c8446c83383684fac797d07a026b658bb9b0cfc5 Mon Sep 17 00:00:00 2001 From: Masaya Kataoka Date: Wed, 6 Nov 2024 17:25:03 +0900 Subject: [PATCH 5/5] remove warnings about misc object entity Signed-off-by: Masaya Kataoka --- .../entity/misc_object_entity.hpp | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/misc_object_entity.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/misc_object_entity.hpp index 27ac070dc13..148359e8d70 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/misc_object_entity.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/misc_object_entity.hpp @@ -95,15 +95,30 @@ class MiscObjectEntity : public EntityBase void setBehaviorParameter(const traffic_simulator_msgs::msg::BehaviorParameter &) override; - void setVelocityLimit(double) override{}; + void setVelocityLimit(double) override + { + /// @note Misc object entity does not move, so this function is no operation. + } - void setAccelerationLimit(double) override {} + void setAccelerationLimit(double) override + { + /// @note Misc object entity does not move, so this function is no operation. + } - void setAccelerationRateLimit(double) override {} + void setAccelerationRateLimit(double) override + { + /// @note Misc object entity does not move, so this function is no operation. + } - void setDecelerationLimit(double) override {} + void setDecelerationLimit(double) override + { + /// @note Misc object entity does not move, so this function is no operation. + } - void setDecelerationRateLimit(double) override {} + void setDecelerationRateLimit(double) override + { + /// @note Misc object entity does not move, so this function is no operation. + } auto getMaxAcceleration() const -> double override {