Why my topic only send once?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello I used the following Simulink model to send ROS topic, but it only send once. Any ideas on that?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167064/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167065/image.png)
0 件のコメント
回答 (1 件)
Sebastian Castro
2017 年 9 月 19 日
This is because all the blocks (Blank Message and Constant) are using a "Constant" sample time. This means they will only update their values if the constants are changed.
The best practice, if you want messages to be sent continuously, is to specify an actual sample time, e.g. 0.5, in the Blank Message block. Try that out!
Also, note that Simulink models will run as fast as possible by default. If you want to send the messages at a fixed rate using the CPU wall clock time, check out this real-time pacer block: https://www.mathworks.com/matlabcentral/fileexchange/29107-real-time-pacer-for-simulink
- Sebastian
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!