공부중

[터틀봇3] error 해결 [spawn_entity]: Spawn service failed. Exiting. 본문

인공지능...?/터틀봇 프로젝트

[터틀봇3] error 해결 [spawn_entity]: Spawn service failed. Exiting.

복습 2024. 10. 10. 09:52
728x90
~/turtlebot3_ws$ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

동작을 시켰는데 가제보가 켜지지 않고 아래와 같은 오류가 뜬 경우 

더보기
turtlebot3_world.launch.py
[INFO] [launch]: All log files can be found below /home/robo/.ros/log/2024-10-10-09-37-00-466082-ye2202-HP-Laptop-14s-fq0xxx-21020
[INFO] [launch]: Default logging verbosity is set to INFO
urdf_file_name : turtlebot3_burger.urdf
urdf_file_name : turtlebot3_burger.urdf
[INFO] [gzserver-1]: process started with pid [21021]
[INFO] [gzclient-2]: process started with pid [21023]
[INFO] [robot_state_publisher-3]: process started with pid [21025]
[INFO] [spawn_entity.py-4]: process started with pid [21027]
[robot_state_publisher-3] [INFO] [1728520622.310493144] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-3] [INFO] [1728520622.310625728] [robot_state_publisher]: got segment base_link
[robot_state_publisher-3] [INFO] [1728520622.310635045] [robot_state_publisher]: got segment base_scan
[robot_state_publisher-3] [INFO] [1728520622.310641677] [robot_state_publisher]: got segment caster_back_link
[robot_state_publisher-3] [INFO] [1728520622.310648280] [robot_state_publisher]: got segment imu_link
[robot_state_publisher-3] [INFO] [1728520622.310654642] [robot_state_publisher]: got segment wheel_left_link
[robot_state_publisher-3] [INFO] [1728520622.310660903] [robot_state_publisher]: got segment wheel_right_link
[spawn_entity.py-4] [INFO] [1728520622.706210434] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1728520622.706680850] [spawn_entity]: Loading entity XML from file /home/robo/turtlebot3_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/models/turtlebot3_burger/model.sdf
[spawn_entity.py-4] [INFO] [1728520622.707786877] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-4] [INFO] [1728520622.708189298] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-4] [ERROR] [1728520652.753440285] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory?
[spawn_entity.py-4] [ERROR] [1728520652.754228518] [spawn_entity]: Spawn service failed. Exiting.
[ERROR] [spawn_entity.py-4]: process has died [pid 21027, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -entity burger -file /home/robo/turtlebot3_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/models/turtlebot3_burger/model.sdf -x -2.0 -y -0.5 -z 0.01 --ros-args'].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-3] [INFO] [1728520725.383228445] [rclcpp]: signal_handler(signum=2)
[gzserver-1] [INFO] [1728520725.383381517] [rclcpp]: signal_handler(signum=2)
[ERROR] [gzclient-2]: process has died [pid 21023, exit code -2, cmd 'gzclient'].
[INFO] [robot_state_publisher-3]: process has finished cleanly [pid 21025]
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) again, ignoring...
[gzserver-1] [INFO] [1728520729.038063956] [rclcpp]: signal_handler(signum=2)
[ERROR] [gzserver-1]: process[gzserver-1] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [gzserver-1]: sending signal 'SIGTERM' to process[gzserver-1]
[gzserver-1] [INFO] [1728520730.390320475] [rclcpp]: signal_handler(signum=15)
[gzserver-1] [INFO] [1728520732.853791705] [rclcpp]: signal_handler(signum=15)
[ERROR] [gzserver-1]: process[gzserver-1] failed to terminate '10.0' seconds after receiving 'SIGTERM', escalating to 'SIGKILL'
[INFO] [gzserver-1]: sending signal 'SIGKILL' to process[gzserver-1]
[ERROR] [gzserver-1]: process has died [pid 21021, exit code -9, cmd 'gzserver /home/robo/turtlebot3_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/worlds/turtlebot3_world.world -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so'].

주요 문제는 아래와 같다. 

[spawn_entity.py-4] [ERROR] [1728520652.753440285] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory?
[spawn_entity.py-4] [ERROR] [1728520652.754228518] [spawn_entity]: Spawn service failed. Exiting.
[ERROR] [spawn_entity.py-4]: process has died [pid 21027, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -entity burger -file /home/robo/turtlebot3_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/models/turtlebot3_burger/model.sdf -x -2.0 -y -0.5 -z 0.01 --ros-args'].

 

 

 

1. Gazebo 플러그인 로드 확인

GazeboRosFactory 플러그인이 Gazebo에 로드되었는지 확인해야 합니다. 먼저 다음 명령어를 통해 Gazebo 플러그인을 로드할 수 있습니다

source /usr/share/gazebo/setup.bash

 

 


위 방법으로 해결하긴 했는데 만약 해결이 되지 않았다면 아래 부분도 확인해보자 

sudo apt install ros-humble-gazebo-ros-pkgs

source /opt/ros/humble/setup.bash
source ~/turtlebot3_ws/install/setup.bash

 

 

 

728x90