OSX M1 平台 gazebo 安装记录(失败)

官方安装流程

地址: classic.gazebosim.org/tutorials?t...

自动安装

  1. install

    arduino 复制代码
    curl -ssL http://get.gazebosim.org | sh
  2. Run

    复制代码
    gazebo

手动安装

  1. Install homebrew, which should also prompt you to install the XCode command-line tools:

    bash 复制代码
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install XQuartz, which provides X11 support and is required by Gazebo and OGRE

  3. Run the following commands to install gazebo quickly with a precompiled binary:

    bash 复制代码
    brew tap osrf/simulation
    brew install gazebo11
    gazebo

Homebrew 安装指定版本方式

  1. 下载 homebrew/core 仓库
bash 复制代码
# Tapping homebrew/core is no longer typically necessary.    # Add --force if you are sure you need it for contributing to Homebrew. 
brew tap homebrew/core --force
  1. 创建一个新的本地自定义仓库
sql 复制代码
brew tap-new ${User}/local-tap  
  1. 基于 homebrew/core 中的指定版本,创建 formulae
ini 复制代码
brew extract --version=10.1.0 tinyxml2 ${User}/local-tap 
  1. 安装指定版本
perl 复制代码
brew install ${User}/local-tap/tinyxml2@10.1.0
  1. brew link --overwrite tinyxml2@10.1.0
bash 复制代码
Error: The `brew link` step did not complete successfully                                                                                  
The formula built, but is not symlinked into /opt/homebrew                                                                                 
Could not symlink include/tinyxml2.h                                                                                                       
Target /opt/homebrew/include/tinyxml2.h                                                                                                    
is a symlink belonging to tinyxml2. You can unlink it:                                                                                     
  brew unlink tinyxml2                                                                                                                     
                                                                                                                                           
To force the link and overwrite all conflicting files:                                                                                     
  brew link --overwrite tinyxml2@10.1.0                                                                                                    
                                                                                                                                           
To list all files that would be deleted:                                                                                                   
  brew link --overwrite tinyxml2@10.1.0 --dry-run                                                                                          
                                                                                                                                           
Possible conflicting files are:                                                                                                            
/opt/homebrew/include/tinyxml2.h -> /opt/homebrew/Cellar/tinyxml2/11.0.0/include/tinyxml2.h                                                
Error: Could not symlink lib/cmake/tinyxml2/tinyxml2-config-version.cmake                                                                  
Target /opt/homebrew/lib/cmake/tinyxml2/tinyxml2-config-version.cmake                                                                      
is a symlink belonging to tinyxml2. You can unlink it:                                                                                     
  brew unlink tinyxml2                                                                                                              
To force the link and overwrite all conflicting files:                                                                                 
  brew link --overwrite tinyxml2                                                                                                                                                  
To list all files that would be deleted:                                                                                                   
  brew link --overwrite tinyxml2 --dry-run 
                 
Possible conflicting files are:                                                                                                            
/opt/homebrew/include/tinyxml2.h -> /opt/homebrew/Cellar/tinyxml2/11.0.0/include/tinyxml2.h                                                
Error: Could not symlink lib/cmake/tinyxml2/tinyxml2-config-version.cmake                                                                  
Target /opt/homebrew/lib/cmake/tinyxml2/tinyxml2-config-version.cmake                                                                      
is a symlink belonging to tinyxml2. You can unlink it:                                                                                     
  brew unlink tinyxml2                                                                                                                     
                                                                                                                                           
To force the link and overwrite all conflicting files:                                                                                     
  brew link --overwrite tinyxml2                                                                                                           
                                                                                                                                           
To list all files that would be deleted:                                                                                                   
  brew link --overwrite tinyxml2 --dry-run  

安装问题

1. Library not loaded: /opt/homebrew/opt/tinyxml2/lib/libtinyxml2.10.dylib

