Error grading topics_quiz

I am not sure why grading is failing. The node name seems correct.
The error says:
:heavy_multiplication_x: [14:41:56] [assess] Not subscribed to /scan. I had big plans for this!

  • Did you create a subscriber correctly to the topic /scan in your source code?
  • Did you name your node correctly in the C++ source and the launch file? It should be topics_quiz_node - Did you use the right node name in the launch file? It should be topics_quiz_node (mark: 4.0)

Here is my launch file:

from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    return LaunchDescription([
        Node(
            package='topics_quiz',
            executable='topics_quiz_node',
            output='screen'),
    ])

And here is my node code class definition with the subscription to the scan topic:

class TopicsQuiz : public rclcpp::Node {
public:
  TopicsQuiz() : Node("topics_quiz_node") {
    subscription_ = this->create_subscription<sensor_msgs::msg::LaserScan>(
        "scan", 10, std::bind(&TopicsQuiz::topic_callback, this, _1));

    publisher_ =
        this->create_publisher<geometry_msgs::msg::Twist>("cmd_vel", 10);
  }
...
};

It seems the grader is buggy. After I reloaded the page and the shell terminals, it passed.

1 Like

It’s possible you had some code running in your terminals before submitting the quiz. This can confuse the gradebot.

Same thing just happened to me. I don’t have anything running in the terminals and I reset the simulation before submitting the quiz.
To me it’s working when I execute:
source /opt/ros/humble/setup.bash
cd ~/ros2_ws
colcon build
source install/setup.bash
ros2 launch topics_quiz topics_quiz.launch.py

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.

Did you check this point?

  • Did you name your node correctly in the C++ source and the launch file? It should be topics_quiz_node
  • Did you use the right node name in the launch file? It should be topics_quiz_node (mark: 4.0)

Thanks Bayode for answering!
I finally made it work, The executable was named “topics_quiz_node”, but the node name was “topics_quiz”. Stupid mistake.
In case anyone has the same problem, you can check the node name by issuing a “ros2 node list” when the node is running

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.