Problem synchronization between a Simulink publisher and subscriber

1 回表示 (過去 30 日間)
Muhammad TUFAIL
Muhammad TUFAIL 2020 年 12 月 15 日
回答済み: Mark McBroom 2020 年 12 月 25 日
Hello everyone,
I am using Matlab R2018a with simulink and robotics toolbox. I have created a simple publisher node which uses robotics toolbox publisher module to publish a simple periodic pulse signal on a topic. Then i have created a susbscriber node separately, which subscribes to the published topic. But when i run the simulation (both models), i can see that the information received in the msg in subscriber model is not exactly same as the pulse i published in the publisher model. I run both models with same configuration parameters (fixed step size of 0.05). Do you guys have an idea what could be wrong here? I expect to receive the same pulse that i publish, but it's not the same periodic pulse.
Thanks for your cooperation.

回答 (1 件)

Mark McBroom
Mark McBroom 2020 年 12 月 25 日
Simulink does not simulate in real-time, so there will always be variation in the execution speeds of Simulink models. You can try and control this by using Pacing mode to obtain psuedo real-time control

カテゴリ

Help Center および File ExchangePublishers and Subscribers についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by