[Bug] script works fine

This is an error report.

Screenshot of the error

Error details

script works, pkg name, node name and launch file is correctly named

Your error report does not say what the problem is?

What is the problem? What is not working? Please include screenshots.

Hi @timottesen ,


  • the quiz test says the script exits unexpectedly, but when you launch it everything works just fine”,

could it be that you are instantiating an object and the instructions may be saying not to instantiate the main class?

Oh, I see you @timottesen replied as a private message rather than pressing the Reply button.

I’ll post your message here to be easier to follow:

Thank you that is helpful. I will look into «instantiating» and make sure I understand the concept correctly. This is the feedback I get.

The script is running when I launch it, and the robot stops where it is supposed to stop, so I have completed the task described in the topics quiz.

Will details like instantiating still affect my score?

Hi @timottesen, based on the feedback you sent, I could investigate it further.

I was checking here the logs of the auto-correction system and I found the following when the system was launching ros2 launch topics_quiz topics_quiz.launch.py:

file ‘topics_quiz.launch.py’ was not found in the share directory of package ‘topics_quiz’ which is at '/home/user/ros2_ws/install/topics_quiz/share/topics_quiz

As we can see, ROS2 complains that the launch file is expected to be at the /home/user/ros2_ws/install/topics_quiz/share/topics_quiz folder but it is not there.

Assuming that your topics_quiz is located at ~/ros2_ws/src/topics_quiz, you probably have to modify the setup.py file on that folder to let ROS know that the launch file has to be copied when the package is built.

The section that you may want to have a look at in that setup.py file is data_files, which is where you define the files that will be “packaged” when your package is built.

After you make your changes, please check if, when you compile your workspace, the launch file exists at /home/user/ros2_ws/install/topics_quiz/share/topics_quiz before submitting the quiz again.

Please let us know how it goes.

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