ur5WithRg2Grasping.ttt stuck on headless mode

Report crashes, strange behaviour, or apparent bugs
Post Reply
kutawei
Posts: 4
Joined: 19 Jun 2019, 15:21

ur5WithRg2Grasping.ttt stuck on headless mode

Post by kutawei » 20 Jun 2019, 01:34

Hello, I use V-REP 3.6.1 on Windows 10, when I run the official example scene "ur5WithRg2Grasping.ttt" on headless mode, the simulation stuck quickly after starting, when the first brick stop on the conveyor belt. I found this wired thing using another example scene "headlessModeDebug.ttt". I test V-REP 3.5.0, the same bug happened. I don't know why, please help.

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

Re: ur5WithRg2Grasping.ttt stuck on headless mode

Post by coppelia » 21 Jun 2019, 14:36

Hello,

I didn't test it in headless mode, but there is indeed a problem with that scene. Before going further into this, can you add a non-threaded child script to object RG2_centerJoint1 with following content and tell me if the problem remains?

Code: Select all

function sysCall_init()
    openCloseMotor=sim.getObjectHandle('RG2_openCloseJoint') 
    PID_P=0.1 
end

function sysCall_jointCallback(inData)
    local errorValue=(-sim.getJointPosition(openCloseMotor)/2)-inData.currentPos 
    local ctrl=errorValue*PID_P 
    local velocityToApply=ctrl/inData.dynStepSize 
    if (velocityToApply>inData.velUpperLimit) then 
        velocityToApply=inData.velUpperLimit 
    end 
    if (velocityToApply<-inData.velUpperLimit) then 
        velocityToApply=-inData.velUpperLimit 
    end 
    local forceOrTorqueToApply=inData.maxForce 
    local outData={} 
    outData.velocity=velocityToApply 
    outData.force=forceOrTorqueToApply 
    return outData 
end 
Cheers

kutawei
Posts: 4
Joined: 19 Jun 2019, 15:21

Re: ur5WithRg2Grasping.ttt stuck on headless mode

Post by kutawei » 24 Jun 2019, 13:40

Thank you coppelia, I've tried adding the script, but nothing change, what's the difference between windows and headless mode when the simulation is running?

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

Re: ur5WithRg2Grasping.ttt stuck on headless mode

Post by coppelia » 25 Jun 2019, 06:41

Indeed, there is a problem. Following code around line 73 of the script attached to UR5 causes an error in headless mode, and the threaded script ends:

Code: Select all

    sim.setInt32Parameter(sim.intparam_current_page,0)
you can comment it out. The bug will be corrected for release 3.6.2 (normally tomorrow)

Cheers

kutawei
Posts: 4
Joined: 19 Jun 2019, 15:21

Re: ur5WithRg2Grasping.ttt stuck on headless mode

Post by kutawei » 25 Jun 2019, 13:45

You got it right! Thank you for the quick update.

Post Reply