From 08daedca5652abc5aef8df18d43c24b917f1e3a0 Mon Sep 17 00:00:00 2001
From: Fumiya Watanabe <rej55.g@gmail.com>
Date: Mon, 27 May 2024 13:03:57 +0900
Subject: [PATCH 1/2] chore(motion_velocity_smoother): remove string stream
 creation

Signed-off-by: Fumiya Watanabe <rej55.g@gmail.com>
---
 .../velocity_planning_utils.cpp                       | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp b/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp
index 2bcb31ff10969..3d1ae5c63e956 100644
--- a/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp
+++ b/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp
@@ -199,13 +199,14 @@ bool calcStopVelocityWithConstantJerkAccLimit(
   }
 
   // for debug
-  std::stringstream ss;
+  RCLCPP_DEBUG(rclcpp::get_logger("velocity_planning_utils"), "Calculate stop velocity.");
   for (unsigned int i = 0; i < ts.size(); ++i) {
-    ss << "t: " << ts.at(i) << ", x: " << xs.at(i) << ", v: " << vs.at(i) << ", a: " << as.at(i)
-       << ", j: " << js.at(i) << std::endl;
+    RCLCPP_DEBUG_STREAM(
+      rclcpp::get_logger("velocity_planning_utils"), "--- "
+                                                       << "t: " << ts.at(i) << ", x: " << xs.at(i)
+                                                       << ", v: " << vs.at(i) << ", a: " << as.at(i)
+                                                       << ", j: " << js.at(i));
   }
-  RCLCPP_DEBUG(
-    rclcpp::get_logger("velocity_planning_utils"), "Calculate stop velocity. %s", ss.str().c_str());
 
   const double a_target = 0.0;
   const double v_margin = 0.3;

From 8a87a6ae145cc390d3889be6594f3e50af57c9da Mon Sep 17 00:00:00 2001
From: Fumiya Watanabe <rej55.g@gmail.com>
Date: Wed, 29 May 2024 18:45:04 +0900
Subject: [PATCH 2/2] fix: use format string

Signed-off-by: Fumiya Watanabe <rej55.g@gmail.com>
---
 .../velocity_planning_utils.cpp                           | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp b/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp
index 3d1ae5c63e956..9fa4d697f06cb 100644
--- a/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp
+++ b/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp
@@ -201,11 +201,9 @@ bool calcStopVelocityWithConstantJerkAccLimit(
   // for debug
   RCLCPP_DEBUG(rclcpp::get_logger("velocity_planning_utils"), "Calculate stop velocity.");
   for (unsigned int i = 0; i < ts.size(); ++i) {
-    RCLCPP_DEBUG_STREAM(
-      rclcpp::get_logger("velocity_planning_utils"), "--- "
-                                                       << "t: " << ts.at(i) << ", x: " << xs.at(i)
-                                                       << ", v: " << vs.at(i) << ", a: " << as.at(i)
-                                                       << ", j: " << js.at(i));
+    RCLCPP_DEBUG(
+      rclcpp::get_logger("velocity_planning_utils"), "--- t: %f, x: %f, v: %f, a: %f, j: %f",
+      ts.at(i), xs.at(i), vs.at(i), as.at(i), js.at(i));
   }
 
   const double a_target = 0.0;