The problem is that your code crashes at some point (within 20 seconds), when the gradebot launches it.
Please fix the part causing that problem and try again. Here is the log:
ros2 launch topics_quiz topics_quiz.launch.py
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2024-08-05-03-17-07-851273-effe8d5746b8-499
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [topics_quiz_node-1]: process started with pid [501]
[topics_quiz_node-1] [INFO] [1722827829.030904853] [topics_quiz_node]: timer: "0"
[topics_quiz_node-1] Traceback (most recent call last):
[topics_quiz_node-1] File "/home/user/ros2_ws/install/topics_quiz/lib/topics_quiz/topics_quiz_node", line 33, in <module>
[topics_quiz_node-1] sys.exit(load_entry_point('topics-quiz==0.0.0', 'console_scripts', 'topics_quiz_node')())
[topics_quiz_node-1] File "/home/user/ros2_ws/install/topics_quiz/lib/python3.10/site-packages/topics_quiz/topics_quiz_node.py", line 128, in main
[topics_quiz_node-1] rclpy.spin(quiz)
[topics_quiz_node-1] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/__init__.py", line 222, in spin
[topics_quiz_node-1] executor.spin_once()
[topics_quiz_node-1] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 712, in spin_once
[topics_quiz_node-1] raise handler.exception()
[topics_quiz_node-1] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
[topics_quiz_node-1] self._handler.send(None)
[topics_quiz_node-1] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 418, in handler
[topics_quiz_node-1] await call_coroutine(entity, arg)
[topics_quiz_node-1] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 332, in _execute_timer
[topics_quiz_node-1] await await_or_execute(tmr.callback)
[topics_quiz_node-1] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
[topics_quiz_node-1] return callback(*args)
[topics_quiz_node-1] File "/home/user/ros2_ws/install/topics_quiz/lib/python3.10/site-packages/topics_quiz/topics_quiz_node.py", line 52, in timer_callback
[topics_quiz_node-1] postion_x = self.odom_msg.pose.pose.position.x
[topics_quiz_node-1] AttributeError: 'int' object has no attribute 'pose'
By the way, thanks for reporting the problem early (at the very first trial)!
I don’t see any errors in the code. It runs smooth in the simulator as shown in the attached screen recorded (sorry when I tried to upload the file to the discussion I received “Sorry, new users can not upload attachments.”) Let me know other ways to share the program running and publishing topics. Thanks, Miguel.
You may not “see” any errors in the code, even if it’s there!
Your code might not be initializing variables properly or not considering edge cases for certain variables. This will sometimes lead to random errors like this.
For instance, this part of the error reveals something brittle about your code:
[topics_quiz_node-1] postion_x = self.odom_msg.pose.pose.position.x
[topics_quiz_node-1] AttributeError: 'int' object has no attribute 'pose'
It is likely that self.odom_msg was initialized as integer, or an integer was assigned to it at some point.
It should be initialized as an empty Odom message instead, and also assigned an Odom message.
Please take a look at this, adjust your code, and submit again.