Study: Software(SW)/SW: Error Bug Fix

[Error fix] Solved 'symbol lookup error: /opt/ros/foxy/lib/robot_state_publisher/robot_state_publisher: undefined symbol: _ZNK12class_loader11ClassLoader14getLibraryPathB5cxx11Ev'(Ubuntu 20.04, ros noetic, ros2 foxy)

DrawingProcess 2023. 8. 31. 16:12
반응형

# Problem

I use ros2 foxy with ubuntu 20.04 and tried to below command:

$ ros2 launch turtlebot3_gazebo turtlebot3_house.launch.py 
[INFO] [launch]: All log files can be found below /home/sjchoi/.ros/log/2023-08-30-15-07-57-052486-sjchoi-Prestige-15-A10SC-18974
[INFO] [launch]: Default logging verbosity is set to INFO
urdf_file_name : turtlebot3_waffle.urdf
[INFO] [gzserver-1]: process started with pid [18976]
[INFO] [gzclient   -2]: process started with pid [18978]
[INFO] [robot_state_publisher-3]: process started with pid [18982]
[robot_state_publisher-3] /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
[ERROR] [robot_state_publisher-3]: process has died [pid 18982, exit code 127, cmd '/opt/ros/foxy/lib/robot_state_publisher/robot_state_publisher /opt/ros/foxy/share/turtlebot3_description/urdf/turtlebot3_waffle.urdf --ros-args -r __node:=robot_state_publisher --params-file /tmp/launch_params_ip8swmzq'].
[gzserver-1] gzserver: symbol lookup error: /opt/ros/foxy/lib/libgazebo_ros_init.so: undefined symbol: _ZN10gazebo_ros9ThrottlerC1Ed
[ERROR] [gzserver-1]: process has died [pid 18976, exit code 127, cmd 'gzserver /opt/ros/foxy/share/turtlebot3_gazebo/worlds/turtlebot3_houses/waffle.model                                                                      -s libgazebo_ros_init.so   -s libgazebo_ros_factory.so   -s libgazebo_ros_force_system.so       '].
[ERROR] [gzclient   -2]: process has died [pid 18978, exit code 255, cmd 'gzclient   '].

# Solution

# select ros1 or ros2 in terminal
echo "ros noetic(1) or ros2 foxy(2)?"
read edition
if [ "$edition" -eq "1" ];then
  source /opt/ros/noetic/setup.bash
else
  source /opt/ros/foxy/setup.bash
fi

# Reference

[Github] Ros2 foxy symbol lookup error issue #153: https://github.com/ros/robot_state_publisher/issues/153

반응형