Restart fails after reintering the course

my service did start properly but after leaving the course and reentering it the start of a service stops with this

[INFO] [launch]: All log files can be found below /home/user/.ros/log/2022-11-16-19-43-06-448666-4_xterm-6458
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [services_quiz_server-1]: process started with pid [6460]
[services_quiz_server-1] Traceback (most recent call last):
[services_quiz_server-1]   File "/home/user/ros2_ws/install/services_quiz/lib/services_quiz/services_quiz_server", line 11, in <module>
[services_quiz_server-1]     load_entry_point('services-quiz==0.0.0', 'console_scripts', 'services_quiz_server')()
[services_quiz_server-1]   File "/home/user/ros2_ws/install/services_quiz/lib/python3.8/site-packages/services_quiz/services_quiz_server.py", line 67, in main
[services_quiz_server-1]     service = Service()
[services_quiz_server-1]   File "/home/user/ros2_ws/install/services_quiz/lib/python3.8/site-packages/services_quiz/services_quiz_server.py", line 13, in __init__
[services_quiz_server-1]     self.publisher_ = self.create_publisher(Twist, 'cmd_vel', 10)
[services_quiz_server-1]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/node.py", line 1286, in create_publisher
[services_quiz_server-1]     check_is_valid_msg_type(msg_type)
[services_quiz_server-1]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/type_support.py", line 35, in check_is_valid_msg_type
[services_quiz_server-1]     check_for_type_support(msg_type)
[services_quiz_server-1]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/type_support.py", line 20, in check_for_type_support
[services_quiz_server-1]     ts = msg_or_srv_type.__class__._TYPE_SUPPORT
[services_quiz_server-1] AttributeError: type object 'type' has no attribute '_TYPE_SUPPORT' This might be a ROS 1 message type but it should be a ROS 2 message type. Make sure to source your ROS 2 workspace after your ROS 1 workspace.
[ERROR] [services_quiz_server-1]: process has died [pid 6460, exit code 1, cmd '/home/user/ros2_ws/install/services_quiz/lib/services_quiz/services_quiz_server --ros-args'].

I did rm build -r build install and rebuild the whole workspace. Anything else I could cleanup to make it start again ?

HI @vkuehn ,

This seems like a source issue. Did you do source /opt/ros/noetic/setup.bash followed by source /opt/ros/galactic/setup.bash? This usually solves this problem.

Regards,
Girish

Hi @girishkumar.kannan ,

thanks for that unfortunatetly didn’t help. You have additional ideas ?

if not I would ask in the course section !?

Regards,
Volker

Hi @vkuehn ,

This seems to be a commonly occurring problem that also has happened to me and sourcing worked for me.
I don’t seem to have any other solutions in my mind. You can check your package again from the beginning - the package.xml and setup.py files.

Did you do source install/setup.bash after building your package with colcon build ... ?

You don’t have to ask this question again in the course section. Just change the tags on the title of this post by editing it. The pencil icon next to the post title on the very top of the page.

– Girish

Hi @girishkumar.kannan ,

it did work fine until I logged in again. Now it dos work fine again. Thought there is an issue sometimes where only waiting for the bootcycle of theconstruct vm conatiners help.

Also deleted browser cache.

Thanks a lot

@vkuehn ,

Ah yes! The good old clear history and cookies technique!

Glad you got it working!

– Girish

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