YAML:
simulationclassSimulationConfig仿真配置
声明仿真后端及运行参数。stereotype 决定使用哪个引擎,UniSimFactory 据此实例化对应的 UniSim 子类。
顶层字段3
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | 仿真后端标识(如 isaaclab),必须已在 UniSim 注册表中注册 ⚠运行 fastsim show-registry 查看可用值;自定义后端须启用 scan_project |
dt | float | 必填 | — | 物理时间步长(秒),典型值 0.0166667(60 Hz) ⚠必须大于 0 |
intiailize_steps | int | 可选 | 0 | reset 后执行的初始化步数,让物理世界进入稳定状态后再运行任务 ⚠须 >= 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 | list[3] | 可选 | [0.0, 0.0, -9.81] | 重力向量 [x, y, z](m/s²) |
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 窗口,适用于服务器/训练环境 |
width | int | 可选 | 1280 | 渲染窗口宽度(像素),headless 为 true 时无效 |
height | int | 可选 | 720 | 渲染窗口高度(像素) |
anti_aliasing | int | 可选 | 0 | 抗锯齿级别 ⚠0=关闭 / 1=FXAA / 2=TAA |
enable_cameras | bool | 可选 | true | 是否启用相机渲染管线,需要采集图像时须为 true |
class
PhysicsConfigfastsim/simulators/isaaclab/isaaclab_config.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
solver_type | int | 可选 | 1 | 物理求解器类型 ⚠0=PGS(投影高斯-塞德尔)/ 1=TGS(时间步高斯-塞德尔,更精确) |
num_position_iterations | int | 可选 | 4 | 每步位置约束迭代次数,越大越精确但越慢 |
num_velocity_iterations | int | 可选 | 1 | 每步速度约束迭代次数 |
enable_ccd | bool | 可选 | false | 连续碰撞检测(CCD),防止高速物体穿透,开启后性能下降 |
enable_stabilization | bool | 可选 | true | 物理稳定化,减少微小抖动 |
gpu_max_soft_body_contacts | int | 可选 | 1048576 | GPU 柔性体最大接触数(2²⁰),柔性体仿真时需根据场景调整 |
gpu_max_particle_contacts | int | 可选 | 1048576 | GPU 粒子最大接触数(2²⁰),柔性体仿真时需根据场景调整 |
class
RenderConfigfastsim/simulators/isaaclab/isaaclab_config.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
enable_rtx_rendering | bool | 可选 | false | 启用 RTX 光线追踪渲染,画质更高但 GPU 占用大幅提升 |
配置示例
simulation 配置块YAML
simulation:
stereotype: isaaclab
dt: 0.0166667
intiailize_steps: 30
device: cuda:0
render_interval: 1
gravity: [0.0, 0.0, -9.81]
create_stage_in_memory: true
launch_config:
headless: false
width: 1280
height: 720
enable_cameras: true
physics_config:
solver_type: 1
num_position_iterations: 4
enable_ccd: false
render_config:
enable_rtx_rendering: false常见错误
| 错误提示 | 原因 | 处理方式 |
|---|---|---|
Simulation config is required | 配置文件缺少 simulation 块或未提供 stereotype 字段 | 添加完整的 simulation 配置块,并指定 stereotype |
Invalid simulator stereotype | stereotype 值未在 UniSim 注册表中找到 | 运行 fastsim show-registry 确认可用后端;自定义后端请检查 scan_project 是否启用 |