Repository navigation
motion: a non-finite inverse in coordinated mode no longer hangs the servo thread - #4685
Open
grandixximo wants to merge 1 commit into
Open
grandixximo wants to merge 1 commit into
grandixximo wants to merge 1 commit into
Conversation
…servo thread When the inverse kinematics gave a non-finite joint location in coordinated mode, the check broke out of the joint loop only. Joint 0 was left without its interpolation point, so the enclosing cubicNeedNextPoint() loop ran the planner and the inverse again, forever, inside the servo thread: millions of identical errors and, on a real-time kernel, a frozen PC. Leave the loop the way a failed inverse already does, so the error is reported once and the machine disables. Reported by Sigma1912 with a mill-turn kinematics module whose inverse divided by zero.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the inverse kinematics returns a non-finite joint location in coordinated mode, the
isfinite()check in control.c only breaks out of the joint loop. Joint 0 is left without its interpolation point, so the enclosingwhile (cubicNeedNextPoint(...))loop runs the planner and the inverse again, forever, inside the servo thread.Sigma1912 hit this with a mill-turn kinematics module whose inverse divided by zero after a kinematics switch (
G12.1 P1). I ran the config headless: the servo thread stalled and printed "kinematicsInverse gave non-finite joint location on joint 0" 5.4 million times in under a minute. On a real-time kernel the PC freezes.The fix leaves the loop the way the existing "kinematicsInverse failed" branch already does. With it, the same config reports the error once, the machine disables and the servo thread keeps running.
The teleop path has the same early
break, but it has no enclosing loop, so it cannot hang.