webots
webots copied to clipboard
Physics plugin: dWebotsConsolePrintf not working during intialization
If the dWebotsConsolePrintf function is called in the webots_physics_init() function, the message is not visible in the Console.
It doesn't see a problem with the function itself because if called in webots_physics_step(), the message is printed in the console.
So maybe the console is reset or it is not read to print at the time the message is received.
I explored a bit this issue and here are my observations:
- This is not a regression. This behavior is present since at least R2021b
- The message is not displayed because it is emitted before the console is created.
- I investigated it by playing with the
physics.wbtworld and it turns out that there are several messages that are emitted before starting the simulation and never displayed:
Initialization: ROBOT = 0x56487ed42550 0x56487f722a40
Obstacle detected at a distance of 0.109 after 0 s
Obstacle detected at a distance of 0.099 after 0 s
Obstacle detected at a distance of 0.0015 after 0 s
Obstacle detected at a distance of 0 after 0 s