Page 2 of 2

Re: configuration of the time in the case using remote API

Posted: 24 Jul 2021, 14:29
by dimsky
I am using version 4.1 to display dummy movement graphs in my simulation.

Now when I update to version 4.2 the hierarchy graph can't be found in my hierarchy scene. Please help so I can quickly solve this problem. because it concerns my final research project. can I use version 4.1 back as before? I think when I use version 4.2 it makes me have to study that version first, especially in Indonesia, I rarely find research references using Coppeliasim
please help, thank you

best regards
dimas tri saptaji

Re: configuration of the time in the case using remote API

Posted: 26 Jul 2021, 07:02
by SitStudent
you can download the previous versions here.
https://www.coppeliarobotics.com/previousVersions

Re: configuration of the time in the case using remote API

Posted: 27 Jul 2021, 19:38
by coppelia
Additionally, you can enable old dialogs by setting showOldDlgs=true in system/usrset.txt

Cheers

Re: configuration of the time in the case using remote API

Posted: 27 Aug 2021, 09:43
by SitStudent
Hi

In the above code, is there any way to start a record when remoteAPI(regacy) is connected, and end it when it is disconnected?

Re: configuration of the time in the case using remote API

Posted: 27 Aug 2021, 10:58
by coppelia
Hello,

try with following:

Code: Select all

graph=require('graph_customization')

function sysCall_init()
    graphHandle=sim.getObjectHandle(sim.handle_self)
    
    -- Create/update data streams/curves:
    sim.destroyGraphCurve(graphHandle,-1)
    stream1=sim.addGraphStream(graphHandle,'Object position X','m')
    objectHandle=sim.getObjectHandle('cube')
    graph.init()
    startMeasurement()
end

function startMeasurement()
    startTime=sim.getSystemTime()
    graph.reset()
    measure=true
end

function stopMeasurement()
    measure=nil
end

function appendMeasurementPts()
    if measure then
        -- append measurement points, e.g. the x-position of an object:
        local p=sim.getObjectPosition(objectHandle,-1)
        sim.setGraphStreamValue(graphHandle,stream1,p[1])
        
        graph.handle(sim.getSystemTime()-startTime)
        graph.updateCurves()
    end
end

function sysCall_sensing()
    appendMeasurementPts()
end

function sysCall_nonSimulation()
    appendMeasurementPts()
end

function sysCall_suspended()
    appendMeasurementPts()
end

function sysCall_beforeSimulation()
end

function sysCall_afterSimulation()
end

function sysCall_suspend()
end

function sysCall_resume()
end
and call startMeasurement and stopMeasurement.

Cheers