perl 复制代码
(ros2) ➜  ros2 gazebo                                                                                                                      
dyld[38724]: Library not loaded: /opt/homebrew/opt/tinyxml2/lib/libtinyxml2.10.dylib                                                       
  Referenced from: <9A2AC4A3-CBEE-3FE7-BE9C-8C89089CAB6B> /opt/homebrew/Cellar/gazebo11/11.15.0_6/bin/gazebo-11.15.0                       
  Reason: tried: '/Users/bytedance/miniconda3/opt/rviz_ogre_vendor/lib/libtinyxml2.10.dylib' (no such file), '/libtinyxml2.10.dylib' (no su
ch file), '/Users/bytedance/miniconda3/lib/gazebo-11/plugins/libtinyxml2.10.dylib' (no such file), '/libtinyxml2.10.dylib' (no such file), 
'/Users/bytedance/miniconda3/lib/gazebo-11/plugins/libtinyxml2.10.dylib' (no such file), '/libtinyxml2.10.dylib' (no such file), '/Users/by
tedance/miniconda3/lib/gazebo-11/plugins/libtinyxml2.10.dylib' (no such file), '/libtinyxml2.10.dylib' (no such file), '/opt/homebrew/opt/t
inyxml2/lib/libtinyxml2.10.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/tinyxml2/lib/libtinyxml2.10.dylib'
 (no such file), '/opt/homebrew/opt/tinyxml2/lib/libtinyxml2.10.dylib' (no such file), '/Users/bytedance/miniconda3/opt/rviz_ogre_vendor/li
b/libtinyxml2.10.dylib' (no such file), '/libtinyxml2.10.dylib' (no such file), '/Users/bytedance/miniconda3/lib/gazebo-11/plugins/libtinyx
ml2.10.dylib' (no such file), '/libtinyxml2.10.dylib' (no such file), '/Users/bytedance/miniconda3/lib/gazebo-11/plugins/libtinyxml2.10.dyl
ib' (no such file), '/libtinyxml2.10.dylib' (no such file), '/Users/bytedance/miniconda3/lib/gazebo-11/plugins/libtinyxml2.10.dylib' (no su
ch file), '/libtinyxml2.10.dylib' (no such file), '/opt/homebrew/Cellar/tinyxml2/11.0.0/lib/libtinyxml2.10.dylib' (no such file), '/System/
Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/tinyxml2/11.0.0/lib/libtinyxml2.10.dylib' (no such file), '/opt/homebrew/Cellar/tinyxml2/1
1.0.0/lib/libtinyxml2.10.dylib' (no such file)                                                                                             
[1]    38724 abort      gazebo                    

Reasonning:

  1. 使用 brew info 查看 tinyxml2 安装情况,已经安装了 tinyxml2 11.0.0 版本
vbnet 复制代码
(base) ➜  ros2 brew info tinyxml2                                                                                                          
==> tinyxml2: stable 11.0.0 (bottled), HEAD                                                                                                
Improved tinyxml (in memory efficiency and size)                                                                                           
https://leethomason.github.io/tinyxml2/                                                                                                    
Installed                                                                                                                                  
/opt/homebrew/Cellar/tinyxml2/11.0.0 (14 files, 228.2KB) *                                                                                 
  Poured from bottle using the formulae.brew.sh API on 2025-04-07 at 18:09:33                                                              
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/t/tinyxml2.rb                                                            
License: Zlib                                                                                                                              
==> Dependencies                                                                                                                           
Build: cmake ✔                                                                                                                             
==> Options                                                                                                                                
--HEAD                                                                                                                                     
        Install HEAD version                                                                                                               
==> Analytics                                                                                                                              
install: 3,923 (30 days), 8,688 (90 days), 30,906 (365 days)                                                                               
install-on-request: 751 (30 days), 1,142 (90 days), 2,836 (365 days)                                                                       
build-error: 0 (30 days)                           
  1. 点击 info 输出中的 formula 链接,发现homebrew 中的 tinyxml2 的版本已经从 10.1.0 升级到了 11.0.0。所以通过使用上文的方式,重新安装 10.1.0 版本的 tinyxml2

github.com/Homebrew/ho...

2. Library not loaded: /opt/homebrew/opt/ogre1.9-with-boost1.85/lib/libOgreRTShaderSystem.1.9.0.dylib

vbnet 复制代码
(ros2) ➜  ros2 gazebo                                                                                                                      
dyld[72765]: Library not loaded: /opt/homebrew/opt/ogre1.9-with-boost1.85/lib/libOgreRTShaderSystem.1.9.0.dylib                            
  Referenced from: <9A2AC4A3-CBEE-3FE7-BE9C-8C89089CAB6B> /opt/homebrew/Cellar/gazebo11/11.15.0_6/bin/gazebo-11.15.0                       
  Reason: tried: '/opt/homebrew/opt/ogre1.9-with-boost1.85/lib/libOgreRTShaderSystem.1.9.0.dylib' (no such file), '/System/Volumes/Preboot/
Cryptexes/OS/opt/homebrew/opt/ogre1.9-with-boost1.85/lib/libOgreRTShaderSystem.1.9.0.dylib' (no such file), '/opt/homebrew/opt/ogre1.9-with
-boost1.85/lib/libOgreRTShaderSystem.1.9.0.dylib' (no such file)                                                                           
[1]    72765 abort      gazebo                                      

