First ROS2 topic
Publish a string message to a custom topic.
# In one terminal
ros2 topic pub /hello std_msgs/msg/String "{data: 'Hello, robot!'}"
# In another terminal
ros2 topic echo /helloLoading R2BOT…
LoadingNo Linux. No installation. No VM. Real ROS2 Humble, powered by WebAssembly.
Tip: This is real ROS2 Humble running in WebAssembly in your browser. No installation needed. Your code runs locally — nothing is sent to a server.
# In one terminal
ros2 topic pub /hello std_msgs/msg/String "{data: 'Hello, robot!'}"
# In another terminal
ros2 topic echo /helloimport rclpy
from rclpy.node import Node
class HelloNode(Node):
def __init__(self):
super().__init__('hello_node')
self.create_timer(1.0, self.tick)
def tick(self):
self.get_logger().info('hello')
rclpy.init()
rclpy.spin(HelloNode())ros2 topic pub /cmd_vel geometry_msgs/msg/Twist \
'{linear: {x: 0.2}, angular: {z: 0.0}}'Ready for a structured path?
Start the Wire track →