IK solver failed and robot arm model was incorrectly displayed

Report crashes, strange behaviour, or apparent bugs
Post Reply
lin
Posts: 5
Joined: 12 Oct 2023, 09:44

IK solver failed and robot arm model was incorrectly displayed

Post by lin »

hello!
When the inverse motion solution module was used, the robot arm model was incorrectly displayed and IK model could not be used.
this is the photo and subscript codes.
Image

Image

Code: Select all

function sysCall_init()
    local simBase=sim.getObject('.')
    local simTip=sim.getObject('./tip')
    local simTarget=sim.getObject('./testPose1')
    -- create an IK environment:
    ikEnv=simIK.createEnvironment()
    -- create an IK group: 
    ikGroup_undamped=simIK.createGroup(ikEnv)
    -- set its resolution method to undamped: 
    simIK.setGroupCalculation(ikEnv,ikGroup_undamped,simIK.method_pseudo_inverse,0,6)
    -- create an IK element based on the scene content: 
    simIK.addElementFromScene(ikEnv,ikGroup_undamped,simBase,simTip,simTarget,simIK.constraint_pose)
    -- create another IK group: 
    ikGroup_damped=simIK.createGroup(ikEnv)
    -- set its resolution method to damped: 
    simIK.setGroupCalculation(ikEnv,ikGroup_damped,simIK.method_damped_least_squares,1,99)
    -- create an IK element based on the scene content: 
    simIK.addElementFromScene(ikEnv,ikGroup_damped,simBase,simTip,simTarget,simIK.constraint_pose) 
    
end

function sysCall_actuation()
 
    if simIK.handleGroup(ikEnv,ikGroup_damped,{syncWorlds=true})~=simIK.result_success then 
        -- the position/orientation could not be reached.
        -- try to solve with the damped method:
        simIK.handleGroup(ikEnv,ikGroup_damped,{syncWorlds=true})
        -- We display a IK failure report message:
        sim.addLog(sim.verbosity_scriptwarnings,"IK solver failed.") 
    end
    
end 

function sysCall_cleanup()
    -- erase the IK environment: 
    simIK.eraseEnvironment(ikEnv) 
end
cheers!

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: IK solver failed and robot arm model was incorrectly displayed

Post by coppelia »

Hello,

please post the scene.

Cheers

lin
Posts: 5
Joined: 12 Oct 2023, 09:44

Re: IK solver failed and robot arm model was incorrectly displayed

Post by lin »

Hello!
This is the scene photo.
The summary of the problem is that the robot arms fell apart during simulation and coppeliasim dispalys "IK solver failed" while running the IK model.
But when I set the model to "Model is not dynamic", the robot arms won't fall apart anymore. I don't know if it is the right method.

Image

Thanks,
cheers!

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: IK solver failed and robot arm model was incorrectly displayed

Post by coppelia »

The right method depends of if you need dynamics or not.

Posting a picture is often not enough. Please post a link to e.g. a file in your dropbox, etc.

Cheers

Post Reply