Suggest using "rosys.on_startup()" instead of "app.on_startup()" #45
AndyPermaRobotics
started this conversation in
Ideas / Feature Requests
Replies: 2 comments 1 reply
-
Sure. The examples should use |
Beta Was this translation helpful? Give feedback.
1 reply
-
@falkoschindler just created the nice PR #46 to improve documentation in this regard. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello together,
I figured out that there are two callbacks, that a rosys script can use for startup initialization code.
One is from nicegui
app.on_startup()
and one isrosys.on_startup()
.Actually
app.on_startup()
anrosys.on_startup()
are connected internally (see rosys.py).But there is (at least) one possible pitfall:
If I want to set
rosys.config.simulation_speed
programmatically, the change is overwritten if I do it in theapp.on_startup()
callback, because the nicegui callback is invoked beforepersistence.restore()
is called in the startup() routine of rosys see here.I stumbled over it then I tried to set the simulation_speed to 1.0 in the production mode, but the script used the persisted simulation_speed of my previous tests.
I don't see a need to use
app.on_startup()
instead ofrosys.on_startup()
therefore I suggest to encourage the usage ofrosys.on_startup()
in the rosys examples and the documentation.Beta Was this translation helpful? Give feedback.
All reactions