Reasonning

  1. 确实未安装 ogre ,则使用 brew 进行安装
bash 复制代码
brew install osrf/simulation/ogre1.9-with-boost1.85 
  1. 安装失败,提示 Compatibility with CMake < 3.5 has been removed from CMake.
vbnet 复制代码
Last 15 lines from /Users/bytedance/Library/Logs/Homebrew/ogre1.9-with-boost1.85/01.cmake:                                                 
-DBUILD_TESTING=OFF                                                                                                                        
-DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk                                                                  
..                                                                                                                                  
CMake Error at CMakeLists.txt:17 (cmake_minimum_required):                                                                                 
  Compatibility with CMake < 3.5 has been removed from CMake.                                                                              
                                                                   
  Update the VERSION argument  value.  Or, use the ... syntax                                                               
  to tell CMake that the project requires at least  but has been updated                                                              
  to work with policies introduced by  or earlier.                                                                           
  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.                                                                    
                                                                     
-- Configuring incomplete, errors occurred!                       
  1. 使用 brew info 查看 cmake 版本,已经安装了 4.0.0
vbnet 复制代码
(base) ➜  Homebrew git:(334bf23768) brew info cmake                                                                                        
Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake or specify the `--cask` flag. To silence this message, use the 
`--formula` flag.                                                                                                                          
==> cmake: stable 4.0.0 (bottled), HEAD                                                                                                    
Cross-platform make                                                                                                                        
https://www.cmake.org/                                                                                                                     
Installed                                                                                                                                  
/opt/homebrew/Cellar/cmake/3.31.3 (3,767 files, 56.5MB)                                                                                    
  Poured from bottle using the formulae.brew.sh API on 2025-01-02 at 14:31:47                                                              
/opt/homebrew/Cellar/cmake/3.31.6 (3,788 files, 56.5MB)                                                                                    
  Poured from bottle using the formulae.brew.sh API on 2025-03-26 at 16:28:15                                                              
/opt/homebrew/Cellar/cmake/4.0.0 (3,869 files, 57.7MB) *                                                                                   
  Poured from bottle using the formulae.brew.sh API on 2025-04-07 at 17:15:16                                                              
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/c/cmake.rb                                                               
License: BSD-3-Clause                              
  1. 点击 info 输出中的 formula 链接, 进一步发 homebrew 中的 cmake 的版本已经从 3.31.6 升级到了 4.0.0。,所以通过使用上文的方式,重新安装 3.31.6 版本的 cmake

github.com/Homebrew/ho...

3 Library not loaded: /opt/homebrew/opt/tinyxml2/lib/libtinyxml2.11.dylib

再次出现 tinyxml2 版本不符合预期,但这次是需要 11 版本。也就就是 urdfdom 依赖 tinyxml2 11 版本, gazebo-11.15.0 依赖 tinyxml2 10 版本。依赖冲突了。

bash 复制代码
(base) ➜  ros2 gazebo                                                                                                                      
dyld[30279]: Library not loaded: /opt/homebrew/opt/tinyxml2/lib/libtinyxml2.11.dylib                                                       
  Referenced from: <3C457F97-B3CE-32E6-B7AA-67D7162DFE97> /opt/homebrew/Cellar/urdfdom/4.0.1_2/lib/liburdfdom_sensor.4.0.dylib 

Reasonning homebrew 管理的库版本升级,但 gazebo11 没有版本更新,导致版本依赖冲突了。

vbnet 复制代码
(base) ➜  ros2 brew install gazebo11
Warning: osrf/simulation/gazebo11 has been deprecated because it is past end-of-life date! It will be disabled on 2026-01-31. 

尝试将 homebrew 的 homebrew/core 仓库整体回退到一个旧版本

bash 复制代码
base) ➜  ros2 cd /opt/homebrew/Library/Taps/homebrew/homebrew-core 
(base) ➜  homebrew-core git:(master) gco 9c3a20b2f3e9d26442243d0abd2d6a4941d462fa

失败,尝试安装新版本 gazebo harmonic。结果 Library not loaded: /opt/homebrew/opt/gz-physics7/lib/libgz-physics7.7.dylib ,失败。

gazebosim.org/docs/latest...

