鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    小鱼小鱼我运行fishbot的gazebo为什么会出现这样的错误阿,本来在虚拟机里面好好的移植出来就这样了

    已定时 已固定 已锁定 已移动
    FishROS2GO
    fishbot gazebo
    3
    3
    577
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 3
      320562846
      最后由 编辑

      [Err] [RTShaderSystem.cc:480] Unable to find shader lib. Shader generating will fail. Your GAZEBO_RESOURCE_PATH is probably improperly set. Have you sourced <prefix>/share/gazebo/setup.bash?
      [spawn_entity.py-4] [INFO] [1740479071.797195348] [spawn_entity]: Calling service /spawn_entity
      [gzserver-2] [Msg] Loading world file [/home/jzx/chapt6/chapt6_ws/install/fishbot_description/share/fishbot_description/world/custom_room.world]
      [gzserver-2] [Err] [RenderEngine.cc:197] Failed to initialize scene
      [gzserver-2] gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:728: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::rendering::Scene; typename boost::detail::sp_member_access<T>::type = gazebo::rendering::Scene*]: Assertion `px != 0' failed.
      [gzclient-3] [Msg] Waiting for master.
      [gzclient-3] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
      [gzclient-3] [Msg] Publicized address: 172.17.131.16
      [gzclient-3] [Err] [RTShaderSystem.cc:480] Unable to find shader lib. Shader generating will fail. Your GAZEBO_RESOURCE_PATH is probably improperly set. Have you sourced <prefix>/share/gazebo/setup.bash?
      [ERROR] [gzserver-2]: process has died [pid 6037, exit code -6, cmd 'gzserver /home/jzx/chapt6/chapt6_ws/install/fishbot_description/share/fishbot_description/world/custom_room.world --verbose -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so'].
      [gzserver-2]
      [gzclient-3] [Err] [Scene.cc:227] Service call[/shadow_caster_material_name] timed out
      [gzclient-3] [Err] [Scene.cc:249] Service call[/shadow_caster_render_back_faces] timed out
      [gzclient-3] [Err] [RenderEngine.cc:197] Failed to initialize scene
      [gzclient-3] [Err] [GLWidget.cc:177] GLWidget could not create a scene. This will likely result in a blank screen.
      [gzclient-3] gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:728: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::rendering::Camera; typename boost::detail::sp_member_access<T>::type = gazebo::rendering::Camera*]: 断言 "px != 0" 失败。
      [ERROR] [gzclient-3]: process has died [pid 6039, exit code -6, cmd 'gzclient --gui-client-plugin=libgazebo_ros_eol_gui.so --verbose'].
      [gzclient-3]```
      code_text

      1 1 条回复 最后回复 回复 引用 0
      • 小伊小
        机器人小伊
        最后由 编辑

        从你提供的错误信息来看,你在运行 Gazebo 时遇到了几个问题,主要集中在环境变量设置不正确和场景初始化失败上。以下是一些可能的解决步骤:

        1. 设置 GAZEBO_RESOURCE_PATH:
          错误信息提示“Unable to find shader lib. Shader generating will fail. Your GAZEBO_RESOURCE_PATH is probably improperly set.” 表明 Gazebo 的资源路径可能没有正确设置。你需要确保 GAZEBO_RESOURCE_PATH 环境变量包含了 Gazebo 资源文件的路径。

          • 首先,找到你的 Gazebo 安装位置,通常是在 <prefix>/share/gazebo 目录下。
          • 然后,在你的 shell 配置文件中(如 .bashrc 或 .zshrc),添加以下行:
            export GAZEBO_RESOURCE_PATH=/path/to/your/gazebo/share/gazebo:$GAZEBO_RESOURCE_PATH
            
            确保替换 /path/to/your/gazebo 为你的实际 Gazebo 安装路径。
          • 执行 source ~/.bashrc 或 source ~/.zshrc 来更新环境变量。
        2. Source Gazebo Setup Script:
          错误信息还提到你可能没有运行 Gazebo 的 setup 脚本。确保你已经运行了:

          source /path/to/your/gazebo/share/gazebo/setup.bash
          

          同样,替换 /path/to/your/gazebo 为你的实际安装路径。

        3. 检查 Gazebo 和 ROS 的集成:
          由于你在使用 ROS 和 Gazebo 集成,确保所有相关的 ROS 插件和环境也都正确设置。特别是,如果你在使用 gzserver 和 gzclient 时添加了 ROS 插件(如 -slibgazebo_ros_init.so),确保这些插件的路径是正确的,并且它们已经正确编译和安装。

        4. 重新编译和安装:
          如果你从源代码安装了 Gazebo 或相关的 ROS 插件,确保所有组件都已正确编译和安装。有时候,编译错误或不完全的安装可能会导致运行时错误。

        5. 检查依赖:
          确保你的系统满足 Gazebo 的所有依赖要求,特别是图形和渲染相关的库。

        6. 运行权限:
          确保你有足够的权限来访问和执行 Gazebo 的文件和目录。

        7. 查看日志和调试信息:
          使用更详细的日志输出(如你已经在使用的 --verbose 选项)来进一步诊断问题。

        按照这些步骤操作后,重新尝试运行你的 Gazebo 模拟,看看问题是否得到解决。如果问题仍然存在,可能需要更深入地检查具体的配置和代码。


        以上为生成回答,仅供参考~

        我是小伊,已接入ChatGpt,所有回复,仅供参考~

        1 条回复 最后回复 回复 引用 0
        • 1
          1908594786 @320562846
          最后由 编辑

          @320562846 运行一下source /usr/share/gazebo/setup.bash,找到安装路径的这个文件source一下再运行就行

          1 条回复 最后回复 回复 引用 0
          • 第一个帖子
            最后一个帖子
          皖ICP备16016415号-7
          Powered by NodeBB | 鱼香ROS