问题描述: 打开Gazebo加载已经设置好的world之后,出现小车模型不见的情况。
终端显示
[spawn_entity.py-5] [INFO] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-5] [INFO] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-5] [INFO] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-5] [INFO] [spawn_entity]: Spawn status: Entity [car] already exists.
[spawn_entity.py-5] [ERROR] [spawn_entity]: Spawn service failed. Exiting.
[ERROR] [spawn_entity.py-5]: process has died [pid 214091, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -entity car -file /home/***/****/src/car_description/urdf/car_base_gazebo.urdf --ros-args'].
问题解决:
重启Gazebo
pkill gzserver
pkill gzclient
ros2 launch <your_launch_file>
莫名其妙的问题,问chatgpt莫名其妙的解决了。
以后Gazebo的问题可以都先尝试终端kill掉还没结束的进程再重启看看。