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

Report crashes, strange behaviour, or apparent bugs
Post Reply
tkschuler
Posts: 1
Joined: 25 Apr 2024, 15:30

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

Post 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.

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

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

Post 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

Post Reply