Dev environment issues, errors, ROS2 Learning Week Day 3 | Basic Concepts

I am following the course notebook and get the following output when I execute these commands…

Edit: here is a link to the project
Temporary link:

Expires at 2022-05-20 06:21

Note, I get an error “new users can only put two links in a post”, but it is counting the error output below, so I have edited that, that is annoying.

Freshly “forked” the project according to the instructional video here that I am learning with.

source /opt/ros/foxy/setup.bash
source ~/simulation_ws/install/setup.bash
cd ~/simulation_ws/src/t3_foxy/
./start_sim_house.sh

user:~/simulation_ws/src/t3_foxy$ ./start_sim_house.sh
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2022-05-16-06-01-22-597272-2_xterm-5724
[INFO] [launch]: Default logging verbosity is set to INFO
urdf_file_name : turtlebot3_waffle.urdf
/home/user/simulation_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/launch/robot_state_publisher.launch.py:47: UserWarning: The parameter ‘node_executable’ is deprecated, use ‘executable’ instead
Node(
/home/user/simulation_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/launch/robot_state_publisher.launch.py:47: UserWarning: The parameter ‘node_name’ is deprecated, use ‘name’ instead
Node(
[INFO] [gazebo-1]: process started with pid [5744]
[INFO] [robot_state_publisher-2]: process started with pid [5746]
[ERROR] [robot_state_publisher-2]: process has died [pid 5746, exit code 127, cmd ‘/opt/ros/foxy/lib/robot_state_publisher/robot_state_publisher /home/user/simulation_ws/install/turtlebot3_description/share/turtlebot3_description/urdf/turtlebot3_waffle.urdf --ros-args -r __node:=robot_state_publisher -r __node:=robot_state_publisher --params-file /tmp/launch_params__safq54q’].
[INFO] [service-3]: process started with pid [5748]
[INFO] [service2-4]: process started with pid [5750]
[robot_state_publisher-2] /opt/ros/foxy/lib/robot_state_publisher/robot_state_publisher: symbol lookup error: /opt/ros/foxy/lib/robot_state_publisher/robot_state_publisher: undefined symbol: _ZNK12class_loader11ClassLoader14getLibraryPathB5cxx11Ev
[gazebo-1] ++ ls /usr/bin/gzclient-11.5.1
[gazebo-1] + gzclient_path=/usr/bin/gzclient-11.5.1
[gazebo-1] + DISPLAY=:2
[gazebo-1] + /usr/bin/gzclient-11.5.1 --verbose /home/user/simulation_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/worlds/turtlebot3_houses/waffle.model -s libgazebo_ros_init.so
[service-3] Traceback (most recent call last):
[service-3] File “/home/user/simulation_ws/install/services_pkg/lib/services_pkg/service”, line 33, in
[service-3] sys.exit(load_entry_point(‘services-pkg==0.0.0’, ‘console_scripts’, ‘service’)())
[service-3] File “/home/user/simulation_ws/install/services_pkg/lib/python3.8/site-packages/services_pkg/service_moving.py”, line 33, in main
[service-3] moving_service = Service()
[service-3] File “/home/user/simulation_ws/install/services_pkg/lib/python3.8/site-packages/services_pkg/service_moving.py”, line 12, in init
[service-3] self.srv = self.create_service(Empty, ‘moving’, self.Empty_callback)
[service-3] self.srv = self.create_service(Empty, ‘moving’, self.Empty_callback)
[service-3] File “/opt/ros/foxy/lib/python3.8/site-packages/rclpy/node.py”, line 1295, in create_service
[service-3] check_for_type_support(srv_type)
[service-3] File “/opt/ros/foxy/lib/python3.8/site-packages/rclpy/type_support.py”, line 20, in check_for_type_support
[service-3] ts = msg_type.class._TYPE_SUPPORT
[service-3] 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.
[service2-4] Traceback (most recent call last):
[service2-4] File “/home/user/simulation_ws/install/services_pkg/lib/services_pkg/service2”, line 33, in
[service2-4] sys.exit(load_entry_point(‘services-pkg==0.0.0’, ‘console_scripts’, ‘service2’)())
[service2-4] File “/home/user/simulation_ws/install/services_pkg/lib/python3.8/site-packages/services_pkg/service_stop.py”, line 33, in main
[service2-4] service = Service()
[service2-4] File “/home/user/simulation_ws/install/services_pkg/lib/python3.8/site-packages/services_pkg/service_stop.py”, line 12, in init
[service2-4] self.srv = self.create_service(Empty, ‘stop’, self.Empty_callback)
[service2-4] File “/opt/ros/foxy/lib/python3.8/site-packages/rclpy/node.py”, line 1295, in create_service
[service2-4] check_for_type_support(srv_type)
[service2-4] File “/opt/ros/foxy/lib/python3.8/site-packages/rclpy/type_support.py”, line 20, in check_for_type_support
[service2-4] ts = msg_type.class._TYPE_SUPPORT
[service2-4] AttributeError: type object ‘type’ has no attribute ‘_TYPE_SUPPORT’ This might be aROS 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.
[gazebo-1] Gazebo multi-robot simulator, version 11.5.1
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] edited out URL, getting error message “new users can only post 2 links”
[gazebo-1]
[gazebo-1] Gazebo multi-robot simulator, version 11.5.1
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] edited out URL, getting error message “new users can only post 2 links”
[gazebo-1]
[ERROR] [service-3]: process has died [pid 5748, exit code 1, cmd ‘/home/user/simulation_ws/install/services_pkg/lib/services_pkg/service --ros-args’].
[ERROR] [service2-4]: process has died [pid 5750, exit code 1, cmd ‘/home/user/simulation_ws/install/services_pkg/lib/services_pkg/service2 --ros-args’].
[gazebo-1] gzserver: symbol lookup error: /opt/ros/foxy/lib/libgazebo_ros_init.so: undefined symbol: _ZN10gazebo_ros9ThrottlerC1Ed
[gazebo-1] escalating to SIGKILL on client
[ERROR] [gazebo-1]: process has died [pid 5744, exit code 255, cmd ‘gazebo --verbose /home/user/simulation_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/worlds/turtlebot3_houses/waffle.model -s libgazebo_ros_init.so’].
user:~/simulation_ws/src/t3_foxy$

