Skip to content

Commit f8db7bd

Browse files
[xs_sdk] Improve error messages (#37)
* [xs_sdk] Improve error messages Include more details in error messages. Correct minor spelling and whitespace issues. * Add joint number error logging to xs_sdk
1 parent 5f23da7 commit f8db7bd

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
@@ -568,6 +568,15 @@ bool InterbotixRobotXS::robot_get_motor_configs(void)
568568

569569
YAML::Node joint_order = motor_configs["joint_order"];
570570
YAML::Node sleep_positions = motor_configs["sleep_positions"];
571+
572+
if (joint_order.size() != sleep_positions.size())
573+
{
574+
ROS_FATAL(
575+
"[xs_sdk] Error when parsing Motor Config file: Length of joint_order list (%d) does not match length of sleep_positions list (%d).",
576+
joint_order.size(), sleep_positions.size());
577+
return false;
578+
}
579+
571580
JointGroup all_joints;
572581
all_joints.joint_num = (uint8_t) joint_order.size();
573582
all_joints.mode = "position";

0 commit comments

Comments
 (0)