ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If you examine std_msgs/msg/Header, the only two attributes are stamp and frame_id.

For your purpose, you could create your own custom message StampedArray.msg:

builtin_interfaces/Time stamp
std_msgs/Float32MultiArray array

Then you should be able to do something like:

data_to_send = StampedArray()
data_to_send.stamp = pp.get_clock().now().to_msg()
data_to_send.array.data = my_array

If you examine std_msgs/msg/Header, the only two attributes are stamp and frame_id.

For your purpose, you could create your own custom message message StampedArray.msg:

builtin_interfaces/Time stamp
std_msgs/Float32MultiArray array

Then you should be able to do something like:

data_to_send = StampedArray()
data_to_send.stamp = pp.get_clock().now().to_msg()
data_to_send.array.data = my_array