From e637a3b6e3860474e9111dbf8b415105df241dd8 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Thu, 28 Mar 2024 14:34:51 +0900 Subject: [PATCH 1/3] Add option to stop control on system time jump --- src/ypspur_ros.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ypspur_ros.cpp b/src/ypspur_ros.cpp index db27581..bba6fac 100644 --- a/src/ypspur_ros.cpp +++ b/src/ypspur_ros.cpp @@ -98,6 +98,7 @@ class YpspurRosNode int key_; bool simulate_; bool wait_convergence_of_joint_trajectory_angle_vel_; + bool exit_on_time_jump_; double tf_time_offset_; @@ -454,6 +455,7 @@ 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); 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); @@ -659,6 +661,8 @@ 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_) + args.push_back(std::string("--exit-on-time-jump")); if (param_file_.size() > 0) { args.push_back(std::string("-p")); From 374fcf566eb278de29fc517f966bcf9f7a8c2c2c Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Tue, 2 Apr 2024 15:41:35 +0900 Subject: [PATCH 2/3] Update ypspur version constraint --- package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.xml b/package.xml index 0a28099..468c958 100644 --- a/package.xml +++ b/package.xml @@ -27,5 +27,5 @@ tf2_geometry_msgs tf2_ros trajectory_msgs - ypspur + ypspur From 9466b9a4f01cc9c3e3da88ea379a76987b2387b2 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Tue, 2 Apr 2024 15:49:16 +0900 Subject: [PATCH 3/3] 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) {