There is a similar error with the final exercise in this project as well.
ROS2 Learning Week Day 5 | Final Project

Exercise 2.1, error occurs when executing this command…
ros2 launch exercise21_pkg exercise21_pkg_launch_file.launch.py

Temporary link:

Expires at 2022-05-20 11:11

user:~/ros2_ws$ ros2 launch exercise21_pkg exercise21_pkg_launch_file.launch.py
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2022-05-16-11-04-51-730059-3_xterm-22266
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [exercise21-1]: process started with pid [22366]
[exercise21-1] Traceback (most recent call last):
[exercise21-1] File “/home/user/ros2_ws/install/exercise21_pkg/lib/exercise21_pkg/exercise21”, line 33, in
[exercise21-1] sys.exit(load_entry_point(‘exercise21-pkg==0.0.0’, ‘console_scripts’, ‘exercise21’)())
[exercise21-1] File “/home/user/ros2_ws/install/exercise21_pkg/lib/python3.8/site-packages/exercise21_pkg/exercise21.py”, line 58, in main
[exercise21-1] exercise21 = Exercise21()
[exercise21-1] File “/home/user/ros2_ws/install/exercise21_pkg/lib/python3.8/site-packages/exercise21_pkg/exercise21.py”, line 18, in init
[exercise21-1] self.publisher_ = self.create_publisher(Twist, ‘cmd_vel’, 10)
[exercise21-1] File “/opt/ros/foxy/lib/python3.8/site-packages/rclpy/node.py”, line 1140, in create_publisher
[exercise21-1] check_for_type_support(msg_type)
[exercise21-1] File “/opt/ros/foxy/lib/python3.8/site-packages/rclpy/type_support.py”, line 20, in check_for_type_support
[exercise21-1] ts = msg_type.class._TYPE_SUPPORT
[exercise21-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] [exercise21-1]: process has died [pid 22366, exit code 1, cmd ‘/home/user/ros2_ws/install/exercise21_pkg/lib/exercise21_pkg/exercise21 --ros-args’].

Hello @alland ,

I’ve been doing some tests and it looks like these issues are related to having ROS1 and ROS2 sourced at the same time. To fix, do the following steps:

  1. Open a new Shell
  2. Source ROS2: source /opt/ros/foxy/setup.bash
  3. Go to simulation_ws: cd simulation_ws/
  4. Remove install, build and log folders: rm -rf build/ install/ log/
  5. Recompile the workspace: colcon build
  6. Source the workspace: source install/setup.bash
  7. Go to the t3_foxy directory: cd ~/simulation_ws/src/t3_foxy/
  8. Run the script: ./start_sim_house.sh

Following these steps, the simulation should be launched properly. This should also apply for the Final Project unit.

1 Like

It works now, thank you