YAML:
sceneclassSceneConfig场景配置
以声明式方式描述仿真世界的组成:地基、机器人、物体、传感器和光源。SceneManager 在运行时负责实例化并将实体注入仿真器。
顶层字段8
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
name | string | 可选 | — | 场景名称 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 场景基准位置 [x, y, z](米) |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 场景基准旋转,四元数 [w, x, y, z] ⚠须为单位四元数(归一化),即 w²+x²+y²+z²=1 |
base_config | BaseConfig | 可选 | — | 地基 / 环境配置,通过 stereotype 指定类型 |
robot_cfg_dict | dict[str, RobotConfig] | 可选 | {} | 机器人配置字典,key 为实例名(运行时通过 SceneManager.get_robot(name) 访问) |
object_cfg_dict | dict[str, ObjectConfig] | 可选 | {} | 场景物体配置字典,key 为实例名 |
sensor_cfg_dict | dict[str, SensorConfig] | 可选 | {} | 传感器配置字典,key 为实例名 |
light_cfg_dict | dict[str, LightConfig] | 可选 | {} | 光源配置字典,key 为实例名 |
BaseConfig:地基与环境 (base_config)
每个场景只有一个 Base,定义物理地面或加载完整环境 USD。通过 stereotype 决定具体子类。
class
GroundPlaneBaseConfigstereotypeground_planeextendsBaseConfig, SpawnableConfigfastsim/unisim/bases/models/ground_plane_base.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
ground_plane_size | list[2] | 可选 | [10.0, 10.0] | 地面视觉尺寸 [x, y](米),物理上无限延伸 ⚠每个值须 > 0 |
继承自SpawnableConfig5
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "ground_plane" |
name | string | 必填 | — | 实体名称 ⚠1-100 字符,不可含 / 或 \ |
prim_path | string | 可选 | — | USD prim 路径 ⚠须以 / 开头 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 [x, y, z](米) |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转(四元数 [w, x, y, z]) |
class
UsdBaseConfigstereotypeusdextendsBaseConfig, SpawnableConfigfastsim/unisim/bases/models/usd_base.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
asset_path | string | 必填 | — | 环境 USD 文件路径(支持 root_key:// 协议) |
source | string | 必填 | local | 资产来源 ⚠local / remote |
继承自SpawnableConfig5
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "usd" |
name | string | 必填 | — | 实体名称 |
prim_path | string | 可选 | — | USD prim 路径 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 [x, y, z] |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转(四元数) |
class
EmptyBaseConfigstereotypeemptyextendsBaseConfig, SpawnableConfigfastsim/unisim/bases/models/empty_base.py继承自SpawnableConfig4
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "empty",适合完全自定义物理场景 |
name | string | 必填 | — | 实体名称 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转 |
ObjectConfig:场景物体 (object_cfg_dict)
class
RigidObjectConfigstereotyperigidextendsObjectConfig, SpawnableConfigfastsim/unisim/objects/models/rigid_object.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
mass | float | 必填 | 1.0 | 物体质量(kg) |
density | float | 必填 | 1000 | 物体密度(kg/m³) |
disable_gravity | bool | 必填 | false | 是否禁用重力 |
kinematic_enabled | bool | 可选 | false | 是否启用运动学模式(不受力学影响) |
disable_rigid_body | bool | 可选 | false | 是否禁用刚体属性 |
enable_collision | bool | 必填 | true | 是否启用碰撞 |
primitive_type | enum | 可选 | — | 几何体类型(不使用 USD 时) ⚠box / sphere / cylinder / cone / disk |
primitive_radius | float | 可选 | — | 几何体半径(sphere / cylinder / cone / disk) |
primitive_size | list[3] | 可选 | — | 几何体尺寸 [x, y, z](box) |
primitive_height | float | 可选 | — | 几何体高度(cylinder / cone) |
继承自ObjectConfig4
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
source | string | 必填 | primitive | 资产来源 ⚠local / remote / primitive |
asset_path | string | 可选 | — | USD 资产路径(source 为 local/remote 时必填) |
scale | list[3] | 可选 | [1, 1, 1] | 缩放比例 [x, y, z] |
axis_y_up | bool | 可选 | false | 资产是否为 Y 轴朝上 |
继承自SpawnableConfig5
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "rigid" |
name | string | 必填 | — | 实体名称 |
prim_path | string | 可选 | — | USD prim 路径 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 [x, y, z] |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转(四元数) |
class
ArticulatedObjectConfigstereotypearticulatedextendsObjectConfig, ArticulationConfig, SpawnableConfigfastsim/unisim/objects/models/articulated_object.py继承自ArticulationConfig3
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
actuator_cfg_dict | dict[str, ActuatorConfig] | 必填 | {} | 执行器配置字典(关节驱动组) |
init_joint_position | dict[str, float] | 可选 | {} | 初始关节位置 |
init_joint_velocity | dict[str, float] | 可选 | {} | 初始关节速度 |
继承自ObjectConfig3
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
source | string | 必填 | local | 资产来源 ⚠local / remote |
asset_path | string | 必填 | — | USD 资产路径 |
scale | list[3] | 可选 | [1, 1, 1] | 缩放比例 |
继承自SpawnableConfig4
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "articulated" |
name | string | 必填 | — | 实体名称 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转 |
class
SoftObjectConfigstereotypesoftextendsObjectConfig, SpawnableConfigfastsim/unisim/objects/models/soft_object.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
mass | float | 必填 | 0.1 | 物体总质量(kg) |
density | float | 必填 | 1000 | 物体密度(kg/m³) |
youngs_modulus | float | 可选 | 10000 | 杨氏模量(Pa),控制体积柔性体的刚度 |
poissons_ratio | float | 可选 | 0.3 | 泊松比,控制横向与纵向变形的比例 ⚠须在 [0, 0.5) 范围内 |
damping | float | 可选 | 0.01 | 全局阻尼系数 |
dynamic_friction | float | 可选 | 0.5 | 动摩擦系数 |
static_friction | float | 可选 | 0.5 | 静摩擦系数 |
stretch_stiffness | float | 可选 | 10000 | 拉伸刚度(N/m),仅布料类型生效 |
shear_stiffness | float | 可选 | 1000 | 剪切刚度(N/m),仅布料类型生效 |
bending_stiffness | float | 可选 | 10.0 | 弯曲刚度(N·m),仅布料类型生效 |
pressure | float | 可选 | 0.0 | 内部压力(Pa),用于充气柔性体,0 表示禁用 |
soft_body_type | enum | 可选 | volumetric | 柔性体类型,提示仿真器使用何种模型 ⚠cloth / volumetric / inflatable |
simulation_hex_mesh | bool | 可选 | false | 是否使用六面体网格进行体积 FEM(默认四面体) |
particle_contact_offset | float | 可选 | 0.02 | 粒子接触检测半径(米) |
solver_position_iterations | int | 可选 | 16 | 每步位置投影迭代次数 ⚠>= 1 |
enable_collision | bool | 必填 | true | 是否启用碰撞 |
self_collision | bool | 可选 | false | 是否启用自碰撞 |
disable_gravity | bool | 可选 | false | 是否禁用重力 |
继承自ObjectConfig4
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
source | string | 必填 | primitive | 资产来源 ⚠local / remote / primitive |
asset_path | string | 可选 | — | USD 资产路径 |
scale | list[3] | 可选 | [1, 1, 1] | 缩放比例 |
axis_y_up | bool | 可选 | false | 资产是否 Y 轴朝上 |
继承自SpawnableConfig5
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "soft" |
name | string | 必填 | — | 实体名称 |
prim_path | string | 可选 | — | USD prim 路径 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转 |
RobotConfig:机器人 (robot_cfg_dict)
PlannerConfig 为嵌套配置,由用户自定义规划器扩展;机器人基础字段在 RobotConfig 中定义,具体子类通过 stereotype 选择。
class
GeneralRobotConfigstereotypegeneral_robotextendsRobotConfig, ArticulationConfig, SpawnableConfigfastsim/unisim/robots/models/general_robot.py继承自RobotConfig4
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
ee_link_name | string | 可选 | — | 末端执行器 link 名称 |
ik_joint_names | list[str] | 可选 | — | 参与 IK 计算的关节名称子集(不设则使用全部可动关节) |
use_planner | bool | 可选 | false | 是否挂载运动规划器(如 Curobo) |
planner_cfg | PlannerConfig | 可选 | — | 规划器详细配置,use_planner 为 true 时生效 |
继承自ArticulationConfig6
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
asset_path | string | 必填 | — | 机器人 USD 资产路径 |
source | string | 必填 | local | 资产来源 ⚠local / remote |
actuator_cfg_dict | dict[str, ActuatorConfig] | 必填 | {} | 执行器配置字典(关节驱动组) |
init_joint_position | dict[str, float] | 可选 | {} | 初始关节位置 |
init_joint_velocity | dict[str, float] | 可选 | {} | 初始关节速度 |
scale | list[3] | 可选 | [1, 1, 1] | 缩放比例 |
继承自SpawnableConfig4
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "general_robot" |
name | string | 必填 | — | 实体名称 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转 |
class
SingleGripperArmRobotConfigstereotypesingle_gripper_arm_robotextendsRobotConfig, ArticulationConfig, SpawnableConfigfastsim/unisim/robots/models/single_gripper_arm_robot.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
arm_actuator_name | string | 必填 | — | 机械臂 actuator group 名称(须与 USD 中定义一致) |
gripper_actuator_name | string | 必填 | — | 夹爪 actuator group 名称 |
继承自RobotConfig4
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
ee_link_name | string | 可选 | — | 末端执行器 link 名称 |
ik_joint_names | list[str] | 可选 | — | IK 关节名称子集 |
use_planner | bool | 可选 | false | 是否挂载运动规划器 |
planner_cfg | PlannerConfig | 可选 | — | 规划器配置 |
继承自ArticulationConfig6
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
asset_path | string | 必填 | — | 机器人 USD 资产路径 |
source | string | 必填 | local | 资产来源 |
actuator_cfg_dict | dict[str, ActuatorConfig] | 必填 | {} | 执行器配置字典 |
init_joint_position | dict[str, float] | 可选 | {} | 初始关节位置 |
init_joint_velocity | dict[str, float] | 可选 | {} | 初始关节速度 |
scale | list[3] | 可选 | [1, 1, 1] | 缩放 |
继承自SpawnableConfig4
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "single_gripper_arm_robot" |
name | string | 必填 | — | 实体名称 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转 |
class
PlannerConfigfastsim/configs/scene_cfg.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | 规划器类型(由所接入的规划器插件定义) |
extra_parameters | dict | 可选 | {} | 规划器插件的扩展参数,由具体实现解释 |
SensorConfig:传感器 (sensor_cfg_dict)
class
CameraConfigstereotypecameraextendsSensorConfig, SpawnableConfigfastsim/unisim/sensors/models/camera.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
width | int | 必填 | — | 图像宽度(像素) |
height | int | 必填 | — | 图像高度(像素) |
data_types | list[str] | 必填 | — | 采集数据类型列表 ⚠rgb / depth / semantic_segmentation / instance_segmentation / normals |
clip_range | list[2] | 可选 | — | 深度裁剪范围 [near, far](米) |
attach_to | AttachToConfig | 可选 | — | 挂载配置(挂到某实体或 link 上) |
look_at | LookAtConfig | 可选 | — | 朝向配置(朝向目标实体或坐标) |
convention | enum | 可选 | world | 坐标系约定 ⚠world / opengl / ros |
继承自SpawnableConfig5
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "camera" |
name | string | 必填 | — | 传感器名称 |
prim_path | string | 可选 | — | USD prim 路径 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 [x, y, z] |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转(四元数) |
LightConfig:光源 (light_cfg_dict)
class
GeneralLightConfigstereotypegeneral_lightextendsLightConfig, SpawnableConfigfastsim/unisim/lights/models/general_light.py| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
light_type | enum | 必填 | — | 光源类型 ⚠distant(平行光)/ sphere(点光源)/ disk(面光源) |
intensity | float | 可选 | 1.0 | 光照强度 ⚠>= 0 |
exposure | float | 可选 | 0.0 | 曝光值 |
color | list[3] | 可选 | [1.0, 1.0, 1.0] | 颜色 [r, g, b],值域 0–1 |
visible | bool | 可选 | true | 光源自身网格是否在渲染中可见 |
enable_color_temperature | bool | 可选 | false | 是否启用色温(启用后 color 字段被覆盖) |
color_temperature | float | 可选 | 6500 | 色温(开尔文 K) |
normalize | bool | 可选 | false | 是否对光照强度做归一化 |
radius | float | 可选 | — | 光源半径(sphere 类型) ⚠> 0 |
angle | float | 可选 | — | 光源角度(distant 类型) |
texture_file | string | 可选 | — | 纹理贴图文件路径 |
继承自SpawnableConfig4
| 字段 | 类型 | 必填 | 默认值 | 说明 / 约束 |
|---|---|---|---|---|
stereotype | string | 必填 | — | "general_light" |
name | string | 必填 | — | 光源名称 |
position | list[3] | 可选 | [0.0, 0.0, 0.0] | 位置 |
rotation | list[4] | 可选 | [1.0, 0.0, 0.0, 0.0] | 旋转 |
配置示例
scene 配置块YAML
scene:
name: pick_and_place_scene
position: [0.0, 0.0, 0.0]
rotation: [1.0, 0.0, 0.0, 0.0]
base_config:
stereotype: ground_plane
ground_plane_size: [10.0, 10.0]
robot_cfg_dict:
arm:
stereotype: single_gripper_arm_robot
asset_path: assets://robots/ur5_with_gripper.usd
ee_link_name: tool0
use_planner: true
arm_actuator_name: arm
gripper_actuator_name: gripper
object_cfg_dict:
cube:
stereotype: rigid
asset_path: assets://objects/cube_red.usd
mass: 0.2
enable_gravity: true
cloth:
stereotype: soft
asset_path: assets://objects/cloth.usd
soft_body_type: cloth
mass: 0.05
stretch_stiffness: 8000
bending_stiffness: 5.0
sensor_cfg_dict:
wrist_cam:
stereotype: camera
width: 640
height: 480
data_types: [rgb, depth]
attach_to: arm
convention: ros
light_cfg_dict:
main_light:
stereotype: general_light
light_type: distant
intensity: 3000
color: [1.0, 1.0, 1.0]