From a6a8ee526c0ef38bb7be6b26bca868df5948ec10 Mon Sep 17 00:00:00 2001 From: berry0511 Date: Wed, 1 Jun 2022 17:09:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0dof=5F=E5=92=8Cjoints=5Fname?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xarm_api/src/xarm_driver.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xarm_api/src/xarm_driver.cpp b/xarm_api/src/xarm_driver.cpp index 6b0e788a..8509c554 100755 --- a/xarm_api/src/xarm_driver.cpp +++ b/xarm_api/src/xarm_driver.cpp @@ -204,6 +204,12 @@ namespace xarm_api joint_state_msg_.position.resize(dof_); joint_state_msg_.velocity.resize(dof_, 0); joint_state_msg_.effort.resize(dof_, 0); + + if (dof_ != joint_names_.size()) { + ROS_FATAL("xarm_dof not equal with joint_name: [%d!=%lu]", dof_, joint_names_.size()); + return; + } + for(int i = 0; i < dof_; i++) { joint_state_msg_.name[i] = joint_names_[i];