webots icon indicating copy to clipboard operation
webots copied to clipboard

Reset `WbFieldRef->last_update` After Simulation Reset

Open CoolSpy3 opened this issue 10 months ago • 0 comments

Description Currently, after the simulation is reset by a controller, supervisors can occasionally read stale values from fields (see the linked issue for details). This PR updates Webots to broadcast a C_SUPERVISOR_SIMULATION_RESET message whenever the simulation is reset. It then updates controllers to respond to this message by resetting the last_update field of all of their field references. This effectively marks their cached data as invalid, so when the controller tries to read the value, it will re-fetch it from Webots.

Related Issues This pull-request fixes issue #6670.

Tasks Add the list of tasks of this PR.

CoolSpy3 avatar Jan 13 '25 00:01 CoolSpy3