在gazebo中无法加载模型
-
环境:Ubuntu22.04 humble
在根据小鱼链接文本教程学习ROS2时,gazebo无法加载出模型,下面是一些报错。
[INFO] [launch]: All log files can be found below /home/wl/.ros/log/2023-07-03-14-54-37-699287-aq-53026
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gazebo-1]: process started with pid [53027]
[INFO] [spawn_entity.py-2]: process started with pid [53029]
[spawn_entity.py-2] [INFO] [1688367278.230553413] [spawn_entity]: Spawn Entity started
[spawn_entity.py-2] [INFO] [1688367278.230850288] [spawn_entity]: Loading entity XML from file /home/wl/Documents/fishbot_ws/install/fishbot_description/share/fishbot_description/urdf/fishbot_gazebo.urdf
[spawn_entity.py-2] Traceback (most recent call last):
[spawn_entity.py-2] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 370, in <module>
[spawn_entity.py-2] main()
[spawn_entity.py-2] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 365, in main
[spawn_entity.py-2] exit_code = spawn_entity_node.run()
[spawn_entity.py-2] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 143, in run
[spawn_entity.py-2] self.get_logger().error('Error: specified file %s does not exist', self.args.file)
[spawn_entity.py-2] TypeError: RcutilsLogger.error() takes 2 positional arguments but 3 were given
[gazebo-1] Gazebo multi-robot simulator, version 11.10.2
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] http://gazebosim.org
[gazebo-1]
[gazebo-1] Gazebo multi-robot simulator, version 11.10.2
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] http://gazebosim.org
[gazebo-1]
[ERROR] [spawn_entity.py-2]: process has died [pid 53029, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -entity fishbot -file /home/wl/Documents/fishbot_ws/install/fishbot_description/share/fishbot_description/urdf/fishbot_gazebo.urdf --ros-args'].
[gazebo-1] [Msg] Waiting for master.
[gazebo-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gazebo-1] [Msg] Publicized address: 192.168.0.130
[gazebo-1] [Wrn] [GuiIface.cc:120] Could not find the Qt platform plugin "wayland" in ""
[gazebo-1] [Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
[gazebo-1] [Wrn] [Publisher.cc:135] Queue limit reached for topic /gazebo/default/user_camera/pose, deleting message. This warning is printed only once.
-
试试安装
sudo apt install qtwayland5 -
@892530731 你好,谢谢,我安装了,原来那个报错还是存在的,依然无法加载模型出来。现在又增加了新的问题,gazebo闪退,提示如下:
[spawn_entity.py-2] Traceback (most recent call last):
[spawn_entity.py-2] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 370, in <module>
[spawn_entity.py-2] main()
[spawn_entity.py-2] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 365, in main
[spawn_entity.py-2] exit_code = spawn_entity_node.run()
[spawn_entity.py-2] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 143, in run
[spawn_entity.py-2] self.get_logger().error('Error: specified file %s does not exist', self.args.file)
[spawn_entity.py-2] TypeError: RcutilsLogger.error() takes 2 positional arguments but 3 were given
[ERROR] [spawn_entity.py-2]: process has died [pid 6701, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -entity fishbot -file /home/wl/Documents/fishbot_ws/install/fishbot_description/share/fishbot_description/urdf/fishbot_gazebo.urdf --ros-args'].
[gazebo-1] [Msg] Waiting for master.
[gazebo-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gazebo-1] [Msg] Publicized address: 192.168.0.130
[gazebo-1] [Wrn] [GuiIface.cc:120] QSocketNotifier: Can only be used with threads started with QThread
[gazebo-1] [Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:132] Unable to create the rendering window
[gazebo-1] [Err] [WindowManager.cc:139] EXCEPTION: Unable to create the rendering window
[gazebo-1]
[gazebo-1]
[gazebo-1] terminate called after throwing an instance of 'gazebo::common::Exception'
[gazebo-1] [Msg] Waiting for master.
[gazebo-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gazebo-1] [Msg] Publicized address: 192.168.0.130
[gazebo-1] [Msg] Loading world file [/usr/share/gazebo-11/worlds/empty.world]
[ERROR] [gazebo-1]: process has died [pid 6699, exit code 255, cmd 'gazebo --verbose -s libgazebo_ros_init.so -s libgazebo_ros_factory.so'].
[gazebo-1] -
@892530731 我又把这个包卸载了,我的gazebo不闪退了,但是还是无法加载出模型,可能这个方法不太适合我出现的这个问题,再次感谢。
-
@2918095496 补充一下,使用小鱼的rqt call的方法可以在gazebo中加载出模型,但是加载出来的模型不完整,没有左右轮子。求帮助!
-
我和你一样的报错,你先把conda退出来
“conda deactivate”
试试 -
@759323061我不太明白你说的操作,能具体一点吗,感谢!
-
@2918095496 就是比平时多一步,再每个要用到的终端里输入conda deactivate,就行或者直接把miniconda卸载就行
-
@759323061 我的运行没有这个命令,应该是我没有装这个。
-
@759323061 是我的加载路径被我给搞错了,所以一直没有模型。谢谢你的帮助
-
您好,请问最后这个问题怎么解决的呢,我跟您这个问题一模一样
-
@1371246828 urdf_model_path = '/home/ws_test/rviz_test/src/fishbot_description/urdf/fishbot_gazebo.urdf'直接变成自己的加载路径试一下
-
找到launch.py将urdf_model_path后的路径换成urdf文件的绝对路径