From ce834cb2899ca9eb075c6512537043437a482e92 Mon Sep 17 00:00:00 2001 From: Alexander Reimann Date: Tue, 25 Oct 2016 20:16:46 +0900 Subject: [PATCH] [diff_drive_pose_controller] Change target pose even if controller already enabled --- .../src/diff_drive_pose_controller_ros.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/yocs_diff_drive_pose_controller/src/diff_drive_pose_controller_ros.cpp b/yocs_diff_drive_pose_controller/src/diff_drive_pose_controller_ros.cpp index b188858c..222440c1 100644 --- a/yocs_diff_drive_pose_controller/src/diff_drive_pose_controller_ros.cpp +++ b/yocs_diff_drive_pose_controller/src/diff_drive_pose_controller_ros.cpp @@ -221,14 +221,18 @@ void DiffDrivePoseControllerROS::controlMaxVelCB(const std_msgs::Float32ConstPtr void DiffDrivePoseControllerROS::enableCB(const std_msgs::StringConstPtr msg) { - if (this->enable()) + if (!msg->data.empty()) { goal_frame_name_ = msg->data; - ROS_INFO_STREAM("Controller has been enabled. [" << name_ << "] with goal frame [" << goal_frame_name_ << "]"); + } + + if (this->enable()) + { + ROS_INFO_STREAM("Controller has been enabled [" << name_ << "] with goal frame [" << goal_frame_name_ << "]."); } else { - ROS_INFO_STREAM("Controller was already enabled. [" << name_ <<"] with Goal frame [" << goal_frame_name_ << "]"); + ROS_INFO_STREAM("Controller was already enabled [" << name_ <<"], now tracking goal frame [" << goal_frame_name_ << "]."); } }