Why the time has not been synchronized between ros2 and simulink
I am subscribing to ros2 topic which has a message type ”ackermann_msgs/AckermannDriveStamped". I checked the topic in ros2 environment and it has 30Hz frequency. Now when I subscribe in simulink and extract the ‘sec’ I don’t get the time duration same as in ros2.
For example: The sample of header.stamp.sec in ros2 looks like this
[t(1)….t(30),t(31)….t(60)]= [1715612265….1715612265, 1715612266….1715612266]
And the sample of the same topic when been subscribed in simulink and been saved in worksapce looks like this:
[t(1)….t(215), t(216)….t(875)]= [1715612265….1715612265, 1715612266….1715612266]
I have tried the ‘Simulation pacing’, changed the sample time of the subscriber block, changed the fixed step size; still getting the same random time interval.
I am attaching the simple example with all the setting that I am using in Simulink. Please let me know if some setting in simulink is the fault or something else.I am subscribing to ros2 topic which has a message type ”ackermann_msgs/AckermannDriveStamped". I checked the topic in ros2 environment and it has 30Hz frequency. Now when I subscribe in simulink and extract the ‘sec’ I don’t get the time duration same as in ros2.
For example: The sample of header.stamp.sec in ros2 looks like this
[t(1)….t(30),t(31)….t(60)]= [1715612265….1715612265, 1715612266….1715612266]
And the sample of the same topic when been subscribed in simulink and been saved in worksapce looks like this:
[t(1)….t(215), t(216)….t(875)]= [1715612265….1715612265, 1715612266….1715612266]
I have tried the ‘Simulation pacing’, changed the sample time of the subscriber block, changed the fixed step size; still getting the same random time interval.
I am attaching the simple example with all the setting that I am using in Simulink. Please let me know if some setting in simulink is the fault or something else. I am subscribing to ros2 topic which has a message type ”ackermann_msgs/AckermannDriveStamped". I checked the topic in ros2 environment and it has 30Hz frequency. Now when I subscribe in simulink and extract the ‘sec’ I don’t get the time duration same as in ros2.
For example: The sample of header.stamp.sec in ros2 looks like this
[t(1)….t(30),t(31)….t(60)]= [1715612265….1715612265, 1715612266….1715612266]
And the sample of the same topic when been subscribed in simulink and been saved in worksapce looks like this:
[t(1)….t(215), t(216)….t(875)]= [1715612265….1715612265, 1715612266….1715612266]
I have tried the ‘Simulation pacing’, changed the sample time of the subscriber block, changed the fixed step size; still getting the same random time interval.
I am attaching the simple example with all the setting that I am using in Simulink. Please let me know if some setting in simulink is the fault or something else. ros2, ros2 time, simulink pacing, subscriber, simulink, to workspace MATLAB Answers — New Questions