SimIK Solver Failed with 6DOF robot (UR5)

Typically: "How do I... ", "How can I... " questions
Post Reply
gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

SimIK Solver Failed with 6DOF robot (UR5)

Post by gplminhduc147 »

I have a problem with simIK. I link the target with tip. If I set the 1st joint of UR5 to 45, the simIK worked well and nothing happen. However, when I set 90, the simIK failed to solve.

For more detail I put the video here: https://youtu.be/g-Xe4eikivo
And my scene file here: https://drive.google.com/file/d/1hV3qJh ... drive_link
Please help me.
Thank you.
Last edited by gplminhduc147 on 02 Jul 2024, 04:19, edited 1 time in total.

fferri
Posts: 1297
Joined: 09 Sep 2013, 19:28

Re: SimIK Solver Failed with 6DOF robot (UR5)

Post by fferri »

You can get an explanation of the reason(s) IK solver failed by checking the second return value:

Code: Select all

local r, fc = simIK.applyIkEnvironmentToScene(ikEnv,ikGroup_undamped,true)
if r == simIK.result_fail then 
    -- ...
    sim.addLog(sim.verbosity_scriptwarnings, "IK solver failed: " .. simIK.getFailureDescription(fc))
end
or you can check for individual failure codes, e.g.:

Code: Select all

if fc & simIK.calc_limithit > 0 then
    print('a joint limit was hit')
elseif fc & simIK.calc_notwithintolerance > 0 then
    print('not within tolerance')
-- elseif ...
--     ...
end

gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

Re: SimIK Solver Failed with 6DOF robot (UR5)

Post by gplminhduc147 »

fferri wrote: 01 Jul 2024, 09:41 You can get an explanation of the reason(s) IK solver failed by checking the second return value:

Code: Select all

local r, fc = simIK.applyIkEnvironmentToScene(ikEnv,ikGroup_undamped,true)
if r == simIK.result_fail then 
    -- ...
    sim.addLog(sim.verbosity_scriptwarnings, "IK solver failed: " .. simIK.getFailureDescription(fc))
end
or you can check for individual failure codes, e.g.:

Code: Select all

if fc & simIK.calc_limithit > 0 then
    print('a joint limit was hit')
elseif fc & simIK.calc_notwithintolerance > 0 then
    print('not within tolerance')
-- elseif ...
--     ...
end
Hi. I added and run again. And the warning: "IK solver failed: {notwithintolerance, stepstoobig, limithit}"
How can I fix these errors please? Thank you

fferri
Posts: 1297
Joined: 09 Sep 2013, 19:28

Re: SimIK Solver Failed with 6DOF robot (UR5)

Post by fferri »

I think that means the tip/target distance was too large or something like that.
Also, a joint limit was hit, and that also cause to trigger an error condition.

You can try to use simIK.setElementPrecision, simIK.setGroupFlags, simIK.setJointLimitMargin, simIK.setJointMaxStepSize or option {allowError=true} to simIK.handleGroups.

Post Reply