First quiz not working

After completing the other chapters, I returned to the first quiz (which always failed) and recreated the package. It still gives the same error:

image

Either I am missing the obvious, or this is a gradebot error, as the package is there:

image

and everything runs well if I manually launch the node:

user:~/ros2_ws$ ros2 launch topics_quiz topics_quiz.launch.py

@bayodesegun can someone please have a look?

Thank you,
Johan

Hello @JRTG ,

I just tested your package in my system and got a 10:

So, this indicates there’s something wrong with your workspace. Do the following to fix it:

  1. Remove the wrong compilation folders:

Compilation folders like build or install don’t have to be inside the src folder of your workspace. Remove them.

  1. Generate the compilation files in the correct directories.

In the correct compilation folders, you don’t have your package topics_quiz compiled. So, go to the root of your workspace and compile your package there:

cd /home/user/ros2_ws/
colcon build --packages-select topics_quiz

Summary: Compilation is ALWAYS done in the root of your workspace (/home/user/ros2_ws). Not in any other directory.

You might want to review section 2.4 from Chapter 2, where the compilation process is explained.

Hi @albertoezquerro ,

Thank you for checking this out.
I know about the need to compile in the root workspace directory, however seems this is error-prone, to me at least. :wink: Same goes for forgetting to issue a cd src before ros2 pkg create

Anyway, I tried again after recreating a clean build and workspace structure, but it still fails.

I did the following:

  • Delete build/, install/ and log/ folders, both in ~/ros2_ws/ as well as in ~/ros2_ws/src/,

  • Remove all folders from ~/ros2_ws/src/, except the topics_quiz folder,
    (I moved the folders to ~/old/),

  • Compile and test:
    source /opt/ros/galactic/setup.bash
    cd ~/ros2_ws/
    colcon build
    source install/setup.bash
    ros2 launch topics_quiz topics_quiz.launch.py
    → All works correctly as expected.

  • This is the directory structure:
    image

  • Then click the “submit quiz” icon and submit,

  • But the grade bot still gives the same error:
    image

That was trial 5 from 5… :slight_smile:

Regards,
Johan

Hello @JRTG ,

That is really weird. It seems there’s a problem with your specific session. I will check this today and come back to you once it is solved. I will also restore your Quiz tries, so don’t worry about that.

Hello @JRTG ,

Could you try to correct this Quiz again? Let me know if it works now.

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