This example shows how to time stamp a ROS message with the current system time of your computer. Use the Current Time block and assign the output to the
std_msgs/Header message in the Stamp field. Publish the message on a desired topic.
Connect to a ROS network.
Initializing ROS master on http://bat1012603glnxa64:35007/. Initializing global node /matlab_global_node_59256 with NodeURI http://bat1012603glnxa64:40909/
Open the Simulink model provided with this example. The model uses a Bus Assignment block to add the Current Time output to the Stamp field of the ROS message.
Run the model. The Publish block should publish the Header message with the current system time.
Shut down the ROS network.
Shutting down global node /matlab_global_node_59256 with NodeURI http://bat1012603glnxa64:40909/ Shutting down ROS master on http://bat1012603glnxa64:35007/.