webots icon indicating copy to clipboard operation
webots copied to clipboard

Physics plugin: dWebotsConsolePrintf not working during intialization

Open stefaniapedrazzi opened this issue 2 years ago • 1 comments

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.

stefaniapedrazzi avatar Jun 15 '23 08:06 stefaniapedrazzi

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.wbt world 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

BenjaminDeleze avatar Jun 16 '23 13:06 BenjaminDeleze