bash 复制代码
(base) ➜  ros2 gz sim -s                                                                                                                   
Library error for [/opt/homebrew/Cellar/gz-sim8/8.9.0_4/lib/libgz-sim8-gz.8.9.0.dylib]: dlopen(/opt/homebrew/Cellar/gz-sim8/8.9.0_4/lib/lib
gz-sim8-gz.8.9.0.dylib, 0x0009): Library not loaded: /opt/homebrew/opt/gz-physics7/lib/libgz-physics7.7.dylib                              
  Referenced from: <2AF9BA6C-769A-3CEF-8210-F333A91294AD> /opt/homebrew/Cellar/gz-sim8/8.9.0_4/lib/libgz-sim8-gz.8.9.0.dylib               
  Reason: tried: '/opt/homebrew/opt/gz-physics7/lib/libgz-physics7.7.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homeb
rew/opt/gz-physics7/lib/libgz-physics7.7.dylib' (no such file), '/opt/homebrew/opt/gz-physics7/lib/libgz-physics7.7.dylib' (no such file)  
                                                                                                                                           
If this script was executed with /usr/bin/ruby, this error may be caused by                                                                
macOS System Integrity Protection. One workaround is to use a different                                                                    
version of ruby, for example:                                                                                                              
    brew install ruby                                                                                                                      
and add the following line to your shell profile:                                                                                          
    export PATH=/usr/local/opt/ruby/bin:$PATH                                                                                              
If you are using a colcon workspace, please ensure that the setup script                                                                   
has properly set the DYLD_LIBRARY_PATH environment variables. 

安装版本建议,再次重新安装 Fortness 版本,仍然是失败。

gazebosim.org/docs/latest...

bash 复制代码
(ros2) ➜  ros2 gz sim -s                                                                                                                   
Library error for [/opt/homebrew/Cellar/gz-sim8/8.9.0_4/lib/libgz-sim8-gz.8.9.0.dylib]: dlopen(/opt/homebrew/Cellar/gz-sim8/8.9.0_4/lib/lib
gz-sim8-gz.8.9.0.dylib, 0x0009): Library not loaded: /opt/homebrew/opt/gz-physics7/lib/libgz-physics7.7.dylib                              
  Referenced from: <2AF9BA6C-769A-3CEF-8210-F333A91294AD> /opt/homebrew/Cellar/gz-sim8/8.9.0_4/lib/libgz-sim8-gz.8.9.0.dylib               
  Reason: tried: '/opt/homebrew/opt/gz-physics7/lib/libgz-physics7.7.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homeb
rew/opt/gz-physics7/lib/libgz-physics7.7.dylib' (no such file), '/opt/homebrew/opt/gz-physics7/lib/libgz-physics7.7.dylib' (no such file)  
                                                                                                                                           
If this script was executed with /usr/bin/ruby, this error may be caused by                                                                
macOS System Integrity Protection. One workaround is to use a different                                                                    
version of ruby, for example:                                                                                                              
    brew install ruby                                                                                                                      
and add the following line to your shell profile:                                                                                          
    export PATH=/usr/local/opt/ruby/bin:$PATH                                                                                              
If you are using a colcon workspace, please ensure that the setup script                                                                   
has properly set the DYLD_LIBRARY_PATH environment variables.              
相关推荐
Blossom.11810 小时前
机器学习在智能建筑中的应用:能源管理与环境优化
人工智能·python·深度学习·神经网络·机器学习·机器人·sklearn
Mr.Winter`12 小时前
障碍感知 | 基于3D激光雷达的三维膨胀栅格地图构建(附ROS C++仿真)
人工智能·机器人·自动驾驶·ros·具身智能·环境感知
AiTEN_Robot14 小时前
AGV 无人叉车关键技术问题解析:精准定位算法 / 安全避障逻辑 / 系统对接协议全方案
人工智能·机器人·自动化·制造
一颗小树x16 小时前
【机器人】复现 HOV-SG 机器人导航 | 分层 开放词汇 | 3D 场景图
机器人·机器人导航·复现·hov-sg·分层 3d 场景图
贾全16 小时前
第十章:HIL-SERL 真实机器人训练实战
人工智能·深度学习·算法·机器学习·机器人
智能汽车人18 小时前
Robot---能打羽毛球的机器人
人工智能·机器人·强化学习
Blossom.1181 天前
机器学习在智能供应链中的应用:需求预测与物流优化
人工智能·深度学习·神经网络·机器学习·计算机视觉·机器人·语音识别
合力亿捷-小亿1 天前
客服机器人知识库怎么搭?智能客服机器人3种方案深度对比(含零售落地案例)
机器人·零售
青牛科技-Allen1 天前
GC3910S:一款高性能双通道直流电机驱动芯片
stm32·单片机·嵌入式硬件·机器人·医疗器械·水泵、
物联网软硬件开发-轨物科技1 天前
【轨物洞见】光伏机器人与组件、支架智能化协同白皮书
机器人