YAML: simulationclassSimulationConfig

仿真配置

声明仿真后端及运行参数。stereotype 决定使用哪个引擎,UniSimFactory 据此实例化对应的 UniSim 子类。

源码fastsim/configs/simulation_cfg.py

顶层字段5

字段类型必填默认值说明 / 约束
stereotypestring必填仿真后端标识(isaaclab / mujoco / pybullet),必须已在 UniSim 注册表中注册
运行 fastsim show-registry 查看可用值;自定义后端须启用 scan_project
dtfloat必填物理时间步长(秒),典型值 0.0166667(60 Hz)
必须大于 0
initialize_stepsint可选60reset 后执行的初始化步数,让物理世界进入稳定状态后再运行任务
须 >= 0
num_envsint可选1并行环境数量(GPU 并行仿真),1 为单环境模式
须 >= 1
env_spacingfloat可选2.5并行环境之间的间距(米),num_envs > 1 时生效
须 > 0

IsaacLab 后端(stereotype: isaaclab)

当 stereotype 为 isaaclab 时,配置类为 IsaacLabConfig,在通用字段基础上提供以下扩展参数,并通过 launch_config、physics_config、render_config 三个嵌套对象进一步细化运行时行为。

classIsaacLabConfigstereotypeisaaclabfastsim/simulators/isaaclab/isaaclab_config.py
字段类型必填默认值说明 / 约束
devicestring必填cuda:0计算设备
cpu 或 cuda:<index>(如 cuda:0、cuda:1)
render_intervalint必填1每隔多少个物理步渲染一帧
须 >= 1
gravitytuple[3]必填(0.0, 0.0, -9.81)重力向量 (x, y, z)(m/s²)
physics_prim_pathstring必填/physicsScene物理场景 prim 路径
须以 / 开头
enable_scene_query_supportbool必填false启用场景查询支持(射线检测等)
use_fabricbool必填true使用 Fabric 数据接口加速数据访问
create_stage_in_memorybool必填true是否在内存中创建 USD Stage,可加快启动速度
launch_configLaunchConfig必填Isaac Sim AppLauncher 启动参数,见 LaunchConfig
physics_configPhysicsConfig必填PhysX 物理引擎详细参数,见 PhysicsConfig
render_configRenderConfig必填渲染相关参数,见 RenderConfig
classLaunchConfigfastsim/simulators/isaaclab/isaaclab_config.py
字段类型必填默认值说明 / 约束
headlessbool必填false无头模式,不启动 GUI 窗口,适用于服务器/训练环境
livestreamint必填0远程实时串流模式
0=禁用 / 1=公网 / 2=局域网
enable_camerasbool必填true是否启用相机渲染管线,需要采集图像时须为 true
devicestring必填cuda计算设备
cpu 或 cuda / cuda:<index>
classPhysicsConfigfastsim/simulators/isaaclab/isaaclab_config.py
字段类型必填默认值说明 / 约束
solver_typeint必填1物理求解器类型
0=PGS(投影高斯-塞德尔)/ 1=TGS(时间步高斯-塞德尔,更精确)
min_position_iteration_countint必填1每步位置约束最小迭代次数
max_position_iteration_countint必填255每步位置约束最大迭代次数
min_velocity_iteration_countint必填0每步速度约束最小迭代次数
max_velocity_iteration_countint必填255每步速度约束最大迭代次数
enable_ccdbool必填false连续碰撞检测(CCD),防止高速物体穿透,开启后性能下降
enable_stabilizationbool必填false物理稳定化,减少微小抖动
enable_enhanced_determinismbool必填false增强确定性模式,牺牲性能换取更好的可重复性
bounce_threshold_velocityfloat必填0.5反弹速度阈值
friction_offset_thresholdfloat必填0.04摩擦偏移阈值
friction_correlation_distancefloat必填0.025摩擦相关距离
gpu_max_rigid_contact_countint必填8388608GPU 刚体最大接触数(2²³)
gpu_max_rigid_patch_countint必填163840GPU 刚体最大 patch 数(5×2¹⁵)
gpu_found_lost_pairs_capacityint必填2097152GPU 碰撞对发现/丢失容量(2²¹)
gpu_found_lost_aggregate_pairs_capacityint必填33554432GPU 聚合碰撞对容量(2²⁵)
gpu_total_aggregate_pairs_capacityint必填2097152GPU 聚合碰撞对总容量(2²¹)
gpu_collision_stack_sizeint必填67108864GPU 碰撞栈大小(2²⁶)
gpu_heap_capacityint必填67108864GPU 堆容量(2²⁶)
gpu_temp_buffer_capacityint必填16777216GPU 临时缓冲容量(2²⁴)
gpu_max_num_partitionsint必填8GPU 最大分区数
gpu_max_soft_body_contactsint必填1048576GPU 柔性体最大接触数(2²⁰)
gpu_max_particle_contactsint必填1048576GPU 粒子最大接触数(2²⁰)
solve_articulation_contact_lastbool必填false是否最后处理关节体接触
classRenderConfigfastsim/simulators/isaaclab/isaaclab_config.py
字段类型必填默认值说明 / 约束
enable_translucencybool必填false启用半透明渲染
enable_reflectionsbool必填false启用反射
enable_global_illuminationbool必填true启用全局光照
antialiasing_modestring必填DLSS抗锯齿模式
Off / FXAA / DLSS / TAA / DLAA
enable_dlssgbool必填false启用 DLSS 帧生成
enable_dl_denoiserbool必填true启用深度学习降噪器
dlss_modeint必填0DLSS 质量模式
0 / 1 / 2 / 3
enable_direct_lightingbool必填true启用直接光照
samples_per_pixelint必填1每像素采样数
enable_shadowsbool必填true启用阴影
enable_ambient_occlusionbool必填true启用环境光遮蔽
dome_light_upper_lower_strategyint必填0穹顶光上下策略
0 / 3 / 4
carb_settingsdict[str, Any]可选{}自定义 Carbonite 渲染设置
rendering_modestring可选performance渲染质量模式
performance / balanced / quality

MuJoCo 后端(stereotype: mujoco)

当 stereotype 为 mujoco 时,配置类为 MuJoCoConfig,使用 MuJoCo 物理引擎进行仿真,仅需 CPU 即可运行。

classMuJoCoConfigstereotypemujocofastsim/simulators/mujoco/mujoco_config.py
字段类型必填默认值说明 / 约束
headlessbool必填false无头模式,不启动 GUI 窗口
render_widthint必填640渲染宽度(像素)
render_heightint必填480渲染高度(像素)
gravitylist[3]必填[0, 0, -9.81]重力向量 [x, y, z](m/s²)

PyBullet 后端(stereotype: pybullet)

当 stereotype 为 pybullet 时,配置类为 PyBulletConfig,使用 PyBullet 物理引擎进行仿真,纯 CPU 运行,适合轻量级测试和 OMPL 规划。

classPyBulletConfigstereotypepybulletfastsim/simulators/pybullet/pybullet_config.py
字段类型必填默认值说明 / 约束
headlessbool必填true无头模式,不启动 GUI 窗口(PyBullet 默认无头)
gravitylist[3]必填[0, 0, -9.81]重力向量 [x, y, z](m/s²)
render_widthint必填640渲染宽度(像素)
render_heightint必填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 stereotypestereotype 值未在 UniSim 注册表中找到运行 fastsim show-registry 确认可用后端;自定义后端请检查 scan_project 是否启用