How can i execute two callback concurrently

8 ビュー (過去 30 日間)
Borison ningthoujam
Borison ningthoujam 2018 年 5 月 19 日
コメント済み: Walter Roberson 2018 年 5 月 20 日
help me out guys....m working on a project for path planning of mobile robot in dynamic environment.i need two call back to execute in parallel in a GUI.the first callback is to move the obstacles and the other one is to start the robot.The problem is that when i make the obstacles move,the robot stops.i need these callbacks to run simultaneously. please help me out guys.

採用された回答

Walter Roberson
Walter Roberson 2018 年 5 月 19 日
This is not possible with callbacks. You will need to use parallel processing and some way of communicating between the workers. Or you will need to rewrite the two routines to do a limited amount of work and then give up control so that the other routine can make progress.
You have the difficulty that both routines need to be in continual control in order to issue movement instructions to something, unless you can create or find devices such that you can can give it endpoint coordinates and it moves the object without the MATLAB session needing to give every motor spin.
  4 件のコメント
Borison ningthoujam
Borison ningthoujam 2018 年 5 月 20 日
can i get an example from you....perhaps a simple gui program so that i can understand how it is implemented.....m really confused since it is my first time working in a gui
Walter Roberson
Walter Roberson 2018 年 5 月 20 日
There is no simple example. Parallel processing takes place in separate processes, and communication between processes is hard to get right.
As Jeff Atwood once wrote, "There are two hard things in computer, science: cache invalidation, naming things, and off-by-one errors."
Cache invalidation has to do with shared asynchronous access to resources -- parallel processing in other words.
https://www.mathworks.com/matlabcentral/fileexchange/24594-parfor-progress-monitor

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by