Practice the ROS2 Command Line - Topic Echo coding problem in CLI Tools. Browser-based execution with automated grading — no local ROS install required. 88% of engineers pass this challenge.
A subscriber listens to a topic and calls your function every time a new message arrives. It's the receiving side of the publisher/subscriber pattern.
Key API:
self.sub = self.create_subscription(MessageType, '/topic', self.callback, queue_depth)
The callback receives the message automatically:
def callback(self, msg):
self.get_logger().info(f'Received: {msg.data}')
Logging levels:
self.get_logger().info('normal message')
self.get_logger().warn('something unusual')
self.get_logger().error('something went wrong')
Create a ROS2 Python node that listens to messages from a topic and processes them. This completes the communication loop started by the publisher.
simple_subscriber/chatterstd_msgs/Stringself.get_logger().info()Input:
/chatter (std_msgs/String) - Receives string messagesOutput:
self to the callback method definition.It is a hands-on CLI Tools challenge on SimuCode where you implement and run ROS2 code in the browser with runtime-verified tests.
Open this page, sign in, and solve the problem in the built-in IDE. Your solution is graded against real ROS2 execution checks.
This Easy problem focuses on python, subscriber, cli skills used in robotics interviews and production systems.