Page 1 of 1

Can't resume simulation after pausing in stepping mode with python-zmqremoteapi

Posted: 25 Apr 2024, 16:52
by tkschuler
I can't figure out a way to resume simulation in stepping mode. This seems to be a bug to me.

I'm using coppeliaSim 4.6 rev 18 on Ubuntu 22.04 and coppeliasim-zmqremoteapi-client v2.0.4.

For this simple test, I'm using the default empty scene.

Code: Select all

#python
#sim.setStepping(True)
while True:
    sim.startSimulation()
    #sim.setStepping(True)
    print("Started Simulation")
    time.sleep(1)

    i=0

    print("stepping")
    while i < 100:
        i+=1
        print(i, sim.getSimulationTime())
        #sim.step()

    sim.stopSimulation()
    print("paused simulation")
    time.sleep(1)
If stepping mode is commented out, this script runs fine. If stepping mode is initialized (either once, or every time within the loop), the script runs with sim.stop() but not sim.Pause(). With sim.pause, the simulation will run through 1 loop, then get stuck at i=2 every time.

Re: Can't resume simulation after pausing in stepping mode with python-zmqremoteapi

Posted: 29 Apr 2024, 10:13
by coppelia
Hello,

yes, that is right. The sim.pauseSimulation API command actually only makes sense if there is some interaction with the user afterwards, otherwise there is no need/reason to pause a simulation: instead, simply do not step anymore and the result is the same.

However, try to add

Code: Select all

function sysCall_suspended()
    return sysCall_nonSimulation()
end
to addOns/ZMQ remote API server.lua

Let me know.
Cheers