publish_ros2_topic
Publish a message to a ROS 2 topic for a specified duration by defining topic, message type, content, and time in seconds.
Instructions
Publishes a message to a specific ROS 2 topic for a given duration (in seconds).
Args:
topic: Topic name to publish to (e.g., "/cmd_vel")
msg_type: ROS 2 message type (e.g., "geometry_msgs/msg/Twist")
msg_content: Message to send (e.g., '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.5}}')
duration: Duration in seconds to continue publishing
Example:
topic: "/cmd_vel"
msg_type: "geometry_msgs/msg/Twist"
msg_content: '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.5}}'
duration: 5
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| duration | Yes | ||
| msg_type | Yes | ||
| msg_content | Yes |