Topics quiz system is failing me

Hello there,
I believe the quizing system is failing me today with incorrect findings. After I corrected my mistake at 8.0 score yesterday I re-run and failed today due to:
:heavy_multiplication_x: [08:18:54] [assess] Not subscribed to /scan. I had big plans for this!

I know that I had not touched anything related to subscription code hence I re-run the quiz again right away and failed at the different step:
:heavy_multiplication_x: [08:29:06][assess] Not publishing to /cmd_vel. We can’t continue like this.

Here is my command line output for my node being subscribed to “/scan” topic by my node “topics_quiz_node”.

$ ros2 topic info /scan -v
Type: sensor_msgs/msg/LaserScan

Publisher count: 1
Node name: lidar_1Node namespace: /
Topic type: sensor_msgs/msg/LaserScan
Endpoint type: PUBLISHER
GID: 01.0f.e5.32.05.01.b7.91.01.00.00.00.00.00.3b.03.00.00.00.00.00.00.00.00
QoS profile:
Reliability: RELIABLE
History (Depth): UNKNOWN
Durability: VOLATILE
Lifespan: Infinite
Deadline: Infinite
Liveliness: AUTOMATIC
Liveliness lease duration: Infinite

Subscription count: 1

Node name: topics_quiz_node
Node namespace: /
Topic type: sensor_msgs/msg/LaserScan
Endpoint type: SUBSCRIPTION
GID: 01.0f.e8.5e.0f.12.ec.7d.01.00.00.00.00.00.13.04.00.00.00.00.00.00.00.00
QoS profile:
Reliability: RELIABLE
History (Depth): UNKNOWN
Durability: VOLATILE
Lifespan: Infinite
Deadline: Infinite
Liveliness: AUTOMATIC
Liveliness lease duration: Infinite

Here is the output for my robot moving and avoiding obsticle:

$ ros2 launch topics_quiz topics_quiz.launch.py
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2024-12-16-16-25-05-441095-2_xterm-4622
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [topics_quiz_node-1]: process started with pid [4623]
[topics_quiz_node-1] [INFO] [1734366306.079903204] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366306.579913257] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366307.079946310] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366307.579953327] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366308.079869158] [topics_quiz_node]: Center: 0.989112
[topics_quiz_node-1] [INFO] [1734366308.079921700] [topics_quiz_node]: Moving left
[topics_quiz_node-1] [INFO] [1734366308.579923375] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366309.080385129] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366309.579977106] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366310.079984350] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366310.580318677] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366311.079941401] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366311.579947986] [topics_quiz_node]: Moving forward
[topics_quiz_node-1] [INFO] [1734366312.079943601] [topics_quiz_node]: Right: 0.632240
[topics_quiz_node-1] [INFO] [1734366312.080000043] [topics_quiz_node]: Moving left
[topics_quiz_node-1] [INFO] [1734366312.579919565] [topics_quiz_node]: Right: 0.684156
[topics_quiz_node-1] [INFO] [1734366312.579975815] [topics_quiz_node]: Moving left
[topics_quiz_node-1] [INFO] [1734366313.079953808] [topics_quiz_node]: Moving forward

The problem here is that there’s something in your topics quiz node logic causing a segmentation fault (a C++ hard nut) to happen at random. I would start with the most recent change and check for what it could be.

The error in the logs is:

[ERROR] [topics_quiz_node-1]: process has died [pid 1544, exit code -11, cmd '/home/user/ros2_ws/install/topics_quiz/lib/topics_quiz/topics_quiz_node --ros-args'].
  • Code -11 is SIGSEGV.

The error started happening right from the 2nd attempt, after you made changes to fix the first not subscribed to /scan failure at the first attempt.

I’ve added 3 more trials for you, so you can take your time to fix this problem.

I have tweaked the code a little bit and passed on the next the try. Thank you again for your response.

1 Like

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