ros subscriber is interrupted by ginput
Afficher commentaires plus anciens
I have a ginput command in my ros subscriber callback, which causes an interruption of the subscriber. The callback is entered once, and then it stops spinning. When I comment out ginput command, the callback is called continuously.
4 commentaires
Geoff Hayes
le 30 Déc 2016
Jin - is this the ros subscriber from https://www.mathworks.com/help/robotics/ref/rossubscriber.html? Can you show some of your code?
Geoff Hayes
le 30 Déc 2016
Jin - doesn't the call to ginput "block" and so you are waiting for the user (?) to choose a point on the axes? What are you expecting to happen with the call to ginput?
Jin Dai
le 30 Déc 2016
Réponses (1)
Sebastian Castro
le 19 Sep 2017
0 votes
This is expected, sorry to say.
Recall that the MATLAB environment is single-threaded, with the exception of optimized math functions (which you can't control as a user), or if you're using the Parallel Computing Toolbox to explicitly assign tasks to multiple cores.
So, a blocking operation like ginput means your subscriber won't be receiving any messages until you free up computational resources.
- Sebastian
Catégories
En savoir plus sur Services and Actions dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!