From 05b09a8b08391946e78a89968e87178596a8840c Mon Sep 17 00:00:00 2001 From: Shun Hasegawa Date: Fri, 13 Dec 2024 22:38:17 +0900 Subject: [PATCH] [dynamixel_general_hw] Reset joint limit interfaces in special states to prevent runaway when going back to normal state --- dynamixel_general_hw/src/dynamixel_general_hw.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dynamixel_general_hw/src/dynamixel_general_hw.cpp b/dynamixel_general_hw/src/dynamixel_general_hw.cpp index 499de45..3cbf01e 100644 --- a/dynamixel_general_hw/src/dynamixel_general_hw.cpp +++ b/dynamixel_general_hw/src/dynamixel_general_hw.cpp @@ -1174,6 +1174,12 @@ void DynamixelGeneralHw::write(const ros::Time& time, const ros::Duration& perio normal_modes_.clear(); } } + if (isJntCmdIgnored()) + { + // Reset joint limit interfaces to prevent runaway when going back to normal state + pos_jnt_sat_interface_.reset(); + pos_jnt_soft_interface_.reset(); + } prev_is_servo_ = is_servo_; prev_is_hold_pos_ = is_hold_pos_; }