參考鏈接:http://gazebosim.org/tutorials?tut=install_on_windows&cat=install
Important requirement: 30Gb free disk space
It is recommended to have at least 30 Gigabytes of disk space to host Gazebo sources together with all the dependencies and compilation artifacts.
Supported compilers
At this moment, compilation has been tested on Windows 8.1 and 10, supported when using Visual Studio 2017. Patches for other versions are welcome.
Installation
This installation procedure uses pre-compiled binaries in a local workspace. To make things easier, use a MinGW shell for your editing work (such as the Git Bash Shell), and only use the Windows cmd
for configuring and building. You might also need to disable the Windows firewall.
- 創建一個目錄, e.g.:
mkdir gz-ws cd gz-ws
- 在目錄下,下載相關聯的文件
- libcurl HEAD
- libyaml
- dlfcn-win32
- jsoncpp
- protobuf 3.4.1
- zlib
- zziplib 0.13.62
- freeImage 3.x
- boost 1.67.0
- OGRE 1.10.12 rc1
- bzip2 1.0.6
- TBB 4.3
- Qt 5.7.0
- QWT 6.1.22
- ZeroMQ 4.2.3
解壓每一個文件到gz-ws;
安裝cmake,安裝的時候選擇"Add CMake to system path for all users";
http://www.cmake.org/download/
- 安裝 Ruby 1.9 或更高版本,並確定把ruby添加到了環境變量里;
https://rubyinstaller.org/downloads/
clone Ignition CMake, Common, Fuel Tools, Math, Transport, Sdformat, and Gazebo:
git clone https://github.com/ignitionrobotics/ign-cmake -b ign-cmake0
git clone https://github.com/ignitionrobotics/ign-common -b ign-common1
git clone https://github.com/ignitionrobotics/ign-fuel-tools -b ign-fuel-tools1
git clone https://github.com/ignitionrobotics/ign-math -b ign-math4
git clone https://github.com/ignitionrobotics/ign-msgs -b ign-msgs1
git clone https://github.com/ignitionrobotics/ign-transport -b ign-transport4
git clone https://github.com/osrf/sdformat -b sdf6
git clone https://github.com/osrf/gazebo -b gazebo9
打開cmd(Start->Run->"cmd"->enter),輸入以下命令:
"C:\Program Files\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
or "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
(假如Visual Studio 2017安裝到了C:\Program Files下)
安裝ign-cmake,運行.\configure.bat,安裝目錄為gz-ws/ign-cmake/build/install/Release;
安裝ign-math,運行.\configure.bat,安裝目錄為gz-ws/ign-math/build/install/Release;
安裝ign-
common
,運行.\configure.bat,安裝目錄為gz-ws/ign-
common
/build/install/Release;安裝
ign-fuel-tools
,運行.\configure.bat,安裝目錄為gz-ws/
ign-fuel-tools
/build/install/Release;安裝
ign-msgs
,運行.\configure.bat,安裝目錄為gz-ws/
ign-msgs
/build/install/Release;安裝
ign-
transport
,運行.\configure.bat,安裝目錄為gz-ws/
ign-
/build/install/Release;transport
安裝
sdformat
,運行.\configure.bat,安裝目錄為gz-ws/
sdformat
/build/install/Release;安裝gazebo,運行.\configure.bat,安裝目錄為gz-ws/gazebo/build/install/Release;
gzclient: nmake gzclient
gzserver: nmake gzserver
nmake install
備注: 以上安裝如果編譯錯誤的話,則需要修改相應的configure.bat,把相應的依賴庫增加到CMAKE_PREFIX_PATH中;
運行
- gzserver
修改win_addpath.bat,只需修改gazebo相關的變量值
cd gz-ws\gazebo\build ..\win_addpath.bat Release
gzserver.exe
- gzclient
cd gz-ws\gazebo\build ..\win_addpath.bat Release
gzclient.exe
如果需要運行過程中得到更多的信息,請使用 --verbose。