YAML:
simulationclassSimulationConfig仿真配置
声明仿真后端及运行参数。stereotype 决定使用哪个引擎,UniSimFactory 据此实例化对应的 UniSim 子类。
顶层字段5
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | 仿真后端标识(isaaclab / mujoco / pybullet),必须已在 UniSim 注册表中注册 ⚠运行 fastsim show-registry 查看可用值;自定义后端须启用 scan_project |
dt | float | 必填 | — | 物理时间步长(秒),典型值 0.0166667(60 Hz) ⚠必须大于 0 |
initialize_steps | int | 可选 | 60 | reset 后执行的初始化步数,让物理世界进入稳定状态后再运行任务 ⚠须 >= 0 |
num_envs | int | 可选 | 1 | 并行环境数量(GPU 并行仿真),1 为单环境模式 ⚠须 >= 1 |
env_spacing | float | 可选 | 2.5 | 并行环境之间的间距(米),num_envs > 1 时生效 ⚠须 > 0 |
IsaacLab 后端(stereotype: isaaclab)
当 stereotype 为 isaaclab 时,配置类为 IsaacLabConfig,在通用字段基础上提供以下扩展参数,并通过 launch_config、physics_config、render_config 三个嵌套对象进一步细化运行时行为。
class
IsaacLabConfigstereotypeisaaclabfastsim/simulators/isaaclab/isaaclab_config.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
device | string | 必填 | cuda:0 | 计算设备 ⚠cpu 或 cuda:<index>(如 cuda:0、cuda:1) |
render_interval | int | 必填 | 1 | 每隔多少个物理步渲染一帧 ⚠须 >= 1 |
gravity | tuple[3] | 必填 | (0.0, 0.0, -9.81) | 重力向量 (x, y, z)(m/s²) |
physics_prim_path | string | 必填 | /physicsScene | 物理场景 prim 路径 ⚠须以 / 开头 |
enable_scene_query_support | bool | 必填 | false | 启用场景查询支持(射线检测等) |
use_fabric | bool | 必填 | true | 使用 Fabric 数据接口加速数据访问 |
create_stage_in_memory | bool | 必填 | true | 是否在内存中创建 USD Stage,可加快启动速度 |
launch_config | LaunchConfig | 必填 | — | Isaac Sim AppLauncher 启动参数,见 LaunchConfig |
physics_config | PhysicsConfig | 必填 | — | PhysX 物理引擎详细参数,见 PhysicsConfig |
render_config | RenderConfig | 必填 | — | 渲染相关参数,见 RenderConfig |
class
LaunchConfigfastsim/simulators/isaaclab/isaaclab_config.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
headless | bool | 必填 | false | 无头模式,不启动 GUI 窗口,适用于服务器/训练环境 |
livestream | int | 必填 | 0 | 远程实时串流模式 ⚠0=禁用 / 1=公网 / 2=局域网 |
enable_cameras | bool | 必填 | true | 是否启用相机渲染管线,需要采集图像时须为 true |
device | string | 必填 | cuda | 计算设备 ⚠cpu 或 cuda / cuda:<index> |
class
PhysicsConfigfastsim/simulators/isaaclab/isaaclab_config.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
solver_type | int | 必填 | 1 | 物理求解器类型 ⚠0=PGS(投影高斯-塞德尔)/ 1=TGS(时间步高斯-塞德尔,更精确) |
min_position_iteration_count | int | 必填 | 1 | 每步位置约束最小迭代次数 |
max_position_iteration_count | int | 必填 | 255 | 每步位置约束最大迭代次数 |
min_velocity_iteration_count | int | 必填 | 0 | 每步速度约束最小迭代次数 |
max_velocity_iteration_count | int | 必填 | 255 | 每步速度约束最大迭代次数 |
enable_ccd | bool | 必填 | false | 连续碰撞检测(CCD),防止高速物体穿透,开启后性能下降 |
enable_stabilization | bool | 必填 | false | 物理稳定化,减少微小抖动 |
enable_enhanced_determinism | bool | 必填 | false | 增强确定性模式,牺牲性能换取更好的可重复性 |
bounce_threshold_velocity | float | 必填 | 0.5 | 反弹速度阈值 |
friction_offset_threshold | float | 必填 | 0.04 | 摩擦偏移阈值 |
friction_correlation_distance | float | 必填 | 0.025 | 摩擦相关距离 |
gpu_max_rigid_contact_count | int | 必填 | 8388608 | GPU 刚体最大接触数(2²³) |
gpu_max_rigid_patch_count | int | 必填 | 163840 | GPU 刚体最大 patch 数(5×2¹⁵) |
gpu_found_lost_pairs_capacity | int | 必填 | 2097152 | GPU 碰撞对发现/丢失容量(2²¹) |
gpu_found_lost_aggregate_pairs_capacity | int | 必填 | 33554432 | GPU 聚合碰撞对容量(2²⁵) |
gpu_total_aggregate_pairs_capacity | int | 必填 | 2097152 | GPU 聚合碰撞对总容量(2²¹) |
gpu_collision_stack_size | int | 必填 | 67108864 | GPU 碰撞栈大小(2²⁶) |
gpu_heap_capacity | int | 必填 | 67108864 | GPU 堆容量(2²⁶) |
gpu_temp_buffer_capacity | int | 必填 | 16777216 | GPU 临时缓冲容量(2²⁴) |
gpu_max_num_partitions | int | 必填 | 8 | GPU 最大分区数 |
gpu_max_soft_body_contacts | int | 必填 | 1048576 | GPU 柔性体最大接触数(2²⁰) |
gpu_max_particle_contacts | int | 必填 | 1048576 | GPU 粒子最大接触数(2²⁰) |
solve_articulation_contact_last | bool | 必填 | false | 是否最后处理关节体接触 |
class
RenderConfigfastsim/simulators/isaaclab/isaaclab_config.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
enable_translucency | bool | 必填 | false | 启用半透明渲染 |
enable_reflections | bool | 必填 | false | 启用反射 |
enable_global_illumination | bool | 必填 | true | 启用全局光照 |
antialiasing_mode | string | 必填 | DLSS | 抗锯齿模式 ⚠Off / FXAA / DLSS / TAA / DLAA |
enable_dlssg | bool | 必填 | false | 启用 DLSS 帧生成 |
enable_dl_denoiser | bool | 必填 | true | 启用深度学习降噪器 |
dlss_mode | int | 必填 | 0 | DLSS 质量模式 ⚠0 / 1 / 2 / 3 |
enable_direct_lighting | bool | 必填 | true | 启用直接光照 |
samples_per_pixel | int | 必填 | 1 | 每像素采样数 |
enable_shadows | bool | 必填 | true | 启用阴影 |
enable_ambient_occlusion | bool | 必填 | true | 启用环境光遮蔽 |
dome_light_upper_lower_strategy | int | 必填 | 0 | 穹顶光上下策略 ⚠0 / 3 / 4 |
carb_settings | dict[str, Any] | 可选 | {} | 自定义 Carbonite 渲染设置 |
rendering_mode | string | 可选 | performance | 渲染质量模式 ⚠performance / balanced / quality |
MuJoCo 后端(stereotype: mujoco)
当 stereotype 为 mujoco 时,配置类为 MuJoCoConfig,使用 MuJoCo 物理引擎进行仿真,仅需 CPU 即可运行。
class
MuJoCoConfigstereotypemujocofastsim/simulators/mujoco/mujoco_config.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
headless | bool | 必填 | false | 无头模式,不启动 GUI 窗口 |
render_width | int | 必填 | 640 | 渲染宽度(像素) |
render_height | int | 必填 | 480 | 渲染高度(像素) |
gravity | list[3] | 必填 | [0, 0, -9.81] | 重力向量 [x, y, z](m/s²) |
PyBullet 后端(stereotype: pybullet)
当 stereotype 为 pybullet 时,配置类为 PyBulletConfig,使用 PyBullet 物理引擎进行仿真,纯 CPU 运行,适合轻量级测试和 OMPL 规划。
class
PyBulletConfigstereotypepybulletfastsim/simulators/pybullet/pybullet_config.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
headless | bool | 必填 | true | 无头模式,不启动 GUI 窗口(PyBullet 默认无头) |
gravity | list[3] | 必填 | [0, 0, -9.81] | 重力向量 [x, y, z](m/s²) |
render_width | int | 必填 | 640 | 渲染宽度(像素) |
render_height | int | 必填 | 480 | 渲染高度(像素) |
配置示例
simulation 配置块YAML
simulation:
stereotype: isaaclab
dt: 0.0166667
initialize_steps: 60
device: cuda:0
render_interval: 1
gravity: [0.0, 0.0, -9.81]
create_stage_in_memory: true
launch_config:
headless: false
livestream: 0
enable_cameras: true
device: cuda
physics_config:
solver_type: 1
min_position_iteration_count: 1
max_position_iteration_count: 255
enable_ccd: false
enable_stabilization: false
render_config:
antialiasing_mode: DLSS
enable_shadows: true
rendering_mode: performance常见错误
| 错误提示 | 原因 | 处理方式 |
|---|---|---|
Simulation config is required | 配置文件缺少 simulation 块或未提供 stereotype 字段 | 添加完整的 simulation 配置块,并指定 stereotype |
Invalid simulator stereotype | stereotype 值未在 UniSim 注册表中找到 | 运行 fastsim show-registry 确认可用后端;自定义后端请检查 scan_project 是否启用 |