Skip to content

Commit c4d5415

Browse files
Add joint number error logging to xs_sdk
1 parent ce8199a commit c4d5415

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

interbotix_ros_xseries/interbotix_xs_sdk/src/xs_sdk_obj.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,15 @@ bool InterbotixRobotXS::robot_get_motor_configs(void)
541541

542542
YAML::Node joint_order = motor_configs["joint_order"];
543543
YAML::Node sleep_positions = motor_configs["sleep_positions"];
544+
545+
if (joint_order.size() != sleep_positions.size())
546+
{
547+
ROS_FATAL(
548+
"[xs_sdk] Error when parsing Motor Config file: Length of joint_order list (%d) does not match length of sleep_positions list (%d).",
549+
joint_order.size(), sleep_positions.size());
550+
return false;
551+
}
552+
544553
JointGroup all_joints;
545554
all_joints.joint_num = (uint8_t) joint_order.size();
546555
all_joints.mode = "position";

0 commit comments

Comments
 (0)