read_topic
Fetch the latest message from a ROS 2 topic and return serialized data with age in milliseconds; set latched for one-shot topics like /map.
Instructions
Read the latest message from a ROS2 topic. Returns the serialized message and data age in milliseconds. For latched topics (/map, /robot_description), set latched=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | Topic name, e.g. '/scan' | |
| latched | No | Set true for topics published once on connect (/map, /robot_description) | |
| msg_type | No | ROS2 message type, e.g. 'sensor_msgs/LaserScan' | std_msgs/String |
| timeout_ms | No | Max wait time in milliseconds |