Skip to content

Commit

Permalink
Reduce code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-mcelwain committed Jan 22, 2025
1 parent e4e754b commit f73e590
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/MotionControl.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,10 @@ Init_Trajectory_Status Ros_MotionControl_Init(rosidl_runtime_c__String__Sequence
int grpIndex, jointIndexInTraj, pointIndex;

//Verify we're not already running a trajectory
for (grpIndex = 0; grpIndex < g_Ros_Controller.numGroup; grpIndex += 1)
if (Ros_MotionControl_HasDataToProcess())
{
if (g_Ros_Controller.ctrlGroups[grpIndex]->hasDataToProcess)
{
Ros_Debug_BroadcastMsg("Already processing trajectory data - Rejecting new trajectory (Group #%d)",
g_Ros_Controller.ctrlGroups[grpIndex]->groupNo);
return INIT_TRAJ_ALREADY_IN_MOTION;
}
Ros_Debug_BroadcastMsg("Already processing trajectory data - Rejecting new trajectory");
return INIT_TRAJ_ALREADY_IN_MOTION;
}

Ros_MotionControl_AllGroupsInitComplete = FALSE;
Expand Down

0 comments on commit f73e590

Please sign in to comment.