diff --git a/nextage_ik_plugin/src/nextage_left_arm_ikfast_moveit_plugin.cpp b/nextage_ik_plugin/src/nextage_left_arm_ikfast_moveit_plugin.cpp index 230ae7a0..e2912b09 100644 --- a/nextage_ik_plugin/src/nextage_left_arm_ikfast_moveit_plugin.cpp +++ b/nextage_ik_plugin/src/nextage_left_arm_ikfast_moveit_plugin.cpp @@ -479,7 +479,7 @@ double IKFastKinematicsPlugin::harmonize(const std::vector &ik_seed_stat while(solution[i] > 2*M_PI) { solution[i] -= 2*M_PI; } - while(solution[i] < 2*M_PI) { + while(solution[i] < -2*M_PI) { solution[i] += 2*M_PI; } dist_sqr += fabs(ik_seed_state[i] - solution[i]); diff --git a/nextage_ik_plugin/src/nextage_right_arm_ikfast_moveit_plugin.cpp b/nextage_ik_plugin/src/nextage_right_arm_ikfast_moveit_plugin.cpp index dde2de11..e4d89d6c 100644 --- a/nextage_ik_plugin/src/nextage_right_arm_ikfast_moveit_plugin.cpp +++ b/nextage_ik_plugin/src/nextage_right_arm_ikfast_moveit_plugin.cpp @@ -479,7 +479,7 @@ double IKFastKinematicsPlugin::harmonize(const std::vector &ik_seed_stat while(solution[i] > 2*M_PI) { solution[i] -= 2*M_PI; } - while(solution[i] < 2*M_PI) { + while(solution[i] < -2*M_PI) { solution[i] += 2*M_PI; } dist_sqr += fabs(ik_seed_state[i] - solution[i]);