gazebosim/gz-sim
GitHub: gazebosim/gz-sim
Gazebo Sim 是一款面向机器人领域的高保真开源仿真器,提供物理引擎、传感器建模、3D 渲染和插件扩展能力,帮助开发者在虚拟环境中设计、测试和验证机器人系统。
Stars: 1335 | Forks: 411
# Gazebo Sim : 机器人模拟器
**维护者:** arjoc AT intrinsic DOT ai
[](https://github.com/gazebosim/gz-sim/issues)
[](https://github.com/gazebosim/gz-sim/pulls)
[](https://discourse.openrobotics.org/c/gazebo)
[](https://www.apache.org/licenses/LICENSE-2.0)
构建 | 状态
-- | --
测试覆盖率 | [](https://codecov.io/gh/gazebosim/gz-sim/tree/main)
Ubuntu Noble | [](https://build.osrfoundation.org/job/gz_sim-ci-main-noble-amd64)
Homebrew | [](https://build.osrfoundation.org/job/gz_sim-ci-main-homebrew-amd64)
Windows | [](https://build.osrfoundation.org/job/gz_sim-main-cnlwin/)
Gazebo Sim 是一个开源的机器人模拟器。通过 Gazebo Sim,用户可以使用高保真的物理、渲染和传感器模型。此外,用户和开发者可以通过多种入口点进行仿真,包括图形用户界面、插件以及异步消息传递和服务。
Gazebo Sim 源自 [Gazebo Classic](http://classic.gazebosim.org),代表了超过 16 年的机器人技术和仿真开发与经验。该库是 [Gazebo](https://gazebosim.org) 项目的一部分。
# 目录
[功能](#features)
[安装](#install)
[用法](#usage)
[文档](#documentation)
[测试](#testing)
[目录结构](#folder-structure)
[贡献](#contributing)
[行为准则](#code-of-conduct)
[版本控制](#versioning)
[许可证](#license)
# 功能
* **动力学仿真**:通过
[Gazebo Physics](https://github.com/gazebosim/gz-physics) 访问多个高性能物理引擎。
* **高级 3D 图形**:通过
[Gazebo Rendering](https://github.com/gazebosim/gz-rendering),可以使用诸如 OGRE v2 等渲染引擎,对具有高质量光照、阴影和纹理的环境进行真实感渲染。
* **传感器和噪声模型**:通过 [Gazebo Sensors](https://github.com/gazebosim/gz-sensors) 驱动,生成传感器数据(可选带有噪声),支持激光测距仪、2D/3D 相机、Kinect 风格传感器、接触传感器、力矩传感器、IMU、GPS 等。
* **插件**:为机器人、传感器和环境控制开发自定义插件。
* **图形界面**:通过由 [Gazebo GUI](https://github.com/gazebosim/gz-gui) 驱动的基于插件的图形界面来创建、内省仿真并与仿真进行交互。
* **仿真模型**:访问包括 PR2、Pioneer2 DX、iRobot Create 和 TurtleBot 在内的众多机器人,并使用通过 [Gazebo Fuel](https://app.gazebosim.org/fuel) 获取的其他物理精确模型来构建环境。您也可以使用 [SDF](http://sdformat.org) 构建新模型。
* **TCP/IP 传输**:在远程服务器上运行仿真,并使用 [Gazebo Transport](https://github.com/gazebosim/gz-transport) 通过基于 socket 的消息传递与 Gazebo Sim 进行交互。
* **命令行工具**:提供丰富的命令行工具,以增强仿真的内省和控制能力。
# 安装说明
有关安装 Gazebo 的信息,请参阅 [入门指南](https://gazebosim.org/docs/latest/getstarted/)。如果您想将 `libgz-sim` 作为库使用,请参阅 [安装教程](https://gazebosim.org/api/sim/9/install.html)
# 用法
一旦完成[安装](#install),即可通过命令行运行 Gazebo Sim,使用:
```
gz sim
```
如需获取帮助和命令行选项,请使用:
```
gz sim -h
```
## 命令行工具的已知问题
如果安装方式是 Debian 包与源码编译混合的,`gz-tools` 的命令行工具可能无法正常工作。
一种解决方法是定义环境变量 `GZ_CONFIG_PATH`,使其指向 Gazebo 库安装的不同位置,也就是找到这些包的 YAML 文件的地方,例如
```
export GZ_CONFIG_PATH=/usr/local/share/gz:$HOME/ws/install/share/gz
```
其中 `$HOME/ws` 是用于构建 Gazebo 的 colcon workspace 示例。
在 Windows 上,`gz sim`(即在一条命令中同时运行 server 和 GUI)尚不可用。
要在 Windows 上运行 Gazebo Sim,您需要在一个终端中运行 server (`gz sim -s `),并在另一个终端中运行 GUI (`gz sim -g `)。在阅读所有 Gazebo Sim 教程时请记住这一点。另外请注意,在两个终端中都需要加载 Conda 和 `install\setup.bat` 的环境(以及对 `GZ_PARTITION` 和其他环境变量的任何更改)。
# 文档
请参阅 [安装教程](https://gazebosim.org/api/sim/9/install.html)。
# 测试
请参阅 [安装教程](https://gazebosim.org/api/sim/9/install.html)。
请参阅 [贡献者指南的编写测试部分](https://gazebosim.org/docs/all/contributing/#writing-tests) 以获取有关创建或修改测试的帮助。
# 目录结构
有关此仓库中重要目录和文件的信息,请参阅下表。
```
gz-sim
├── examples Various examples that can be run against binary or source installs of gz-sim.
│ ├── plugin Example plugins.
│ ├── standalone Example standalone programs that use gz-sim as a library.
│ └── worlds Example SDF world files.
├── include/gz/sim Header files that downstream users are expected to use.
│ └── detail Header files that are not intended for downstream use, mainly template implementations.
├── python Python wrappers
├── src Source files and unit tests.
│ ├── gui Graphical interface source code.
│ └── systems System source code.
├── test
│ ├── integration Integration tests.
│ ├── performance Performance tests.
│ ├── plugins Plugins used in tests.
│ ├── regression Regression tests.
├── tutorials Tutorials, written in markdown.
├── Changelog.md Changelog.
├── CMakeLists.txt CMake build script.
├── Migration.md Migration guide.
└── README.md This readme.
```
# 贡献
请参阅 [贡献指南](https://gazebosim.org/docs/all/contributing/)。
# 行为准则
请参阅 [CODE_OF_CONDUCT.md](https://github.com/gazebosim/gz-sim/blob/main/CODE_OF_CONDUCT.md)。
# 版本控制
本库使用 [语义化版本控制](https://semver.org/)。此外,本库是 [Gazebo 项目](https://gazebosim.org) 的一部分,该项目会定期发布一组版本化的、兼容且互补的库。有关版本和发布信息,请访问 [Gazebo 网站](https://gazebosim.org)。
# 许可证
本库基于 [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) 授权。另请参阅 [LICENSE](https://github.com/gazebosim/gz-sim/blob/main/LICENSE) 文件。
标签:3D仿真, 3D渲染, Bash脚本, C++, Gazebo, GUI, Open Robotics, pocsuite3, ROS, 传感器仿真, 传感器模型, 实时渲染, 并发处理, 开源, 异步消息传递, 数据擦除, 无人系统, 机器人仿真, 机器人学, 机器人开发框架, 机器人模拟器, 物理模拟, 自动驾驶仿真, 虚拟环境, 调试插件, 软件测试, 逆向工具, 高保真物理引擎