Skip to content

Wait for the plugin initialization#1872

Merged
iakov merged 4 commits intotrikset:masterfrom
MinyazevR:MinyazevR-fix-bug-with-sensors
Dec 28, 2024
Merged

Wait for the plugin initialization#1872
iakov merged 4 commits intotrikset:masterfrom
MinyazevR:MinyazevR-fix-bug-with-sensors

Conversation

@MinyazevR
Copy link
Member

@MinyazevR MinyazevR commented Dec 26, 2024

Upon initialization of the EV3 kit plugin, a subscription to the sensorAdded event in the Box2DPhysicsEngine is registered with a delay using QTimerSingleShot(10). While this does not pose an issue when utilizing TRIK Studio, it becomes problematic when using the 2D-model projectManager->open function, as the subscription is established too late. As a consequence, the sensors are not properly processed by Box2D.

@MinyazevR MinyazevR force-pushed the MinyazevR-fix-bug-with-sensors branch from 345631f to 8ae1d87 Compare December 26, 2024 21:50
@MinyazevR MinyazevR force-pushed the MinyazevR-fix-bug-with-sensors branch from 8ae1d87 to dfd576c Compare December 26, 2024 22:15
@iakov iakov added this to the 2024.2 milestone Dec 28, 2024
@iakov iakov merged commit f8bea05 into trikset:master Dec 28, 2024
AlexandrKudrya pushed a commit to AlexandrKudrya/trik-studio that referenced this pull request Jan 20, 2025
* Wait for the plugin initialization
---------
Upon initialization of the `EV3` kit plugin, a subscription to the [sensorAdded](https://github.com/trikset/trik-studio/blob/1281f48c8d1e50c7c16b4f164bd7cffa55d4d001/plugins/robots/common/twoDModel/src/engine/model/physics/box2DPhysicsEngine.cpp#L128()) event in the `Box2DPhysicsEngine` is registered with a delay using [QTimerSingleShot(10)](https://github.com/trikset/trik-studio/blob/1281f48c8d1e50c7c16b4f164bd7cffa55d4d001/plugins/robots/common/twoDModel/src/engine/model/physics/box2DPhysicsEngine.cpp#L112). While this does not pose an issue when utilizing `TRIK Studio`, it becomes problematic when using the `2D-model` [projectManager->open function](https://github.com/trikset/trik-studio/blob/1281f48c8d1e50c7c16b4f164bd7cffa55d4d001/plugins/robots/checker/twoDModelRunner/runner.cpp#L69), as the subscription is established too late. As a consequence, the sensors are not properly processed by `Box2D`.
Co-authored-by: iakov <iakov@users.noreply.github.com>
iakov added a commit to iakov/trik-studio that referenced this pull request Jan 29, 2025
* Wait for the plugin initialization
---------
Upon initialization of the `EV3` kit plugin, a subscription to the [sensorAdded](https://github.com/trikset/trik-studio/blob/1281f48c8d1e50c7c16b4f164bd7cffa55d4d001/plugins/robots/common/twoDModel/src/engine/model/physics/box2DPhysicsEngine.cpp#L128()) event in the `Box2DPhysicsEngine` is registered with a delay using [QTimerSingleShot(10)](https://github.com/trikset/trik-studio/blob/1281f48c8d1e50c7c16b4f164bd7cffa55d4d001/plugins/robots/common/twoDModel/src/engine/model/physics/box2DPhysicsEngine.cpp#L112). While this does not pose an issue when utilizing `TRIK Studio`, it becomes problematic when using the `2D-model` [projectManager->open function](https://github.com/trikset/trik-studio/blob/1281f48c8d1e50c7c16b4f164bd7cffa55d4d001/plugins/robots/checker/twoDModelRunner/runner.cpp#L69), as the subscription is established too late. As a consequence, the sensors are not properly processed by `Box2D`.
Co-authored-by: iakov <iakov@users.noreply.github.com>
iakov added a commit to iakov/trik-studio that referenced this pull request Jan 29, 2025
* Wait for the plugin initialization
---------
Upon initialization of the `EV3` kit plugin, a subscription to the [sensorAdded](https://github.com/trikset/trik-studio/blob/1281f48c8d1e50c7c16b4f164bd7cffa55d4d001/plugins/robots/common/twoDModel/src/engine/model/physics/box2DPhysicsEngine.cpp#L128()) event in the `Box2DPhysicsEngine` is registered with a delay using [QTimerSingleShot(10)](https://github.com/trikset/trik-studio/blob/1281f48c8d1e50c7c16b4f164bd7cffa55d4d001/plugins/robots/common/twoDModel/src/engine/model/physics/box2DPhysicsEngine.cpp#L112). While this does not pose an issue when utilizing `TRIK Studio`, it becomes problematic when using the `2D-model` [projectManager->open function](https://github.com/trikset/trik-studio/blob/1281f48c8d1e50c7c16b4f164bd7cffa55d4d001/plugins/robots/checker/twoDModelRunner/runner.cpp#L69), as the subscription is established too late. As a consequence, the sensors are not properly processed by `Box2D`.
Co-authored-by: iakov <iakov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants