Skip to content

Commit

Permalink
emit warning about JointTolerances for unknown joints
Browse files Browse the repository at this point in the history
A debug log warning only right now. We could consider making it a fatal error and actually return it.
  • Loading branch information
gavanderhoorn committed May 1, 2024
1 parent 758afcf commit 64c6524
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ActionServer_FJT.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ static STATUS Ros_ActionServer_FJT_Parse_GoalPosTolerances(
Ros_Debug_BroadcastMsg("%s: parsing JointTolerance for '%s': pos: %f", __func__,
selected_tolerance_name.data, goal_joint_tolerances->data[jtol_idx].position);

for (size_t ptol_idx = 0; ptol_idx < joint_names->size; ptol_idx += 1)
size_t ptol_idx = 0;
for (; ptol_idx < joint_names->size; ptol_idx += 1)
{
rosidl_runtime_c__String selected_position_name = joint_names->data[ptol_idx];
if (rosidl_runtime_c__String__are_equal(&selected_position_name, &selected_tolerance_name))
Expand All @@ -543,6 +544,14 @@ static STATUS Ros_ActionServer_FJT_Parse_GoalPosTolerances(
break;
}
}

//couldn't find joint
if (ptol_idx == joint_names->size)
{
//TODO(gavanderhoorn): make this a fatal error?
Ros_Debug_BroadcastMsg("%s: WARNING: couldn't find '%s' in internal joint names, ignoring",
__func__, selected_tolerance_name.data);
}
}

return OK;
Expand Down

0 comments on commit 64c6524

Please sign in to comment.