ros subscriber is interrupted by ginput
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Geoff Hayes
2016-12-30
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?
回答(1 个)
Sebastian Castro
2017-9-19
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Services and Actions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!