Skip to content

Commit

Permalink
[xs_sdk] Improve error messages (#37)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
lukeschmitt-tr committed Apr 17, 2024
1 parent 5f23da7 commit f8db7bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions interbotix_ros_xseries/interbotix_xs_sdk/src/xs_sdk_obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,15 @@ bool InterbotixRobotXS::robot_get_motor_configs(void)

YAML::Node joint_order = motor_configs["joint_order"];
YAML::Node sleep_positions = motor_configs["sleep_positions"];

if (joint_order.size() != sleep_positions.size())
{
ROS_FATAL(
"[xs_sdk] Error when parsing Motor Config file: Length of joint_order list (%d) does not match length of sleep_positions list (%d).",
joint_order.size(), sleep_positions.size());
return false;
}

JointGroup all_joints;
all_joints.joint_num = (uint8_t) joint_order.size();
all_joints.mode = "position";
Expand Down

0 comments on commit f8db7bd

Please sign in to comment.