MATLAB Answers

ROS rate in Simulink with standalone code generation

2 views (last 30 days)
Balint Varga
Balint Varga on 8 Dec 2020
Hi everyone,
the following problem I have: I built a simulink model to generate a standalone ros node. It is a simple controller. I would like to publish the data with 10 hz, so I defined the sample time (by the blank message) 0.1.
After building the model and running the ROS-node, I test the publisher frequency with
rostopic hz ....
and I get 9.94, 9.95....
If I implement the same functionality in Python ROS-node, I get the desired 10 hz, so it must be some code generation issue and not the limitation of the target hardware.
Could you help me, how to have a more stable publishing rate in a generated Simulink ROS-node?

Answers (0)


Community Treasure Hunt

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

Start Hunting!