webots
webots copied to clipboard
Reset `WbFieldRef->last_update` After Simulation Reset
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.
- [x] Update the changelog