From 9466b9a4f01cc9c3e3da88ea379a76987b2387b2 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Tue, 2 Apr 2024 15:49:16 +0900 Subject: [PATCH] Reduce variable scope --- src/ypspur_ros.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ypspur_ros.cpp b/src/ypspur_ros.cpp index bba6fac..b70b1a3 100644 --- a/src/ypspur_ros.cpp +++ b/src/ypspur_ros.cpp @@ -98,7 +98,6 @@ class YpspurRosNode int key_; bool simulate_; bool wait_convergence_of_joint_trajectory_angle_vel_; - bool exit_on_time_jump_; double tf_time_offset_; @@ -455,7 +454,8 @@ class YpspurRosNode } pnh_.param( "wait_convergence_of_joint_trajectory_angle_vel", wait_convergence_of_joint_trajectory_angle_vel_, true); - pnh_.param("exit_on_time_jump", exit_on_time_jump_, false); + bool exit_on_time_jump; + pnh_.param("exit_on_time_jump", exit_on_time_jump, false); pnh_.param("ypspur_bin", ypspur_bin_, std::string("ypspur-coordinator")); pnh_.param("param_file", param_file_, std::string("")); pnh_.param("tf_time_offset", tf_time_offset_, 0.0); @@ -661,7 +661,7 @@ class YpspurRosNode args.push_back(std::string("--enable-get-digital-io")); if (simulate_) args.push_back(std::string("--without-device")); - if (exit_on_time_jump_) + if (exit_on_time_jump) args.push_back(std::string("--exit-on-time-jump")); if (param_file_.size() > 0) {