Upload folder using huggingface_hub (part 3)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +45 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Emissives/Light_2900K.mdl +42 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Clear_Glass.mdl +43 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/img/77bb7e13f95488b9bba205f61774cfac.png +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/img/85e802b65576ab52c15d2ad699874710.png +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/img/ba71f64c7269bdc410f2b92f325c6388.png +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/material.usd +0 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/v_69323/link_0_0.usd +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/scripted_model_fridge.usd +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/scripts/README.md +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/fridge/scripts/fridge_control.py +241 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/c/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Clear_Glass.mdl +43 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/img/3dc867ea7a737e83b9295bafdf5b24c3.png +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/img/c6dbd8d68ea359d0d49d4c4e39f3a080.png +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/img/ee69344a9e8b2e377ccc57a83f592e69.png +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/material.usd +0 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/v_69323/link_0_0.usd +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/scripted_model_microwave.usd +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/README.md +3 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/__pycache__/oven_control.cpython-311.pyc +0 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py +230 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py.before_api_compat_fix_20260625_153709 +198 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py.before_pose_fix_20260625_185057 +213 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py.before_prim_path_fix_20260625_153054 +198 -0
- usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py.before_visibility_fix_20260625_154604 +199 -0
- usd_models/dry_kitchen.e2/backgrounds/Environment.usd +0 -0
- usd_models/dry_kitchen.e2/backgrounds/kitchen_background.usd +3 -0
- usd_models/dry_kitchen.e2/backgrounds/kitchen_background.usd.before_door_visual_only_20260701_1603 +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Clear_Glass.mdl +43 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Tinted_Glass_R02.mdl +19 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Tinted_Glass_R25.mdl +19 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Templates/GlassUtils.mdl +83 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Templates/GlassWithVolume.mdl +106 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/model_cabinet.usd +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/resource/img/e9f7c719a9c4fd93f4f8cbaf7f905858.png +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/resource/material.usd +0 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/resource/v_69323/link_0_0.usd +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/model_cabinetb_2.usd +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/resource/img/47e62735bb81ebd55a3b96179f4ca477.png +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/resource/img/b5438c25905693520be7b48998be40a7.png +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/resource/material.usd +0 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/resource/v_69323/link_0_0.usd +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/itm/potted_plant003/model_potted_plant003.usd +0 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/itm/potted_plant003/resource/img/dae60a53aa59e8e355383e2ef7d269cf.png +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/itm/potted_plant003/resource/material.usd +0 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/itm/potted_plant003/resource/v_0/link_default_0.usd +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/roundtable/model_roundtable.usd +0 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/roundtable/resource/img/b5438c25905693520be7b48998be40a7.png +3 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/roundtable/resource/material.usd +0 -0
- usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/roundtable/resource/v_69323/link_0_0.usd +3 -0
.gitattributes
CHANGED
|
@@ -168,3 +168,48 @@ usd_models/dry_kitchen.e2/assets/model_tea_can_v3.usd filter=lfs diff=lfs merge=
|
|
| 168 |
usd_models/dry_kitchen.e2/assets/nav_checkpoint.usd filter=lfs diff=lfs merge=lfs -text
|
| 169 |
usd_models/dry_kitchen.e2/assets/plate_1/plate_1.usdz filter=lfs diff=lfs merge=lfs -text
|
| 170 |
usd_models/dry_kitchen.e2/assets/plate_2/plate_2.usdz filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
usd_models/dry_kitchen.e2/assets/nav_checkpoint.usd filter=lfs diff=lfs merge=lfs -text
|
| 169 |
usd_models/dry_kitchen.e2/assets/plate_1/plate_1.usdz filter=lfs diff=lfs merge=lfs -text
|
| 170 |
usd_models/dry_kitchen.e2/assets/plate_2/plate_2.usdz filter=lfs diff=lfs merge=lfs -text
|
| 171 |
+
usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/v_69323/link_0_0.usd filter=lfs diff=lfs merge=lfs -text
|
| 172 |
+
usd_models/dry_kitchen.e2/assets/scripted/fridge/scripted_model_fridge.usd filter=lfs diff=lfs merge=lfs -text
|
| 173 |
+
usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/v_69323/link_0_0.usd filter=lfs diff=lfs merge=lfs -text
|
| 174 |
+
usd_models/dry_kitchen.e2/assets/scripted/microwave/scripted_model_microwave.usd filter=lfs diff=lfs merge=lfs -text
|
| 175 |
+
usd_models/dry_kitchen.e2/backgrounds/kitchen_background.usd filter=lfs diff=lfs merge=lfs -text
|
| 176 |
+
usd_models/dry_kitchen.e2/backgrounds/kitchen_background.usd.before_door_visual_only_20260701_1603 filter=lfs diff=lfs merge=lfs -text
|
| 177 |
+
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/model_cabinet.usd filter=lfs diff=lfs merge=lfs -text
|
| 178 |
+
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/resource/v_69323/link_0_0.usd filter=lfs diff=lfs merge=lfs -text
|
| 179 |
+
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/model_cabinetb_2.usd filter=lfs diff=lfs merge=lfs -text
|
| 180 |
+
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/resource/v_69323/link_0_0.usd filter=lfs diff=lfs merge=lfs -text
|
| 181 |
+
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/itm/potted_plant003/resource/v_0/link_default_0.usd filter=lfs diff=lfs merge=lfs -text
|
| 182 |
+
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/roundtable/resource/v_69323/link_0_0.usd filter=lfs diff=lfs merge=lfs -text
|
| 183 |
+
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/sofa/model_sofa.usd filter=lfs diff=lfs merge=lfs -text
|
| 184 |
+
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/sofa/resource/v_69323/link_0_0.usd filter=lfs diff=lfs merge=lfs -text
|
| 185 |
+
usd_models/dry_kitchen.e2/kitchen.usd filter=lfs diff=lfs merge=lfs -text
|
| 186 |
+
usd_models/dry_kitchen.e2/new_edit_textures/basket.usdz filter=lfs diff=lfs merge=lfs -text
|
| 187 |
+
usd_models/dry_kitchen.e2/new_edit_textures/coffee.usdz filter=lfs diff=lfs merge=lfs -text
|
| 188 |
+
usd_models/dry_kitchen.e2/new_edit_textures/glass_holder.usdz filter=lfs diff=lfs merge=lfs -text
|
| 189 |
+
usd_models/dry_kitchen.e2/new_edit_textures/knife.usdz filter=lfs diff=lfs merge=lfs -text
|
| 190 |
+
usd_models/dry_kitchen.e2/new_edit_textures/meat.usdz filter=lfs diff=lfs merge=lfs -text
|
| 191 |
+
usd_models/dry_kitchen.e2/new_edit_textures/mug.usdz filter=lfs diff=lfs merge=lfs -text
|
| 192 |
+
usd_models/dry_kitchen.e2/plate_1/plate_1.usdz filter=lfs diff=lfs merge=lfs -text
|
| 193 |
+
usd_models/dry_kitchen.e2/plate_2/plate_2.usdz filter=lfs diff=lfs merge=lfs -text
|
| 194 |
+
usd_models/human/scene.usdc filter=lfs diff=lfs merge=lfs -text
|
| 195 |
+
usd_models/sber_shop.e1/0_cup.usd filter=lfs diff=lfs merge=lfs -text
|
| 196 |
+
usd_models/sber_shop.e1/0_green_Tshort.usd filter=lfs diff=lfs merge=lfs -text
|
| 197 |
+
usd_models/sber_shop.e1/0_red_Tshort.usd filter=lfs diff=lfs merge=lfs -text
|
| 198 |
+
usd_models/sber_shop.e1/0_shkaf.usd filter=lfs diff=lfs merge=lfs -text
|
| 199 |
+
usd_models/sber_shop.e1/Blue_Pen_Display/Blue_Pen_Display.usd filter=lfs diff=lfs merge=lfs -text
|
| 200 |
+
usd_models/sber_shop.e1/Green_Pencils_in_a_Ca/Green_Pencils_in_a_Ca.usd filter=lfs diff=lfs merge=lfs -text
|
| 201 |
+
usd_models/sber_shop.e1/Green_Pens_in_a_Box/Green_Pens_in_a_Box.usd filter=lfs diff=lfs merge=lfs -text
|
| 202 |
+
usd_models/sber_shop.e1/Green_Spiral_Notebook/Green_Spiral_Notebook.usd filter=lfs diff=lfs merge=lfs -text
|
| 203 |
+
usd_models/sber_shop.e1/Meshy_AI_POS_Tablet_with_Sprea_0805135642_texture/Meshy_AI_POS_Tablet_with_Sprea_0805135642_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 204 |
+
usd_models/sber_shop.e1/Meshy_AI_Slate_Gray_Roll_Top_B_0805080559_texture/Meshy_AI_Slate_Gray_Roll_Top_B_0805080559_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 205 |
+
usd_models/sber_shop.e1/Meshy_AI_Slate_Gray_Roll_Top_B_0805080559_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 206 |
+
usd_models/sber_shop.e1/Meshy_AI_Stack_of_Folded_Hoodi_0805080624_texture/Meshy_AI_Stack_of_Folded_Hoodi_0805080624_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 207 |
+
usd_models/sber_shop.e1/Meshy_AI_Stack_of_Folded_Hoodi_0805080624_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 208 |
+
usd_models/sber_shop.e1/Meshy_AI_Stack_of_Jeans_0805080610_texture/Meshy_AI_Stack_of_Jeans_0805080610_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 209 |
+
usd_models/sber_shop.e1/Meshy_AI_Stack_of_Jeans_0805080610_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 210 |
+
usd_models/sber_shop.e1/Meshy_AI_Stack_of_folded_trous_0805135423_texture/Meshy_AI_Stack_of_folded_trous_0805135423_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 211 |
+
usd_models/sber_shop.e1/Meshy_AI_Stack_of_spiral_bound_0805135445_texture/Meshy_AI_Stack_of_spiral_bound_0805135445_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 212 |
+
usd_models/sber_shop.e1/Meshy_AI_Stacked_Hoodies_0805080637_texture/Meshy_AI_Stacked_Hoodies_0805080637_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 213 |
+
usd_models/sber_shop.e1/Meshy_AI_Stacked_Hoodies_0805080637_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 214 |
+
usd_models/sber_shop.e1/Meshy_AI_Stacked_Polo_Shirts_0805135406_texture/Meshy_AI_Stacked_Polo_Shirts_0805135406_texture.usd filter=lfs diff=lfs merge=lfs -text
|
| 215 |
+
usd_models/sber_shop.e1/Meshy_AI_Stacked_T_Shirts_in_N_0805135339_texture/Meshy_AI_Stacked_T_Shirts_in_N_0805135339_texture.usd filter=lfs diff=lfs merge=lfs -text
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Emissives/Light_2900K.mdl
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.4;
|
| 2 |
+
|
| 3 |
+
using ::OmniPBR import OmniPBR;
|
| 4 |
+
import ::tex::gamma_mode;
|
| 5 |
+
import ::state::normal;
|
| 6 |
+
|
| 7 |
+
export material Light_2900K(*)
|
| 8 |
+
= OmniPBR(
|
| 9 |
+
diffuse_color_constant: color(1.0, 1.0, 1.0),
|
| 10 |
+
diffuse_texture: texture_2d(),
|
| 11 |
+
albedo_desaturation: 0.f,
|
| 12 |
+
albedo_add: 0.f,
|
| 13 |
+
albedo_brightness: 1.f,
|
| 14 |
+
diffuse_tint: color(1.f, 1.f, 1.f),
|
| 15 |
+
reflection_roughness_constant: 1.0,
|
| 16 |
+
reflection_roughness_texture_influence: 0.f,
|
| 17 |
+
reflectionroughness_texture: texture_2d(),
|
| 18 |
+
metallic_constant: 0.0,
|
| 19 |
+
metallic_texture_influence: 0.f,
|
| 20 |
+
metallic_texture: texture_2d(),
|
| 21 |
+
specular_level: 0.5f,
|
| 22 |
+
enable_ORM_texture: false,
|
| 23 |
+
ORM_texture: texture_2d(),
|
| 24 |
+
ao_to_diffuse: 0.f,
|
| 25 |
+
ao_texture: texture_2d(),
|
| 26 |
+
enable_emission: true,
|
| 27 |
+
emissive_color: color(1.0, 0.69412, 0.39608),
|
| 28 |
+
emissive_mask_texture: texture_2d(),
|
| 29 |
+
emissive_intensity: 5000.0,
|
| 30 |
+
bump_factor: 0.f,
|
| 31 |
+
normalmap_texture: texture_2d(),
|
| 32 |
+
detail_bump_factor: 0.3f,
|
| 33 |
+
detail_normalmap_texture: texture_2d(),
|
| 34 |
+
project_uvw: false,
|
| 35 |
+
world_or_object: false,
|
| 36 |
+
uv_space_index: 0,
|
| 37 |
+
texture_translate: float2(0.f),
|
| 38 |
+
texture_rotate: 0.f,
|
| 39 |
+
texture_scale: float2(1.f),
|
| 40 |
+
detail_texture_translate: float2(0.f),
|
| 41 |
+
detail_texture_rotate: 0.f,
|
| 42 |
+
detail_texture_scale: float2(1.f));
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Clear_Glass.mdl
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.3;
|
| 2 |
+
|
| 3 |
+
import ::OmniGlass::OmniGlass;
|
| 4 |
+
import ::tex::gamma_mode;
|
| 5 |
+
import ::state::normal;
|
| 6 |
+
|
| 7 |
+
export material Clear_Glass(*)
|
| 8 |
+
= OmniGlass::OmniGlass(
|
| 9 |
+
absorption_coeff: color(1.f, 1.f, 1.f),
|
| 10 |
+
glass_color: color(1.f, 1.f, 1.f),
|
| 11 |
+
use_glass_color_texture: false,
|
| 12 |
+
glass_color_texture: texture_2d(),
|
| 13 |
+
frosting_roughness: 0.f,
|
| 14 |
+
glass_ior: 1.52f,
|
| 15 |
+
thin_walled: true,
|
| 16 |
+
project_uvw: false,
|
| 17 |
+
world_or_object: false,
|
| 18 |
+
uv_space_index: 0,
|
| 19 |
+
texture_translate: float2(0.f),
|
| 20 |
+
texture_rotate: 0.f,
|
| 21 |
+
texture_scale: float2(1.f));
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
mdl 1.5;
|
| 25 |
+
|
| 26 |
+
import ::Library::AEC::Materials::Templates::GlassWithVolume::GlassWithVolume;
|
| 27 |
+
import ::tex::gamma_mode;
|
| 28 |
+
import ::state::normal;
|
| 29 |
+
|
| 30 |
+
export material Clear_Glass(*)
|
| 31 |
+
= ::Library::AEC::Materials::Templates::GlassWithVolume::GlassWithVolume(
|
| 32 |
+
thin_walled: true,
|
| 33 |
+
transmission_color: color(1.f, 1.f, 1.f),
|
| 34 |
+
roughness_texture: texture_2d(),
|
| 35 |
+
ior: 1.52f,
|
| 36 |
+
transmission_color_texture: texture_2d(),
|
| 37 |
+
roughness_texture_influence: 0.f,
|
| 38 |
+
roughness: 0.f,
|
| 39 |
+
reflection_color_texture: texture_2d(),
|
| 40 |
+
reflection_color: color(1.f, 1.f, 1.f),
|
| 41 |
+
depth: 0.0001f,
|
| 42 |
+
normal_map_texture: texture_2d());
|
| 43 |
+
*/
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/img/77bb7e13f95488b9bba205f61774cfac.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/img/85e802b65576ab52c15d2ad699874710.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/img/ba71f64c7269bdc410f2b92f325c6388.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/material.usd
ADDED
|
Binary file (3.94 kB). View file
|
|
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/resource/v_69323/link_0_0.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9154f1321b36104c43a67566426e38bb8e1a1e4884f3e139cc9f6e74beaf456
|
| 3 |
+
size 1537602
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/scripted_model_fridge.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1bfd53091a4ea3a5c49bc7f7d68919b6836767e370e5193eaeab4b158eecff04
|
| 3 |
+
size 5697113
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/scripts/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fridge behavior script
|
| 2 |
+
|
| 3 |
+
Copied from ArtVIP script sources and colocated with the scripted fridge USD.
|
usd_models/dry_kitchen.e2/assets/scripted/fridge/scripts/fridge_control.py
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import carb
|
| 2 |
+
from omni.kit.scripting import BehaviorScript
|
| 3 |
+
from omni.isaac.dynamic_control import _dynamic_control
|
| 4 |
+
from enum import Enum
|
| 5 |
+
from pxr import Gf
|
| 6 |
+
from threading import Thread
|
| 7 |
+
import marshal,json
|
| 8 |
+
import omni.kit.commands
|
| 9 |
+
from omni.isaac.core.prims import XFormPrim
|
| 10 |
+
import numpy as np
|
| 11 |
+
from pxr import Gf, Sdf, Usd, UsdGeom
|
| 12 |
+
from omni.isaac.core import SimulationContext, World
|
| 13 |
+
import math
|
| 14 |
+
from omni.replicator.core import utils
|
| 15 |
+
from pxr import PhysxSchema, UsdGeom, UsdPhysics
|
| 16 |
+
import math
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def find_prim_path_by_name(prim_name: str, root_path: str = "/") -> str:
|
| 20 |
+
"""Recursively find the full path by Prim name"""
|
| 21 |
+
stage = omni.usd.get_context().get_stage()
|
| 22 |
+
prim = stage.GetPrimAtPath(root_path)
|
| 23 |
+
|
| 24 |
+
def _find_prim(prim):
|
| 25 |
+
if prim.GetName() == prim_name:
|
| 26 |
+
return prim.GetPath().pathString
|
| 27 |
+
for child in prim.GetChildren():
|
| 28 |
+
result = _find_prim(child)
|
| 29 |
+
if result:
|
| 30 |
+
return result
|
| 31 |
+
return None
|
| 32 |
+
|
| 33 |
+
found_path = _find_prim(prim)
|
| 34 |
+
if not found_path:
|
| 35 |
+
raise RuntimeError(f"Prim '{prim_name}' not found under {root_path}")
|
| 36 |
+
return found_path
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
# 1. prim init
|
| 41 |
+
# joint_prim = XFormPrim(find_prim_path_by_name("fridge_E_body_61"))
|
| 42 |
+
# right_revolutejoint_path = find_prim_path_by_name("RevoluteJoint_fridge_right")
|
| 43 |
+
# left_revolutejoint_path = find_prim_path_by_name("RevoluteJoint_fridge_left")
|
| 44 |
+
|
| 45 |
+
# 2. articulation Root prim
|
| 46 |
+
root_articulation_prim = find_prim_path_by_name("E_body_9")
|
| 47 |
+
stage = omni.usd.get_context().get_stage()
|
| 48 |
+
# 3. joint name
|
| 49 |
+
joint_names = ["RevoluteJoint_skbx_25_right1","RevoluteJoint_skbx_25_right"]
|
| 50 |
+
joint_threshold = 0.4
|
| 51 |
+
# 4. Joint information
|
| 52 |
+
joints_info = {}
|
| 53 |
+
for joint_name in joint_names:
|
| 54 |
+
joint_prim_path = find_prim_path_by_name(joint_name)
|
| 55 |
+
joint_prim_obj = stage.GetPrimAtPath(joint_prim_path)
|
| 56 |
+
joint = UsdPhysics.RevoluteJoint(joint_prim_obj)
|
| 57 |
+
|
| 58 |
+
joints_info[joint_name] = {
|
| 59 |
+
'prim': joint,
|
| 60 |
+
'lower_limit': joint.GetLowerLimitAttr().Get(),
|
| 61 |
+
'upper_limit': joint.GetUpperLimitAttr().Get()
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
# 5. Joint limits and limit differences
|
| 65 |
+
joint_limits = {}
|
| 66 |
+
joint_limit_diffs = {}
|
| 67 |
+
|
| 68 |
+
for i, joint_name in enumerate(joint_names):
|
| 69 |
+
joint_limits[joint_name] = {
|
| 70 |
+
'lower': joints_info[joint_name]['lower_limit'],
|
| 71 |
+
'upper': joints_info[joint_name]['upper_limit']
|
| 72 |
+
}
|
| 73 |
+
joint_limit_diffs[joint_name] = (
|
| 74 |
+
joints_info[joint_name]['upper_limit'] - joints_info[joint_name]['lower_limit']
|
| 75 |
+
)
|
| 76 |
+
# joint_limit_diff1 = joint_limit_diffs[joint_names[0]]
|
| 77 |
+
# joint_limit_diff2 = joint_limit_diffs[joint_names[1]]
|
| 78 |
+
# 5. light prim
|
| 79 |
+
light_scopes=[
|
| 80 |
+
XFormPrim(find_prim_path_by_name("fridge_4_light"))
|
| 81 |
+
]
|
| 82 |
+
|
| 83 |
+
class CupboardControl(BehaviorScript):
|
| 84 |
+
def on_init(self):
|
| 85 |
+
self.phsx_freq = 120
|
| 86 |
+
self.joint_handles = []
|
| 87 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 88 |
+
light_scopes[0].set_visibility(False)
|
| 89 |
+
# light_scopes[1].set_visibility(False)
|
| 90 |
+
# init_pose
|
| 91 |
+
# self.local_pose_button, self.local_ort_button_down = joint_prim.get_local_pose()
|
| 92 |
+
# self.local_pose_door, self.local_ort_drawer_up = door_prim.get_local_pose()
|
| 93 |
+
|
| 94 |
+
# Find Root
|
| 95 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 96 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 97 |
+
print('the prim is not an articulation')
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
def on_destroy(self):
|
| 101 |
+
pass
|
| 102 |
+
|
| 103 |
+
def on_play(self):
|
| 104 |
+
#
|
| 105 |
+
self.simulation_context = SimulationContext(
|
| 106 |
+
stage_units_in_meters=1.0,
|
| 107 |
+
physics_dt=1.0/120,
|
| 108 |
+
rendering_dt=1.0/120
|
| 109 |
+
)
|
| 110 |
+
|
| 111 |
+
def on_pause(self):
|
| 112 |
+
pass
|
| 113 |
+
|
| 114 |
+
def on_stop(self):
|
| 115 |
+
self.init_start=True
|
| 116 |
+
# for light in light_scopes:
|
| 117 |
+
# light.set_visibility(False)
|
| 118 |
+
light_scopes[0].set_visibility(False)
|
| 119 |
+
# light_scopes[1].set_visibility(False)
|
| 120 |
+
# back to initial pose
|
| 121 |
+
# joint_prim.set_local_pose(translation=self.local_pose_button)
|
| 122 |
+
pass
|
| 123 |
+
|
| 124 |
+
def on_update(self, current_time: float, delta_time: float):
|
| 125 |
+
if delta_time <= 0:
|
| 126 |
+
return
|
| 127 |
+
self.active_art()
|
| 128 |
+
self.apply_behavior()
|
| 129 |
+
|
| 130 |
+
def active_art(self):
|
| 131 |
+
# Find Root
|
| 132 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 133 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 134 |
+
print('the prim is not an articulation')
|
| 135 |
+
self.dc.wake_up_articulation(self.art)
|
| 136 |
+
|
| 137 |
+
# Find joint
|
| 138 |
+
self.joint_handles = []
|
| 139 |
+
for joint_name in joint_names:
|
| 140 |
+
self.joint_handles.append( self.dc.find_articulation_dof(self.art, joint_name))
|
| 141 |
+
|
| 142 |
+
def apply_behavior(self):
|
| 143 |
+
self.light_control()
|
| 144 |
+
self.damping_stiffness_change()
|
| 145 |
+
self.target_pose_control()
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
def light_control(self):
|
| 149 |
+
self.left_joint_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 150 |
+
self.right_joint_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 151 |
+
# print("self.Joint1_state",self.Joint1_state)
|
| 152 |
+
# 联合判断双门状态
|
| 153 |
+
doors_open = [
|
| 154 |
+
self.left_joint_state > math.radians(30),
|
| 155 |
+
self.right_joint_state > math.radians(30)
|
| 156 |
+
]
|
| 157 |
+
|
| 158 |
+
# 灯光控制逻辑
|
| 159 |
+
current_visibility = light_scopes[0].get_visibility()
|
| 160 |
+
if any(doors_open):
|
| 161 |
+
if not current_visibility:
|
| 162 |
+
for light in light_scopes:
|
| 163 |
+
light.set_visibility(True)
|
| 164 |
+
else:
|
| 165 |
+
if current_visibility:
|
| 166 |
+
for light in light_scopes:
|
| 167 |
+
light.set_visibility(False)
|
| 168 |
+
|
| 169 |
+
# if self.right_joint_state > math.radians(30) :
|
| 170 |
+
# if light_scopes[0].get_visibility() == False:
|
| 171 |
+
# for light in light_scopes:
|
| 172 |
+
# light.set_visibility(True)
|
| 173 |
+
# # self.dc.set_dof_position_target(self.joint_handles[1], 140)
|
| 174 |
+
|
| 175 |
+
# elif self.right_joint_state < math.radians(30):
|
| 176 |
+
# if light_scopes[0].get_visibility() == True:
|
| 177 |
+
# for light in light_scopes:
|
| 178 |
+
# light.set_visibility(False)
|
| 179 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], 0)
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
def damping_stiffness_change(self):
|
| 183 |
+
|
| 184 |
+
for i, joint_name in enumerate(joint_names):
|
| 185 |
+
# Get joint state
|
| 186 |
+
joint_state = self.dc.get_dof_state(self.joint_handles[i], _dynamic_control.STATE_ALL).pos
|
| 187 |
+
# Get joint drive API
|
| 188 |
+
joint_drive_path = stage.GetPrimAtPath(find_prim_path_by_name(joint_name))
|
| 189 |
+
joint_drive = UsdPhysics.DriveAPI.Get(joint_drive_path, "angular")
|
| 190 |
+
# Get joint limit difference and set stiffness
|
| 191 |
+
|
| 192 |
+
joint_limit_diff = joint_limit_diffs[joint_names[i]]
|
| 193 |
+
joint_drive.GetStiffnessAttr().Set(self.calculate_stiffness(joint_state))
|
| 194 |
+
# stiffness = joint_drive.GetStiffnessAttr().Get()
|
| 195 |
+
# damping = joint_drive.GetDampingAttr().Get()
|
| 196 |
+
# print(f"{joint_name} - Stiffness: {stiffness}, Damping: {damping}")
|
| 197 |
+
def calculate_stiffness(self,joint_state):
|
| 198 |
+
"""Calculate stiffness value based on joint angle
|
| 199 |
+
|
| 200 |
+
Args:
|
| 201 |
+
joint_state (float): Joint angle (radians)
|
| 202 |
+
joint_limit (float): Joint limit value
|
| 203 |
+
|
| 204 |
+
Returns:
|
| 205 |
+
float: Stiffness value
|
| 206 |
+
"""
|
| 207 |
+
max_stiffness = 20 # 最大刚度
|
| 208 |
+
# max_stiffness = 50 # 最大刚度
|
| 209 |
+
min_stiffness = 2 # 最小刚度
|
| 210 |
+
decay_rate = 3 # 衰减率
|
| 211 |
+
# 使用指数衰减函数计算刚度
|
| 212 |
+
if abs(joint_state) >= abs(math.radians(joint_threshold * (joints_info[joint_names[i]]['upper_limit']+joints_info[joint_names[i]]['lower_limit']))):
|
| 213 |
+
return min_stiffness
|
| 214 |
+
|
| 215 |
+
# 计算刚度值:stiffness = max_stiffness * e^(-decay_rate * angle)
|
| 216 |
+
stiffness = max_stiffness * math.exp(-decay_rate * abs(joint_state))
|
| 217 |
+
|
| 218 |
+
# 确保刚度值在最小值和最大值之间
|
| 219 |
+
return max(min_stiffness, min(stiffness, max_stiffness))
|
| 220 |
+
|
| 221 |
+
def target_pose_control(self):
|
| 222 |
+
for i, joint_handle in enumerate(self.joint_handles):
|
| 223 |
+
# Get joint state
|
| 224 |
+
joint_state = self.dc.get_dof_state(joint_handle, _dynamic_control.STATE_ALL).pos
|
| 225 |
+
|
| 226 |
+
# print("joint_state", joint_state)
|
| 227 |
+
# print("joints_info[joint_names[i]]['upper_limit']", joints_info[joint_names[i]]['upper_limit'])
|
| 228 |
+
# Get joint limit difference
|
| 229 |
+
# Set target position based on joint state
|
| 230 |
+
if abs(joints_info[joint_names[i]]['lower_limit']) <= math.radians(abs(joints_info[joint_names[i]]['upper_limit'])):
|
| 231 |
+
if joint_state > math.radians(joint_threshold * (joints_info[joint_names[i]]['upper_limit']+joints_info[joint_names[i]]['lower_limit'])):
|
| 232 |
+
|
| 233 |
+
self.dc.set_dof_position_target(joint_handle, math.radians(joints_info[joint_names[i]]['upper_limit']))
|
| 234 |
+
else:
|
| 235 |
+
self.dc.set_dof_position_target(joint_handle, math.radians(joints_info[joint_names[i]]['lower_limit']))
|
| 236 |
+
else:
|
| 237 |
+
if joint_state < math.radians(joint_threshold * (joints_info[joint_names[i]]['upper_limit']+joints_info[joint_names[i]]['lower_limit'])):
|
| 238 |
+
self.dc.set_dof_position_target(joint_handle, math.radians(joints_info[joint_names[i]]['lower_limit']))
|
| 239 |
+
else:
|
| 240 |
+
self.dc.set_dof_position_target(joint_handle, math.radians(joints_info[joint_names[i]]['upper_limit']))
|
| 241 |
+
# print("self.dc.get_dof_position_target=",self.dc.get_dof_position_target(joint_handle))
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/c/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Clear_Glass.mdl
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.3;
|
| 2 |
+
|
| 3 |
+
import ::OmniGlass::OmniGlass;
|
| 4 |
+
import ::tex::gamma_mode;
|
| 5 |
+
import ::state::normal;
|
| 6 |
+
|
| 7 |
+
export material Clear_Glass(*)
|
| 8 |
+
= OmniGlass::OmniGlass(
|
| 9 |
+
absorption_coeff: color(1.f, 1.f, 1.f),
|
| 10 |
+
glass_color: color(1.f, 1.f, 1.f),
|
| 11 |
+
use_glass_color_texture: false,
|
| 12 |
+
glass_color_texture: texture_2d(),
|
| 13 |
+
frosting_roughness: 0.f,
|
| 14 |
+
glass_ior: 1.52f,
|
| 15 |
+
thin_walled: true,
|
| 16 |
+
project_uvw: false,
|
| 17 |
+
world_or_object: false,
|
| 18 |
+
uv_space_index: 0,
|
| 19 |
+
texture_translate: float2(0.f),
|
| 20 |
+
texture_rotate: 0.f,
|
| 21 |
+
texture_scale: float2(1.f));
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
mdl 1.5;
|
| 25 |
+
|
| 26 |
+
import ::Library::AEC::Materials::Templates::GlassWithVolume::GlassWithVolume;
|
| 27 |
+
import ::tex::gamma_mode;
|
| 28 |
+
import ::state::normal;
|
| 29 |
+
|
| 30 |
+
export material Clear_Glass(*)
|
| 31 |
+
= ::Library::AEC::Materials::Templates::GlassWithVolume::GlassWithVolume(
|
| 32 |
+
thin_walled: true,
|
| 33 |
+
transmission_color: color(1.f, 1.f, 1.f),
|
| 34 |
+
roughness_texture: texture_2d(),
|
| 35 |
+
ior: 1.52f,
|
| 36 |
+
transmission_color_texture: texture_2d(),
|
| 37 |
+
roughness_texture_influence: 0.f,
|
| 38 |
+
roughness: 0.f,
|
| 39 |
+
reflection_color_texture: texture_2d(),
|
| 40 |
+
reflection_color: color(1.f, 1.f, 1.f),
|
| 41 |
+
depth: 0.0001f,
|
| 42 |
+
normal_map_texture: texture_2d());
|
| 43 |
+
*/
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/img/3dc867ea7a737e83b9295bafdf5b24c3.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/img/c6dbd8d68ea359d0d49d4c4e39f3a080.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/img/ee69344a9e8b2e377ccc57a83f592e69.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/material.usd
ADDED
|
Binary file (3.8 kB). View file
|
|
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/resource/v_69323/link_0_0.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8bfeae376f874054cb6b37af9bb6e246107834cbae8bb77c5c32fb30c2b77432
|
| 3 |
+
size 8077463
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/scripted_model_microwave.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:838aad14d70993bdcb3b331ab132fbc51551597c7e420b18045e6adcec4affc7
|
| 3 |
+
size 14860535
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Microwave behavior script
|
| 2 |
+
|
| 3 |
+
This asset is named `oven` in the ArtVIP dataset, but semantically it is the microwave.
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/__pycache__/oven_control.cpython-311.pyc
ADDED
|
Binary file (12 kB). View file
|
|
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import carb
|
| 2 |
+
from omni.kit.scripting import BehaviorScript
|
| 3 |
+
from omni.isaac.dynamic_control import _dynamic_control
|
| 4 |
+
from enum import Enum
|
| 5 |
+
from pxr import Gf
|
| 6 |
+
from threading import Thread
|
| 7 |
+
import marshal,json
|
| 8 |
+
import omni.kit.commands
|
| 9 |
+
try:
|
| 10 |
+
from isaacsim.core.prims import XFormPrim
|
| 11 |
+
from isaacsim.core.api import SimulationContext, World
|
| 12 |
+
except ImportError:
|
| 13 |
+
from omni.isaac.core.prims import XFormPrim
|
| 14 |
+
from omni.isaac.core import SimulationContext, World
|
| 15 |
+
import numpy as np
|
| 16 |
+
from pxr import PhysxSchema, Usd, UsdGeom, UsdPhysics
|
| 17 |
+
import math
|
| 18 |
+
# stiffness :0.8 Damping: 0.05
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def set_prim_visibility(prim_path: str, visible: bool) -> None:
|
| 24 |
+
stage = omni.usd.get_context().get_stage()
|
| 25 |
+
prim = stage.GetPrimAtPath(prim_path)
|
| 26 |
+
if not prim:
|
| 27 |
+
carb.log_warn(f"Visibility target not found: {prim_path}")
|
| 28 |
+
return
|
| 29 |
+
imageable = UsdGeom.Imageable(prim)
|
| 30 |
+
if visible:
|
| 31 |
+
imageable.MakeVisible()
|
| 32 |
+
else:
|
| 33 |
+
imageable.MakeInvisible()
|
| 34 |
+
|
| 35 |
+
def get_prim_local_pose(prim_path: str):
|
| 36 |
+
stage = omni.usd.get_context().get_stage()
|
| 37 |
+
prim = stage.GetPrimAtPath(prim_path)
|
| 38 |
+
if not prim:
|
| 39 |
+
carb.log_warn(f"Pose target not found: {prim_path}")
|
| 40 |
+
return None, None
|
| 41 |
+
|
| 42 |
+
matrix_with_reset = UsdGeom.Xformable(prim).GetLocalTransformation(Usd.TimeCode.Default())
|
| 43 |
+
matrix = matrix_with_reset[0] if isinstance(matrix_with_reset, tuple) else matrix_with_reset
|
| 44 |
+
translation = matrix.ExtractTranslation()
|
| 45 |
+
rotation = matrix.ExtractRotationQuat()
|
| 46 |
+
imaginary = rotation.GetImaginary()
|
| 47 |
+
return (
|
| 48 |
+
np.array([translation[0], translation[1], translation[2]], dtype=float),
|
| 49 |
+
np.array([rotation.GetReal(), imaginary[0], imaginary[1], imaginary[2]], dtype=float),
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
def find_prim_path_by_name(prim_name: str, root_path: str = "/") -> str:
|
| 53 |
+
"""Recursively find the full path by Prim name"""
|
| 54 |
+
stage = omni.usd.get_context().get_stage()
|
| 55 |
+
prim = stage.GetPrimAtPath(root_path)
|
| 56 |
+
|
| 57 |
+
def _find_prim(prim):
|
| 58 |
+
if prim.GetName() == prim_name:
|
| 59 |
+
return prim.GetPath().pathString
|
| 60 |
+
for child in prim.GetChildren():
|
| 61 |
+
result = _find_prim(child)
|
| 62 |
+
if result:
|
| 63 |
+
return result
|
| 64 |
+
return None
|
| 65 |
+
|
| 66 |
+
found_path = _find_prim(prim)
|
| 67 |
+
if not found_path:
|
| 68 |
+
raise RuntimeError(f"Prim '{prim_name}' not found under {root_path}")
|
| 69 |
+
return found_path
|
| 70 |
+
|
| 71 |
+
# # 1. prim init
|
| 72 |
+
# button_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Xform")
|
| 73 |
+
# door_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_door")
|
| 74 |
+
# # 2. articulation Root prim
|
| 75 |
+
# root_articulation_prim = "/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_base"
|
| 76 |
+
# # 3. joint name
|
| 77 |
+
# joint_names = ["PrismaticJoint", "RevoluteJoint"]
|
| 78 |
+
# # 4. joint num
|
| 79 |
+
# num_arm_dof = 2
|
| 80 |
+
|
| 81 |
+
# light_scopes=[XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on"),
|
| 82 |
+
# XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on_1"),
|
| 83 |
+
# ]
|
| 84 |
+
# for i in range(0, light_scopes.__len__()):
|
| 85 |
+
# light_scopes[i].set_visibility(False)
|
| 86 |
+
# index = random.randint(0, len(light_scopes)-1)
|
| 87 |
+
# light_scopes[index].set_visibility(True)
|
| 88 |
+
button_prim_path = find_prim_path_by_name("oven_E_button_5")
|
| 89 |
+
button_prim = XFormPrim(button_prim_path)
|
| 90 |
+
print("button_prim", button_prim_path)
|
| 91 |
+
# door_prim = XFormPrim(find_prim_path_by_name("oven_E_door_4"))
|
| 92 |
+
# print("door_prim", door_prim.prim_path)
|
| 93 |
+
root_articulation_prim = find_prim_path_by_name("oven_E_body_7")
|
| 94 |
+
print("root_articulation_prim", root_articulation_prim)
|
| 95 |
+
joint_names = ["PrismaticJoint_oven_down", "RevoluteJoint_oven_up"]
|
| 96 |
+
light_scope_paths = [find_prim_path_by_name("oven_light")]
|
| 97 |
+
light_scopes = [XFormPrim(path) for path in light_scope_paths]
|
| 98 |
+
revolutejoint_path = find_prim_path_by_name("RevoluteJoint_oven_up")
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
class MicrowaveOverControl(BehaviorScript):
|
| 102 |
+
def on_init(self):
|
| 103 |
+
self.phsx_freq = 120
|
| 104 |
+
self.joint_handles = []
|
| 105 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 106 |
+
set_prim_visibility(light_scope_paths[0], False)
|
| 107 |
+
self.Stiffness_max = 0.8
|
| 108 |
+
self.Stiffness_min = 0.08
|
| 109 |
+
|
| 110 |
+
# 初始化门的锁定状态
|
| 111 |
+
self.door_locked = True
|
| 112 |
+
|
| 113 |
+
# init_pose
|
| 114 |
+
self.local_pose_button, self.local_ort_drawer_down = get_prim_local_pose(button_prim_path)
|
| 115 |
+
# self.local_pose_door, self.local_ort_drawer_up = door_prim.get_local_pose()
|
| 116 |
+
|
| 117 |
+
# Find Root
|
| 118 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 119 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 120 |
+
print('the prim is not an articulation')
|
| 121 |
+
stage = omni.usd.get_context().get_stage()
|
| 122 |
+
self.revoluteJoint_drive_path = stage.GetPrimAtPath(revolutejoint_path)
|
| 123 |
+
self.revoluteJoint_drive = UsdPhysics.DriveAPI.Get(self.revoluteJoint_drive_path, "angular")
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def on_destroy(self):
|
| 127 |
+
pass
|
| 128 |
+
|
| 129 |
+
def on_play(self):
|
| 130 |
+
self.simulation_context = SimulationContext(
|
| 131 |
+
stage_units_in_meters=1.0,
|
| 132 |
+
physics_dt=1.0/120,
|
| 133 |
+
rendering_dt=1.0/120
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
def on_pause(self):
|
| 138 |
+
pass
|
| 139 |
+
|
| 140 |
+
def on_stop(self):
|
| 141 |
+
self.init_start=True
|
| 142 |
+
set_prim_visibility(light_scope_paths[0], False)
|
| 143 |
+
# back to initial pose
|
| 144 |
+
# button_prim.set_local_pose(translation=self.local_pose_button)
|
| 145 |
+
# door_prim.set_local_pose(translation=self.local_pose_door)
|
| 146 |
+
self.door_locked = True
|
| 147 |
+
carb.log_info(f"{type(self).__name__}.on_stop()->{getattr(self, 'prim_path', '<unknown>')}")
|
| 148 |
+
pass
|
| 149 |
+
|
| 150 |
+
def on_update(self, current_time: float, delta_time: float):
|
| 151 |
+
if delta_time <= 0:
|
| 152 |
+
return
|
| 153 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 154 |
+
self.active_art()
|
| 155 |
+
self.apply_behavior()
|
| 156 |
+
|
| 157 |
+
def active_art(self):
|
| 158 |
+
# Find Root
|
| 159 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 160 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 161 |
+
print('the prim is not an articulation')
|
| 162 |
+
self.dc.wake_up_articulation(self.art)
|
| 163 |
+
|
| 164 |
+
# Find joint
|
| 165 |
+
self.joint_handles = []
|
| 166 |
+
for joint_name in joint_names:
|
| 167 |
+
self.joint_handles.append( self.dc.find_articulation_dof(self.art, joint_name))
|
| 168 |
+
# print("self.joint_handles",self.joint_handles)
|
| 169 |
+
def apply_behavior(self):
|
| 170 |
+
self.oven_control()
|
| 171 |
+
|
| 172 |
+
# def oven_control(self):
|
| 173 |
+
# self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 174 |
+
# self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 175 |
+
# # print("self.Joint0_state", self.Joint0_state)
|
| 176 |
+
# # print("self.Joint1_state", self.Joint1_state)
|
| 177 |
+
# # 按钮被按下且门处于锁定状态
|
| 178 |
+
# if self.Joint0_state < -0.001 and self.door_locked:
|
| 179 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-90))
|
| 180 |
+
# # if self.Joint1_state > math.radians(100):
|
| 181 |
+
# # self.door_locked = False # 解除锁定
|
| 182 |
+
|
| 183 |
+
# # 门开到30度后开灯,按钮归位s
|
| 184 |
+
# if self.Joint1_state < math.radians(-30) :
|
| 185 |
+
# self.door_locked = False # 解除锁定
|
| 186 |
+
# set_prim_visibility(light_scope_paths[0], True)
|
| 187 |
+
# self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 188 |
+
|
| 189 |
+
# # 检测手动关门
|
| 190 |
+
# if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 191 |
+
|
| 192 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 193 |
+
# self.door_locked = True
|
| 194 |
+
# if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 195 |
+
# # 锁定门
|
| 196 |
+
# self.door_locked = True
|
| 197 |
+
# set_prim_visibility(light_scope_paths[0], False) # 关闭灯
|
| 198 |
+
def oven_control(self):
|
| 199 |
+
|
| 200 |
+
self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 201 |
+
self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 202 |
+
# print("self.Joint0_state", self.Joint0_state)
|
| 203 |
+
# print("self.Joint1_state", self.Joint1_state)
|
| 204 |
+
# 按钮被按下且门处于锁定状态
|
| 205 |
+
if self.Joint0_state < -0.001 and self.door_locked:
|
| 206 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-50))
|
| 207 |
+
# if self.Joint1_state > math.radians(100):
|
| 208 |
+
# self.door_locked = False # 解除锁定
|
| 209 |
+
|
| 210 |
+
# 门开到30度后开灯,按钮归位s
|
| 211 |
+
if self.Joint1_state < math.radians(-30) :
|
| 212 |
+
self.door_locked = False # 解除锁定
|
| 213 |
+
set_prim_visibility(light_scope_paths[0], True)
|
| 214 |
+
self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 215 |
+
|
| 216 |
+
if abs(self.Joint1_state - math.radians(-50)) < math.radians(0.5) :
|
| 217 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-78))
|
| 218 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_min)
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
# 检测手动关门
|
| 222 |
+
if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 223 |
+
|
| 224 |
+
self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 225 |
+
self.door_locked = True
|
| 226 |
+
if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 227 |
+
# 锁定门
|
| 228 |
+
self.door_locked = True
|
| 229 |
+
set_prim_visibility(light_scope_paths[0], False) # 关闭灯
|
| 230 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_max)
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py.before_api_compat_fix_20260625_153709
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import carb
|
| 2 |
+
from omni.kit.scripting import BehaviorScript
|
| 3 |
+
from omni.isaac.dynamic_control import _dynamic_control
|
| 4 |
+
from enum import Enum
|
| 5 |
+
from pxr import Gf
|
| 6 |
+
from threading import Thread
|
| 7 |
+
import marshal,json
|
| 8 |
+
import omni.kit.commands
|
| 9 |
+
try:
|
| 10 |
+
from isaacsim.core.prims import XFormPrim
|
| 11 |
+
from isaacsim.core.api import SimulationContext, World
|
| 12 |
+
except ImportError:
|
| 13 |
+
from omni.isaac.core.prims import XFormPrim
|
| 14 |
+
from omni.isaac.core import SimulationContext, World
|
| 15 |
+
import numpy as np
|
| 16 |
+
from pxr import PhysxSchema, UsdGeom, UsdPhysics
|
| 17 |
+
import math
|
| 18 |
+
# stiffness :0.8 Damping: 0.05
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def find_prim_path_by_name(prim_name: str, root_path: str = "/") -> str:
|
| 22 |
+
"""Recursively find the full path by Prim name"""
|
| 23 |
+
stage = omni.usd.get_context().get_stage()
|
| 24 |
+
prim = stage.GetPrimAtPath(root_path)
|
| 25 |
+
|
| 26 |
+
def _find_prim(prim):
|
| 27 |
+
if prim.GetName() == prim_name:
|
| 28 |
+
return prim.GetPath().pathString
|
| 29 |
+
for child in prim.GetChildren():
|
| 30 |
+
result = _find_prim(child)
|
| 31 |
+
if result:
|
| 32 |
+
return result
|
| 33 |
+
return None
|
| 34 |
+
|
| 35 |
+
found_path = _find_prim(prim)
|
| 36 |
+
if not found_path:
|
| 37 |
+
raise RuntimeError(f"Prim '{prim_name}' not found under {root_path}")
|
| 38 |
+
return found_path
|
| 39 |
+
|
| 40 |
+
# # 1. prim init
|
| 41 |
+
# button_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Xform")
|
| 42 |
+
# door_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_door")
|
| 43 |
+
# # 2. articulation Root prim
|
| 44 |
+
# root_articulation_prim = "/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_base"
|
| 45 |
+
# # 3. joint name
|
| 46 |
+
# joint_names = ["PrismaticJoint", "RevoluteJoint"]
|
| 47 |
+
# # 4. joint num
|
| 48 |
+
# num_arm_dof = 2
|
| 49 |
+
|
| 50 |
+
# light_scopes=[XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on"),
|
| 51 |
+
# XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on_1"),
|
| 52 |
+
# ]
|
| 53 |
+
# for i in range(0, light_scopes.__len__()):
|
| 54 |
+
# light_scopes[i].set_visibility(False)
|
| 55 |
+
# index = random.randint(0, len(light_scopes)-1)
|
| 56 |
+
# light_scopes[index].set_visibility(True)
|
| 57 |
+
button_prim = XFormPrim(find_prim_path_by_name("oven_E_button_5"))
|
| 58 |
+
print("button_prim", button_prim.prim.GetPath().pathString)
|
| 59 |
+
# door_prim = XFormPrim(find_prim_path_by_name("oven_E_door_4"))
|
| 60 |
+
# print("door_prim", door_prim.prim_path)
|
| 61 |
+
root_articulation_prim = find_prim_path_by_name("oven_E_body_7")
|
| 62 |
+
print("root_articulation_prim", root_articulation_prim)
|
| 63 |
+
joint_names = ["PrismaticJoint_oven_down", "RevoluteJoint_oven_up"]
|
| 64 |
+
light_scopes=[XFormPrim(find_prim_path_by_name("oven_light"))
|
| 65 |
+
]
|
| 66 |
+
revolutejoint_path = find_prim_path_by_name("RevoluteJoint_oven_up")
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
class MicrowaveOverControl(BehaviorScript):
|
| 70 |
+
def on_init(self):
|
| 71 |
+
self.phsx_freq = 120
|
| 72 |
+
self.joint_handles = []
|
| 73 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 74 |
+
light_scopes[0].set_visibility(False)
|
| 75 |
+
self.Stiffness_max = 0.8
|
| 76 |
+
self.Stiffness_min = 0.08
|
| 77 |
+
|
| 78 |
+
# 初始化门的锁定状态
|
| 79 |
+
self.door_locked = True
|
| 80 |
+
|
| 81 |
+
# init_pose
|
| 82 |
+
self.local_pose_button, self.local_ort_drawer_down = button_prim.get_local_pose()
|
| 83 |
+
# self.local_pose_door, self.local_ort_drawer_up = door_prim.get_local_pose()
|
| 84 |
+
|
| 85 |
+
# Find Root
|
| 86 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 87 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 88 |
+
print('the prim is not an articulation')
|
| 89 |
+
stage = omni.usd.get_context().get_stage()
|
| 90 |
+
self.revoluteJoint_drive_path = stage.GetPrimAtPath(revolutejoint_path)
|
| 91 |
+
self.revoluteJoint_drive = UsdPhysics.DriveAPI.Get(self.revoluteJoint_drive_path, "angular")
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def on_destroy(self):
|
| 95 |
+
pass
|
| 96 |
+
|
| 97 |
+
def on_play(self):
|
| 98 |
+
self.simulation_context = SimulationContext(
|
| 99 |
+
stage_units_in_meters=1.0,
|
| 100 |
+
physics_dt=1.0/120,
|
| 101 |
+
rendering_dt=1.0/120
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def on_pause(self):
|
| 106 |
+
pass
|
| 107 |
+
|
| 108 |
+
def on_stop(self):
|
| 109 |
+
self.init_start=True
|
| 110 |
+
light_scopes[0].set_visibility(False)
|
| 111 |
+
# back to initial pose
|
| 112 |
+
# button_prim.set_local_pose(translation=self.local_pose_button)
|
| 113 |
+
# door_prim.set_local_pose(translation=self.local_pose_door)
|
| 114 |
+
self.door_locked = True
|
| 115 |
+
carb.log_info(f"{type(self).__name__}.on_stop()->{self.prim_path}")
|
| 116 |
+
pass
|
| 117 |
+
|
| 118 |
+
def on_update(self, current_time: float, delta_time: float):
|
| 119 |
+
if delta_time <= 0:
|
| 120 |
+
return
|
| 121 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 122 |
+
self.active_art()
|
| 123 |
+
self.apply_behavior()
|
| 124 |
+
|
| 125 |
+
def active_art(self):
|
| 126 |
+
# Find Root
|
| 127 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 128 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 129 |
+
print('the prim is not an articulation')
|
| 130 |
+
self.dc.wake_up_articulation(self.art)
|
| 131 |
+
|
| 132 |
+
# Find joint
|
| 133 |
+
self.joint_handles = []
|
| 134 |
+
for joint_name in joint_names:
|
| 135 |
+
self.joint_handles.append( self.dc.find_articulation_dof(self.art, joint_name))
|
| 136 |
+
# print("self.joint_handles",self.joint_handles)
|
| 137 |
+
def apply_behavior(self):
|
| 138 |
+
self.oven_control()
|
| 139 |
+
|
| 140 |
+
# def oven_control(self):
|
| 141 |
+
# self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 142 |
+
# self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 143 |
+
# # print("self.Joint0_state", self.Joint0_state)
|
| 144 |
+
# # print("self.Joint1_state", self.Joint1_state)
|
| 145 |
+
# # 按钮被按下且门处于锁定状态
|
| 146 |
+
# if self.Joint0_state < -0.001 and self.door_locked:
|
| 147 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-90))
|
| 148 |
+
# # if self.Joint1_state > math.radians(100):
|
| 149 |
+
# # self.door_locked = False # 解除锁定
|
| 150 |
+
|
| 151 |
+
# # 门开到30度后开灯,按钮归位s
|
| 152 |
+
# if self.Joint1_state < math.radians(-30) :
|
| 153 |
+
# self.door_locked = False # 解除锁定
|
| 154 |
+
# light_scopes[0].set_visibility(True)
|
| 155 |
+
# self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 156 |
+
|
| 157 |
+
# # 检测手动关门
|
| 158 |
+
# if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 159 |
+
|
| 160 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 161 |
+
# self.door_locked = True
|
| 162 |
+
# if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 163 |
+
# # 锁定门
|
| 164 |
+
# self.door_locked = True
|
| 165 |
+
# light_scopes[0].set_visibility(False) # 关闭灯
|
| 166 |
+
def oven_control(self):
|
| 167 |
+
|
| 168 |
+
self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 169 |
+
self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 170 |
+
# print("self.Joint0_state", self.Joint0_state)
|
| 171 |
+
# print("self.Joint1_state", self.Joint1_state)
|
| 172 |
+
# 按钮被按下且门处于锁定状态
|
| 173 |
+
if self.Joint0_state < -0.001 and self.door_locked:
|
| 174 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-50))
|
| 175 |
+
# if self.Joint1_state > math.radians(100):
|
| 176 |
+
# self.door_locked = False # 解除锁定
|
| 177 |
+
|
| 178 |
+
# 门开到30度后开灯,按钮归位s
|
| 179 |
+
if self.Joint1_state < math.radians(-30) :
|
| 180 |
+
self.door_locked = False # 解除锁定
|
| 181 |
+
light_scopes[0].set_visibility(True)
|
| 182 |
+
self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 183 |
+
|
| 184 |
+
if abs(self.Joint1_state - math.radians(-50)) < math.radians(0.5) :
|
| 185 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-78))
|
| 186 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_min)
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
# 检测手动关门
|
| 190 |
+
if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 191 |
+
|
| 192 |
+
self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 193 |
+
self.door_locked = True
|
| 194 |
+
if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 195 |
+
# 锁定门
|
| 196 |
+
self.door_locked = True
|
| 197 |
+
light_scopes[0].set_visibility(False) # 关闭灯
|
| 198 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_max)
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py.before_pose_fix_20260625_185057
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import carb
|
| 2 |
+
from omni.kit.scripting import BehaviorScript
|
| 3 |
+
from omni.isaac.dynamic_control import _dynamic_control
|
| 4 |
+
from enum import Enum
|
| 5 |
+
from pxr import Gf
|
| 6 |
+
from threading import Thread
|
| 7 |
+
import marshal,json
|
| 8 |
+
import omni.kit.commands
|
| 9 |
+
try:
|
| 10 |
+
from isaacsim.core.prims import XFormPrim
|
| 11 |
+
from isaacsim.core.api import SimulationContext, World
|
| 12 |
+
except ImportError:
|
| 13 |
+
from omni.isaac.core.prims import XFormPrim
|
| 14 |
+
from omni.isaac.core import SimulationContext, World
|
| 15 |
+
import numpy as np
|
| 16 |
+
from pxr import PhysxSchema, UsdGeom, UsdPhysics
|
| 17 |
+
import math
|
| 18 |
+
# stiffness :0.8 Damping: 0.05
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def set_prim_visibility(prim_path: str, visible: bool) -> None:
|
| 24 |
+
stage = omni.usd.get_context().get_stage()
|
| 25 |
+
prim = stage.GetPrimAtPath(prim_path)
|
| 26 |
+
if not prim:
|
| 27 |
+
carb.log_warn(f"Visibility target not found: {prim_path}")
|
| 28 |
+
return
|
| 29 |
+
imageable = UsdGeom.Imageable(prim)
|
| 30 |
+
if visible:
|
| 31 |
+
imageable.MakeVisible()
|
| 32 |
+
else:
|
| 33 |
+
imageable.MakeInvisible()
|
| 34 |
+
|
| 35 |
+
def find_prim_path_by_name(prim_name: str, root_path: str = "/") -> str:
|
| 36 |
+
"""Recursively find the full path by Prim name"""
|
| 37 |
+
stage = omni.usd.get_context().get_stage()
|
| 38 |
+
prim = stage.GetPrimAtPath(root_path)
|
| 39 |
+
|
| 40 |
+
def _find_prim(prim):
|
| 41 |
+
if prim.GetName() == prim_name:
|
| 42 |
+
return prim.GetPath().pathString
|
| 43 |
+
for child in prim.GetChildren():
|
| 44 |
+
result = _find_prim(child)
|
| 45 |
+
if result:
|
| 46 |
+
return result
|
| 47 |
+
return None
|
| 48 |
+
|
| 49 |
+
found_path = _find_prim(prim)
|
| 50 |
+
if not found_path:
|
| 51 |
+
raise RuntimeError(f"Prim '{prim_name}' not found under {root_path}")
|
| 52 |
+
return found_path
|
| 53 |
+
|
| 54 |
+
# # 1. prim init
|
| 55 |
+
# button_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Xform")
|
| 56 |
+
# door_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_door")
|
| 57 |
+
# # 2. articulation Root prim
|
| 58 |
+
# root_articulation_prim = "/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_base"
|
| 59 |
+
# # 3. joint name
|
| 60 |
+
# joint_names = ["PrismaticJoint", "RevoluteJoint"]
|
| 61 |
+
# # 4. joint num
|
| 62 |
+
# num_arm_dof = 2
|
| 63 |
+
|
| 64 |
+
# light_scopes=[XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on"),
|
| 65 |
+
# XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on_1"),
|
| 66 |
+
# ]
|
| 67 |
+
# for i in range(0, light_scopes.__len__()):
|
| 68 |
+
# light_scopes[i].set_visibility(False)
|
| 69 |
+
# index = random.randint(0, len(light_scopes)-1)
|
| 70 |
+
# light_scopes[index].set_visibility(True)
|
| 71 |
+
button_prim_path = find_prim_path_by_name("oven_E_button_5")
|
| 72 |
+
button_prim = XFormPrim(button_prim_path)
|
| 73 |
+
print("button_prim", button_prim_path)
|
| 74 |
+
# door_prim = XFormPrim(find_prim_path_by_name("oven_E_door_4"))
|
| 75 |
+
# print("door_prim", door_prim.prim_path)
|
| 76 |
+
root_articulation_prim = find_prim_path_by_name("oven_E_body_7")
|
| 77 |
+
print("root_articulation_prim", root_articulation_prim)
|
| 78 |
+
joint_names = ["PrismaticJoint_oven_down", "RevoluteJoint_oven_up"]
|
| 79 |
+
light_scope_paths = [find_prim_path_by_name("oven_light")]
|
| 80 |
+
light_scopes = [XFormPrim(path) for path in light_scope_paths]
|
| 81 |
+
revolutejoint_path = find_prim_path_by_name("RevoluteJoint_oven_up")
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
class MicrowaveOverControl(BehaviorScript):
|
| 85 |
+
def on_init(self):
|
| 86 |
+
self.phsx_freq = 120
|
| 87 |
+
self.joint_handles = []
|
| 88 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 89 |
+
set_prim_visibility(light_scope_paths[0], False)
|
| 90 |
+
self.Stiffness_max = 0.8
|
| 91 |
+
self.Stiffness_min = 0.08
|
| 92 |
+
|
| 93 |
+
# 初始化门的锁定状态
|
| 94 |
+
self.door_locked = True
|
| 95 |
+
|
| 96 |
+
# init_pose
|
| 97 |
+
self.local_pose_button, self.local_ort_drawer_down = button_prim.get_local_pose()
|
| 98 |
+
# self.local_pose_door, self.local_ort_drawer_up = door_prim.get_local_pose()
|
| 99 |
+
|
| 100 |
+
# Find Root
|
| 101 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 102 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 103 |
+
print('the prim is not an articulation')
|
| 104 |
+
stage = omni.usd.get_context().get_stage()
|
| 105 |
+
self.revoluteJoint_drive_path = stage.GetPrimAtPath(revolutejoint_path)
|
| 106 |
+
self.revoluteJoint_drive = UsdPhysics.DriveAPI.Get(self.revoluteJoint_drive_path, "angular")
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
def on_destroy(self):
|
| 110 |
+
pass
|
| 111 |
+
|
| 112 |
+
def on_play(self):
|
| 113 |
+
self.simulation_context = SimulationContext(
|
| 114 |
+
stage_units_in_meters=1.0,
|
| 115 |
+
physics_dt=1.0/120,
|
| 116 |
+
rendering_dt=1.0/120
|
| 117 |
+
)
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def on_pause(self):
|
| 121 |
+
pass
|
| 122 |
+
|
| 123 |
+
def on_stop(self):
|
| 124 |
+
self.init_start=True
|
| 125 |
+
set_prim_visibility(light_scope_paths[0], False)
|
| 126 |
+
# back to initial pose
|
| 127 |
+
# button_prim.set_local_pose(translation=self.local_pose_button)
|
| 128 |
+
# door_prim.set_local_pose(translation=self.local_pose_door)
|
| 129 |
+
self.door_locked = True
|
| 130 |
+
carb.log_info(f"{type(self).__name__}.on_stop()->{getattr(self, 'prim_path', '<unknown>')}")
|
| 131 |
+
pass
|
| 132 |
+
|
| 133 |
+
def on_update(self, current_time: float, delta_time: float):
|
| 134 |
+
if delta_time <= 0:
|
| 135 |
+
return
|
| 136 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 137 |
+
self.active_art()
|
| 138 |
+
self.apply_behavior()
|
| 139 |
+
|
| 140 |
+
def active_art(self):
|
| 141 |
+
# Find Root
|
| 142 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 143 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 144 |
+
print('the prim is not an articulation')
|
| 145 |
+
self.dc.wake_up_articulation(self.art)
|
| 146 |
+
|
| 147 |
+
# Find joint
|
| 148 |
+
self.joint_handles = []
|
| 149 |
+
for joint_name in joint_names:
|
| 150 |
+
self.joint_handles.append( self.dc.find_articulation_dof(self.art, joint_name))
|
| 151 |
+
# print("self.joint_handles",self.joint_handles)
|
| 152 |
+
def apply_behavior(self):
|
| 153 |
+
self.oven_control()
|
| 154 |
+
|
| 155 |
+
# def oven_control(self):
|
| 156 |
+
# self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 157 |
+
# self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 158 |
+
# # print("self.Joint0_state", self.Joint0_state)
|
| 159 |
+
# # print("self.Joint1_state", self.Joint1_state)
|
| 160 |
+
# # 按钮被按下且门处于锁定状态
|
| 161 |
+
# if self.Joint0_state < -0.001 and self.door_locked:
|
| 162 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-90))
|
| 163 |
+
# # if self.Joint1_state > math.radians(100):
|
| 164 |
+
# # self.door_locked = False # 解除锁定
|
| 165 |
+
|
| 166 |
+
# # 门开到30度后开灯,按钮归位s
|
| 167 |
+
# if self.Joint1_state < math.radians(-30) :
|
| 168 |
+
# self.door_locked = False # 解除锁定
|
| 169 |
+
# set_prim_visibility(light_scope_paths[0], True)
|
| 170 |
+
# self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 171 |
+
|
| 172 |
+
# # 检测手动关门
|
| 173 |
+
# if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 174 |
+
|
| 175 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 176 |
+
# self.door_locked = True
|
| 177 |
+
# if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 178 |
+
# # 锁定门
|
| 179 |
+
# self.door_locked = True
|
| 180 |
+
# set_prim_visibility(light_scope_paths[0], False) # 关闭灯
|
| 181 |
+
def oven_control(self):
|
| 182 |
+
|
| 183 |
+
self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 184 |
+
self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 185 |
+
# print("self.Joint0_state", self.Joint0_state)
|
| 186 |
+
# print("self.Joint1_state", self.Joint1_state)
|
| 187 |
+
# 按钮被按下且门处于锁定状态
|
| 188 |
+
if self.Joint0_state < -0.001 and self.door_locked:
|
| 189 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-50))
|
| 190 |
+
# if self.Joint1_state > math.radians(100):
|
| 191 |
+
# self.door_locked = False # 解除锁定
|
| 192 |
+
|
| 193 |
+
# 门开到30度后开灯,按钮归位s
|
| 194 |
+
if self.Joint1_state < math.radians(-30) :
|
| 195 |
+
self.door_locked = False # 解除锁定
|
| 196 |
+
set_prim_visibility(light_scope_paths[0], True)
|
| 197 |
+
self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 198 |
+
|
| 199 |
+
if abs(self.Joint1_state - math.radians(-50)) < math.radians(0.5) :
|
| 200 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-78))
|
| 201 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_min)
|
| 202 |
+
|
| 203 |
+
|
| 204 |
+
# 检测手动关门
|
| 205 |
+
if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 206 |
+
|
| 207 |
+
self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 208 |
+
self.door_locked = True
|
| 209 |
+
if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 210 |
+
# 锁定门
|
| 211 |
+
self.door_locked = True
|
| 212 |
+
set_prim_visibility(light_scope_paths[0], False) # 关闭灯
|
| 213 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_max)
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py.before_prim_path_fix_20260625_153054
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import carb
|
| 2 |
+
from omni.kit.scripting import BehaviorScript
|
| 3 |
+
from omni.isaac.dynamic_control import _dynamic_control
|
| 4 |
+
from enum import Enum
|
| 5 |
+
from pxr import Gf
|
| 6 |
+
from threading import Thread
|
| 7 |
+
import marshal,json
|
| 8 |
+
import omni.kit.commands
|
| 9 |
+
try:
|
| 10 |
+
from isaacsim.core.prims import XFormPrim
|
| 11 |
+
from isaacsim.core.api import SimulationContext, World
|
| 12 |
+
except ImportError:
|
| 13 |
+
from omni.isaac.core.prims import XFormPrim
|
| 14 |
+
from omni.isaac.core import SimulationContext, World
|
| 15 |
+
import numpy as np
|
| 16 |
+
from pxr import PhysxSchema, UsdGeom, UsdPhysics
|
| 17 |
+
import math
|
| 18 |
+
# stiffness :0.8 Damping: 0.05
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def find_prim_path_by_name(prim_name: str, root_path: str = "/") -> str:
|
| 22 |
+
"""Recursively find the full path by Prim name"""
|
| 23 |
+
stage = omni.usd.get_context().get_stage()
|
| 24 |
+
prim = stage.GetPrimAtPath(root_path)
|
| 25 |
+
|
| 26 |
+
def _find_prim(prim):
|
| 27 |
+
if prim.GetName() == prim_name:
|
| 28 |
+
return prim.GetPath().pathString
|
| 29 |
+
for child in prim.GetChildren():
|
| 30 |
+
result = _find_prim(child)
|
| 31 |
+
if result:
|
| 32 |
+
return result
|
| 33 |
+
return None
|
| 34 |
+
|
| 35 |
+
found_path = _find_prim(prim)
|
| 36 |
+
if not found_path:
|
| 37 |
+
raise RuntimeError(f"Prim '{prim_name}' not found under {root_path}")
|
| 38 |
+
return found_path
|
| 39 |
+
|
| 40 |
+
# # 1. prim init
|
| 41 |
+
# button_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Xform")
|
| 42 |
+
# door_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_door")
|
| 43 |
+
# # 2. articulation Root prim
|
| 44 |
+
# root_articulation_prim = "/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_base"
|
| 45 |
+
# # 3. joint name
|
| 46 |
+
# joint_names = ["PrismaticJoint", "RevoluteJoint"]
|
| 47 |
+
# # 4. joint num
|
| 48 |
+
# num_arm_dof = 2
|
| 49 |
+
|
| 50 |
+
# light_scopes=[XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on"),
|
| 51 |
+
# XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on_1"),
|
| 52 |
+
# ]
|
| 53 |
+
# for i in range(0, light_scopes.__len__()):
|
| 54 |
+
# light_scopes[i].set_visibility(False)
|
| 55 |
+
# index = random.randint(0, len(light_scopes)-1)
|
| 56 |
+
# light_scopes[index].set_visibility(True)
|
| 57 |
+
button_prim = XFormPrim(find_prim_path_by_name("oven_E_button_5"))
|
| 58 |
+
print("button_prim", button_prim.prim_path)
|
| 59 |
+
# door_prim = XFormPrim(find_prim_path_by_name("oven_E_door_4"))
|
| 60 |
+
# print("door_prim", door_prim.prim_path)
|
| 61 |
+
root_articulation_prim = find_prim_path_by_name("oven_E_body_7")
|
| 62 |
+
print("root_articulation_prim", root_articulation_prim)
|
| 63 |
+
joint_names = ["PrismaticJoint_oven_down", "RevoluteJoint_oven_up"]
|
| 64 |
+
light_scopes=[XFormPrim(find_prim_path_by_name("oven_light"))
|
| 65 |
+
]
|
| 66 |
+
revolutejoint_path = find_prim_path_by_name("RevoluteJoint_oven_up")
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
class MicrowaveOverControl(BehaviorScript):
|
| 70 |
+
def on_init(self):
|
| 71 |
+
self.phsx_freq = 120
|
| 72 |
+
self.joint_handles = []
|
| 73 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 74 |
+
light_scopes[0].set_visibility(False)
|
| 75 |
+
self.Stiffness_max = 0.8
|
| 76 |
+
self.Stiffness_min = 0.08
|
| 77 |
+
|
| 78 |
+
# 初始化门的锁定状态
|
| 79 |
+
self.door_locked = True
|
| 80 |
+
|
| 81 |
+
# init_pose
|
| 82 |
+
self.local_pose_button, self.local_ort_drawer_down = button_prim.get_local_pose()
|
| 83 |
+
# self.local_pose_door, self.local_ort_drawer_up = door_prim.get_local_pose()
|
| 84 |
+
|
| 85 |
+
# Find Root
|
| 86 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 87 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 88 |
+
print('the prim is not an articulation')
|
| 89 |
+
stage = omni.usd.get_context().get_stage()
|
| 90 |
+
self.revoluteJoint_drive_path = stage.GetPrimAtPath(revolutejoint_path)
|
| 91 |
+
self.revoluteJoint_drive = UsdPhysics.DriveAPI.Get(self.revoluteJoint_drive_path, "angular")
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def on_destroy(self):
|
| 95 |
+
pass
|
| 96 |
+
|
| 97 |
+
def on_play(self):
|
| 98 |
+
self.simulation_context = SimulationContext(
|
| 99 |
+
stage_units_in_meters=1.0,
|
| 100 |
+
physics_dt=1.0/120,
|
| 101 |
+
rendering_dt=1.0/120
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def on_pause(self):
|
| 106 |
+
pass
|
| 107 |
+
|
| 108 |
+
def on_stop(self):
|
| 109 |
+
self.init_start=True
|
| 110 |
+
light_scopes[0].set_visibility(False)
|
| 111 |
+
# back to initial pose
|
| 112 |
+
# button_prim.set_local_pose(translation=self.local_pose_button)
|
| 113 |
+
# door_prim.set_local_pose(translation=self.local_pose_door)
|
| 114 |
+
self.door_locked = True
|
| 115 |
+
carb.log_info(f"{type(self).__name__}.on_stop()->{self.prim_path}")
|
| 116 |
+
pass
|
| 117 |
+
|
| 118 |
+
def on_update(self, current_time: float, delta_time: float):
|
| 119 |
+
if delta_time <= 0:
|
| 120 |
+
return
|
| 121 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 122 |
+
self.active_art()
|
| 123 |
+
self.apply_behavior()
|
| 124 |
+
|
| 125 |
+
def active_art(self):
|
| 126 |
+
# Find Root
|
| 127 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 128 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 129 |
+
print('the prim is not an articulation')
|
| 130 |
+
self.dc.wake_up_articulation(self.art)
|
| 131 |
+
|
| 132 |
+
# Find joint
|
| 133 |
+
self.joint_handles = []
|
| 134 |
+
for joint_name in joint_names:
|
| 135 |
+
self.joint_handles.append( self.dc.find_articulation_dof(self.art, joint_name))
|
| 136 |
+
# print("self.joint_handles",self.joint_handles)
|
| 137 |
+
def apply_behavior(self):
|
| 138 |
+
self.oven_control()
|
| 139 |
+
|
| 140 |
+
# def oven_control(self):
|
| 141 |
+
# self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 142 |
+
# self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 143 |
+
# # print("self.Joint0_state", self.Joint0_state)
|
| 144 |
+
# # print("self.Joint1_state", self.Joint1_state)
|
| 145 |
+
# # 按钮被按下且门处于锁定状态
|
| 146 |
+
# if self.Joint0_state < -0.001 and self.door_locked:
|
| 147 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-90))
|
| 148 |
+
# # if self.Joint1_state > math.radians(100):
|
| 149 |
+
# # self.door_locked = False # 解除锁定
|
| 150 |
+
|
| 151 |
+
# # 门开到30度后开灯,按钮归位s
|
| 152 |
+
# if self.Joint1_state < math.radians(-30) :
|
| 153 |
+
# self.door_locked = False # 解除锁定
|
| 154 |
+
# light_scopes[0].set_visibility(True)
|
| 155 |
+
# self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 156 |
+
|
| 157 |
+
# # 检测手动关门
|
| 158 |
+
# if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 159 |
+
|
| 160 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 161 |
+
# self.door_locked = True
|
| 162 |
+
# if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 163 |
+
# # 锁定门
|
| 164 |
+
# self.door_locked = True
|
| 165 |
+
# light_scopes[0].set_visibility(False) # 关闭灯
|
| 166 |
+
def oven_control(self):
|
| 167 |
+
|
| 168 |
+
self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 169 |
+
self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 170 |
+
# print("self.Joint0_state", self.Joint0_state)
|
| 171 |
+
# print("self.Joint1_state", self.Joint1_state)
|
| 172 |
+
# 按钮被按下且门处于锁定状态
|
| 173 |
+
if self.Joint0_state < -0.001 and self.door_locked:
|
| 174 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-50))
|
| 175 |
+
# if self.Joint1_state > math.radians(100):
|
| 176 |
+
# self.door_locked = False # 解除锁定
|
| 177 |
+
|
| 178 |
+
# 门开到30度后开灯,按钮归位s
|
| 179 |
+
if self.Joint1_state < math.radians(-30) :
|
| 180 |
+
self.door_locked = False # 解除锁定
|
| 181 |
+
light_scopes[0].set_visibility(True)
|
| 182 |
+
self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 183 |
+
|
| 184 |
+
if abs(self.Joint1_state - math.radians(-50)) < math.radians(0.5) :
|
| 185 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-78))
|
| 186 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_min)
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
# 检测手动关门
|
| 190 |
+
if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 191 |
+
|
| 192 |
+
self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 193 |
+
self.door_locked = True
|
| 194 |
+
if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 195 |
+
# 锁定门
|
| 196 |
+
self.door_locked = True
|
| 197 |
+
light_scopes[0].set_visibility(False) # 关闭灯
|
| 198 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_max)
|
usd_models/dry_kitchen.e2/assets/scripted/microwave/scripts/oven_control.py.before_visibility_fix_20260625_154604
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import carb
|
| 2 |
+
from omni.kit.scripting import BehaviorScript
|
| 3 |
+
from omni.isaac.dynamic_control import _dynamic_control
|
| 4 |
+
from enum import Enum
|
| 5 |
+
from pxr import Gf
|
| 6 |
+
from threading import Thread
|
| 7 |
+
import marshal,json
|
| 8 |
+
import omni.kit.commands
|
| 9 |
+
try:
|
| 10 |
+
from isaacsim.core.prims import XFormPrim
|
| 11 |
+
from isaacsim.core.api import SimulationContext, World
|
| 12 |
+
except ImportError:
|
| 13 |
+
from omni.isaac.core.prims import XFormPrim
|
| 14 |
+
from omni.isaac.core import SimulationContext, World
|
| 15 |
+
import numpy as np
|
| 16 |
+
from pxr import PhysxSchema, UsdGeom, UsdPhysics
|
| 17 |
+
import math
|
| 18 |
+
# stiffness :0.8 Damping: 0.05
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def find_prim_path_by_name(prim_name: str, root_path: str = "/") -> str:
|
| 22 |
+
"""Recursively find the full path by Prim name"""
|
| 23 |
+
stage = omni.usd.get_context().get_stage()
|
| 24 |
+
prim = stage.GetPrimAtPath(root_path)
|
| 25 |
+
|
| 26 |
+
def _find_prim(prim):
|
| 27 |
+
if prim.GetName() == prim_name:
|
| 28 |
+
return prim.GetPath().pathString
|
| 29 |
+
for child in prim.GetChildren():
|
| 30 |
+
result = _find_prim(child)
|
| 31 |
+
if result:
|
| 32 |
+
return result
|
| 33 |
+
return None
|
| 34 |
+
|
| 35 |
+
found_path = _find_prim(prim)
|
| 36 |
+
if not found_path:
|
| 37 |
+
raise RuntimeError(f"Prim '{prim_name}' not found under {root_path}")
|
| 38 |
+
return found_path
|
| 39 |
+
|
| 40 |
+
# # 1. prim init
|
| 41 |
+
# button_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Xform")
|
| 42 |
+
# door_prim = XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_door")
|
| 43 |
+
# # 2. articulation Root prim
|
| 44 |
+
# root_articulation_prim = "/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/oven/oven_base"
|
| 45 |
+
# # 3. joint name
|
| 46 |
+
# joint_names = ["PrismaticJoint", "RevoluteJoint"]
|
| 47 |
+
# # 4. joint num
|
| 48 |
+
# num_arm_dof = 2
|
| 49 |
+
|
| 50 |
+
# light_scopes=[XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on"),
|
| 51 |
+
# XFormPrim("/sm_warehouse_a01_h10m_cornerout_01/micro_wave_oven_2/Lights_on_1"),
|
| 52 |
+
# ]
|
| 53 |
+
# for i in range(0, light_scopes.__len__()):
|
| 54 |
+
# light_scopes[i].set_visibility(False)
|
| 55 |
+
# index = random.randint(0, len(light_scopes)-1)
|
| 56 |
+
# light_scopes[index].set_visibility(True)
|
| 57 |
+
button_prim_path = find_prim_path_by_name("oven_E_button_5")
|
| 58 |
+
button_prim = XFormPrim(button_prim_path)
|
| 59 |
+
print("button_prim", button_prim_path)
|
| 60 |
+
# door_prim = XFormPrim(find_prim_path_by_name("oven_E_door_4"))
|
| 61 |
+
# print("door_prim", door_prim.prim_path)
|
| 62 |
+
root_articulation_prim = find_prim_path_by_name("oven_E_body_7")
|
| 63 |
+
print("root_articulation_prim", root_articulation_prim)
|
| 64 |
+
joint_names = ["PrismaticJoint_oven_down", "RevoluteJoint_oven_up"]
|
| 65 |
+
light_scopes=[XFormPrim(find_prim_path_by_name("oven_light"))
|
| 66 |
+
]
|
| 67 |
+
revolutejoint_path = find_prim_path_by_name("RevoluteJoint_oven_up")
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
class MicrowaveOverControl(BehaviorScript):
|
| 71 |
+
def on_init(self):
|
| 72 |
+
self.phsx_freq = 120
|
| 73 |
+
self.joint_handles = []
|
| 74 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 75 |
+
light_scopes[0].set_visibility(False)
|
| 76 |
+
self.Stiffness_max = 0.8
|
| 77 |
+
self.Stiffness_min = 0.08
|
| 78 |
+
|
| 79 |
+
# 初始化门的锁定状态
|
| 80 |
+
self.door_locked = True
|
| 81 |
+
|
| 82 |
+
# init_pose
|
| 83 |
+
self.local_pose_button, self.local_ort_drawer_down = button_prim.get_local_pose()
|
| 84 |
+
# self.local_pose_door, self.local_ort_drawer_up = door_prim.get_local_pose()
|
| 85 |
+
|
| 86 |
+
# Find Root
|
| 87 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 88 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 89 |
+
print('the prim is not an articulation')
|
| 90 |
+
stage = omni.usd.get_context().get_stage()
|
| 91 |
+
self.revoluteJoint_drive_path = stage.GetPrimAtPath(revolutejoint_path)
|
| 92 |
+
self.revoluteJoint_drive = UsdPhysics.DriveAPI.Get(self.revoluteJoint_drive_path, "angular")
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
def on_destroy(self):
|
| 96 |
+
pass
|
| 97 |
+
|
| 98 |
+
def on_play(self):
|
| 99 |
+
self.simulation_context = SimulationContext(
|
| 100 |
+
stage_units_in_meters=1.0,
|
| 101 |
+
physics_dt=1.0/120,
|
| 102 |
+
rendering_dt=1.0/120
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
def on_pause(self):
|
| 107 |
+
pass
|
| 108 |
+
|
| 109 |
+
def on_stop(self):
|
| 110 |
+
self.init_start=True
|
| 111 |
+
light_scopes[0].set_visibility(False)
|
| 112 |
+
# back to initial pose
|
| 113 |
+
# button_prim.set_local_pose(translation=self.local_pose_button)
|
| 114 |
+
# door_prim.set_local_pose(translation=self.local_pose_door)
|
| 115 |
+
self.door_locked = True
|
| 116 |
+
carb.log_info(f"{type(self).__name__}.on_stop()->{getattr(self, 'prim_path', '<unknown>')}")
|
| 117 |
+
pass
|
| 118 |
+
|
| 119 |
+
def on_update(self, current_time: float, delta_time: float):
|
| 120 |
+
if delta_time <= 0:
|
| 121 |
+
return
|
| 122 |
+
self.dc = _dynamic_control.acquire_dynamic_control_interface()
|
| 123 |
+
self.active_art()
|
| 124 |
+
self.apply_behavior()
|
| 125 |
+
|
| 126 |
+
def active_art(self):
|
| 127 |
+
# Find Root
|
| 128 |
+
self.art = self.dc.get_articulation(root_articulation_prim)
|
| 129 |
+
if self.art == _dynamic_control.INVALID_HANDLE:
|
| 130 |
+
print('the prim is not an articulation')
|
| 131 |
+
self.dc.wake_up_articulation(self.art)
|
| 132 |
+
|
| 133 |
+
# Find joint
|
| 134 |
+
self.joint_handles = []
|
| 135 |
+
for joint_name in joint_names:
|
| 136 |
+
self.joint_handles.append( self.dc.find_articulation_dof(self.art, joint_name))
|
| 137 |
+
# print("self.joint_handles",self.joint_handles)
|
| 138 |
+
def apply_behavior(self):
|
| 139 |
+
self.oven_control()
|
| 140 |
+
|
| 141 |
+
# def oven_control(self):
|
| 142 |
+
# self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 143 |
+
# self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 144 |
+
# # print("self.Joint0_state", self.Joint0_state)
|
| 145 |
+
# # print("self.Joint1_state", self.Joint1_state)
|
| 146 |
+
# # 按钮被按下且门处于锁定状态
|
| 147 |
+
# if self.Joint0_state < -0.001 and self.door_locked:
|
| 148 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-90))
|
| 149 |
+
# # if self.Joint1_state > math.radians(100):
|
| 150 |
+
# # self.door_locked = False # 解除锁定
|
| 151 |
+
|
| 152 |
+
# # 门开到30度后开灯,按钮归位s
|
| 153 |
+
# if self.Joint1_state < math.radians(-30) :
|
| 154 |
+
# self.door_locked = False # 解除锁定
|
| 155 |
+
# light_scopes[0].set_visibility(True)
|
| 156 |
+
# self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 157 |
+
|
| 158 |
+
# # 检测手动关门
|
| 159 |
+
# if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 160 |
+
|
| 161 |
+
# self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 162 |
+
# self.door_locked = True
|
| 163 |
+
# if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 164 |
+
# # 锁定门
|
| 165 |
+
# self.door_locked = True
|
| 166 |
+
# light_scopes[0].set_visibility(False) # 关闭灯
|
| 167 |
+
def oven_control(self):
|
| 168 |
+
|
| 169 |
+
self.Joint0_state = self.dc.get_dof_state(self.joint_handles[0], _dynamic_control.STATE_ALL).pos
|
| 170 |
+
self.Joint1_state = self.dc.get_dof_state(self.joint_handles[1], _dynamic_control.STATE_ALL).pos
|
| 171 |
+
# print("self.Joint0_state", self.Joint0_state)
|
| 172 |
+
# print("self.Joint1_state", self.Joint1_state)
|
| 173 |
+
# 按钮被按下且门处于锁定状态
|
| 174 |
+
if self.Joint0_state < -0.001 and self.door_locked:
|
| 175 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-50))
|
| 176 |
+
# if self.Joint1_state > math.radians(100):
|
| 177 |
+
# self.door_locked = False # 解除锁定
|
| 178 |
+
|
| 179 |
+
# 门开到30度后开灯,按钮归位s
|
| 180 |
+
if self.Joint1_state < math.radians(-30) :
|
| 181 |
+
self.door_locked = False # 解除锁定
|
| 182 |
+
light_scopes[0].set_visibility(True)
|
| 183 |
+
self.dc.set_dof_position_target(self.joint_handles[0], 0)
|
| 184 |
+
|
| 185 |
+
if abs(self.Joint1_state - math.radians(-50)) < math.radians(0.5) :
|
| 186 |
+
self.dc.set_dof_position_target(self.joint_handles[1], math.radians(-78))
|
| 187 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_min)
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
# 检测手动关门
|
| 191 |
+
if self.Joint1_state > math.radians(-20) and not self.door_locked: # 当门接近关闭位置时
|
| 192 |
+
|
| 193 |
+
self.dc.set_dof_position_target(self.joint_handles[1], 0) # 设置目标位置为0
|
| 194 |
+
self.door_locked = True
|
| 195 |
+
if self.Joint1_state < math.radians(5): # 当门完全关闭时
|
| 196 |
+
# 锁定门
|
| 197 |
+
self.door_locked = True
|
| 198 |
+
light_scopes[0].set_visibility(False) # 关闭灯
|
| 199 |
+
self.revoluteJoint_drive.GetStiffnessAttr().Set(self.Stiffness_max)
|
usd_models/dry_kitchen.e2/backgrounds/Environment.usd
ADDED
|
Binary file (1.67 kB). View file
|
|
|
usd_models/dry_kitchen.e2/backgrounds/kitchen_background.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f3c196de65ae5a8b9f76482a33a33f2226048847b15dcc8e7405b288a4a6e12f
|
| 3 |
+
size 317560
|
usd_models/dry_kitchen.e2/backgrounds/kitchen_background.usd.before_door_visual_only_20260701_1603
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e65341240736ab7770b139e227f92ba8d7b3281be246918edea32eb95690bc22
|
| 3 |
+
size 227692
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Clear_Glass.mdl
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.3;
|
| 2 |
+
|
| 3 |
+
import ::OmniGlass::OmniGlass;
|
| 4 |
+
import ::tex::gamma_mode;
|
| 5 |
+
import ::state::normal;
|
| 6 |
+
|
| 7 |
+
export material Clear_Glass(*)
|
| 8 |
+
= OmniGlass::OmniGlass(
|
| 9 |
+
absorption_coeff: color(1.f, 1.f, 1.f),
|
| 10 |
+
glass_color: color(1.f, 1.f, 1.f),
|
| 11 |
+
use_glass_color_texture: false,
|
| 12 |
+
glass_color_texture: texture_2d(),
|
| 13 |
+
frosting_roughness: 0.f,
|
| 14 |
+
glass_ior: 1.52f,
|
| 15 |
+
thin_walled: true,
|
| 16 |
+
project_uvw: false,
|
| 17 |
+
world_or_object: false,
|
| 18 |
+
uv_space_index: 0,
|
| 19 |
+
texture_translate: float2(0.f),
|
| 20 |
+
texture_rotate: 0.f,
|
| 21 |
+
texture_scale: float2(1.f));
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
mdl 1.5;
|
| 25 |
+
|
| 26 |
+
import ::Library::AEC::Materials::Templates::GlassWithVolume::GlassWithVolume;
|
| 27 |
+
import ::tex::gamma_mode;
|
| 28 |
+
import ::state::normal;
|
| 29 |
+
|
| 30 |
+
export material Clear_Glass(*)
|
| 31 |
+
= ::Library::AEC::Materials::Templates::GlassWithVolume::GlassWithVolume(
|
| 32 |
+
thin_walled: true,
|
| 33 |
+
transmission_color: color(1.f, 1.f, 1.f),
|
| 34 |
+
roughness_texture: texture_2d(),
|
| 35 |
+
ior: 1.52f,
|
| 36 |
+
transmission_color_texture: texture_2d(),
|
| 37 |
+
roughness_texture_influence: 0.f,
|
| 38 |
+
roughness: 0.f,
|
| 39 |
+
reflection_color_texture: texture_2d(),
|
| 40 |
+
reflection_color: color(1.f, 1.f, 1.f),
|
| 41 |
+
depth: 0.0001f,
|
| 42 |
+
normal_map_texture: texture_2d());
|
| 43 |
+
*/
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Tinted_Glass_R02.mdl
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.5;
|
| 2 |
+
|
| 3 |
+
using ..::Templates::GlassWithVolume import GlassWithVolume;
|
| 4 |
+
import ::tex::gamma_mode;
|
| 5 |
+
import ::state::normal;
|
| 6 |
+
|
| 7 |
+
export material Tinted_Glass_R02(*)
|
| 8 |
+
= GlassWithVolume(
|
| 9 |
+
thin_walled: true,
|
| 10 |
+
transmission_color: color(0.02f, 0.02f, 0.02f),
|
| 11 |
+
roughness_texture: texture_2d(),
|
| 12 |
+
ior: 1.52f,
|
| 13 |
+
transmission_color_texture: texture_2d(),
|
| 14 |
+
roughness_texture_influence: 0.f,
|
| 15 |
+
roughness: 0.f,
|
| 16 |
+
reflection_color_texture: texture_2d(),
|
| 17 |
+
reflection_color: color(1.f, 1.f, 1.f),
|
| 18 |
+
depth: 0.0001f,
|
| 19 |
+
normal_map_texture: texture_2d());
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Glass/Tinted_Glass_R25.mdl
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.5;
|
| 2 |
+
|
| 3 |
+
using ..::Templates::GlassWithVolume import GlassWithVolume;
|
| 4 |
+
import ::tex::gamma_mode;
|
| 5 |
+
import ::state::normal;
|
| 6 |
+
|
| 7 |
+
export material Tinted_Glass_R25(*)
|
| 8 |
+
= GlassWithVolume(
|
| 9 |
+
thin_walled: true,
|
| 10 |
+
transmission_color: color(0.25f, 0.25f, 0.25f),
|
| 11 |
+
roughness_texture: texture_2d(),
|
| 12 |
+
ior: 1.52f,
|
| 13 |
+
transmission_color_texture: texture_2d(),
|
| 14 |
+
roughness_texture_influence: 0.f,
|
| 15 |
+
roughness: 0.f,
|
| 16 |
+
reflection_color_texture: texture_2d(),
|
| 17 |
+
reflection_color: color(1.f, 1.f, 1.f),
|
| 18 |
+
depth: 0.0001f,
|
| 19 |
+
normal_map_texture: texture_2d());
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Templates/GlassUtils.mdl
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.5;
|
| 2 |
+
|
| 3 |
+
import ::tex::*;
|
| 4 |
+
import ::math::*;
|
| 5 |
+
import ::anno::*;
|
| 6 |
+
import ::base::*;
|
| 7 |
+
import ::state::*;
|
| 8 |
+
|
| 9 |
+
export float get_float( uniform texture_2d t, float f ){
|
| 10 |
+
return ::tex::texture_isvalid(t)
|
| 11 |
+
?
|
| 12 |
+
::base::file_texture(t,
|
| 13 |
+
color(0.f, 0.f, 0.f),
|
| 14 |
+
color(1.f, 1.f, 1.f),
|
| 15 |
+
::base::mono_maximum,
|
| 16 |
+
::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)),
|
| 17 |
+
float2(0.f, 1.f),
|
| 18 |
+
float2(0.f, 1.f),
|
| 19 |
+
::tex::wrap_repeat,
|
| 20 |
+
::tex::wrap_repeat,
|
| 21 |
+
false).mono
|
| 22 |
+
:
|
| 23 |
+
f;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
export color get_color( uniform texture_2d t, color c ){
|
| 27 |
+
return ::tex::texture_isvalid(t)
|
| 28 |
+
?
|
| 29 |
+
::base::file_texture(t,
|
| 30 |
+
color(0.f, 0.f, 0.f),
|
| 31 |
+
color(1.f, 1.f, 1.f),
|
| 32 |
+
::base::mono_alpha,
|
| 33 |
+
::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)),
|
| 34 |
+
float2(0.f, 1.f),
|
| 35 |
+
float2(0.f, 1.f),
|
| 36 |
+
::tex::wrap_repeat,
|
| 37 |
+
::tex::wrap_repeat,
|
| 38 |
+
false).tint
|
| 39 |
+
:
|
| 40 |
+
c;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
export float apply_roughness_influence( uniform texture_2d t, float f, float i ){
|
| 44 |
+
return ::math::lerp(f, get_float(t, f), i);
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
export color get_volume_absorption(
|
| 48 |
+
|
| 49 |
+
float absorption = float(0) [[
|
| 50 |
+
anno::display_name("Volume Absorption"),
|
| 51 |
+
anno::description("Controls how much light is absorbed through the surface"),
|
| 52 |
+
anno::hard_range(0.0,1000.0),
|
| 53 |
+
anno::soft_range(0.0,1.0)
|
| 54 |
+
]],
|
| 55 |
+
|
| 56 |
+
color absorptionColor = color(1) [[
|
| 57 |
+
anno::display_name("Absorption Color"),
|
| 58 |
+
anno::description("Simulates shifts in color when light passes through the surface")
|
| 59 |
+
]]
|
| 60 |
+
|
| 61 |
+
) [[
|
| 62 |
+
anno::display_name("Absorption"),
|
| 63 |
+
anno::description("Provides an absorption coefficient for the volume")
|
| 64 |
+
]] {
|
| 65 |
+
return (absorption>0)? -math::log(math::clamp(absorptionColor, color(0.01), color(0.99)))*absorption*100.0 : color(0);
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
export color volume_scattering(
|
| 69 |
+
|
| 70 |
+
float scattering = float(0) [[
|
| 71 |
+
anno::display_name("Volume Scattering"),
|
| 72 |
+
anno::description("Controls how much light is scattered through the surface"),
|
| 73 |
+
anno::hard_range(0.0,1000.0),
|
| 74 |
+
anno::soft_range(0.0,1.0)
|
| 75 |
+
|
| 76 |
+
]]
|
| 77 |
+
|
| 78 |
+
) [[
|
| 79 |
+
anno::display_name("Scattering"),
|
| 80 |
+
anno::description("Provides a scattering coefficient for the volume")
|
| 81 |
+
]] {
|
| 82 |
+
return (scattering>0)? -math::log(color(0.5))*scattering*100.0 : color(0);
|
| 83 |
+
}
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/Isaac Sim 4.5/isaac-sim-assets/Materials/2023_2_1/Base/Templates/GlassWithVolume.mdl
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.5;
|
| 2 |
+
|
| 3 |
+
import ::tex::*;
|
| 4 |
+
|
| 5 |
+
import GlassUtils::apply_roughness_influence;
|
| 6 |
+
import GlassUtils::get_color;
|
| 7 |
+
import GlassUtils::get_volume_absorption;
|
| 8 |
+
import ::anno::author;
|
| 9 |
+
import ::anno::copyright_notice;
|
| 10 |
+
import ::anno::description;
|
| 11 |
+
import ::anno::display_name;
|
| 12 |
+
import ::anno::hard_range;
|
| 13 |
+
import ::anno::in_group;
|
| 14 |
+
import ::anno::key_words;
|
| 15 |
+
import ::anno::soft_range;
|
| 16 |
+
import ::anno::unused;
|
| 17 |
+
import ::anno::usage;
|
| 18 |
+
import ::base::tangent_space_normal_texture;
|
| 19 |
+
import ::base::texture_coordinate_info;
|
| 20 |
+
import ::df::fresnel_layer;
|
| 21 |
+
import ::df::microfacet_ggx_smith_bsdf;
|
| 22 |
+
import ::df::scatter_mode;
|
| 23 |
+
import ::state::normal;
|
| 24 |
+
import ::state::texture_coordinate;
|
| 25 |
+
import ::state::texture_tangent_u;
|
| 26 |
+
import ::state::texture_tangent_v;
|
| 27 |
+
import ::tex::gamma_mode;
|
| 28 |
+
import ::tex::wrap_mode;
|
| 29 |
+
|
| 30 |
+
export material GlassWithVolume(
|
| 31 |
+
uniform bool thin_walled = false [[
|
| 32 |
+
::anno::in_group("Material", "", "")
|
| 33 |
+
]],
|
| 34 |
+
uniform color transmission_color = color(1.f, 0.00609700009f, 0.00609700009f) [[
|
| 35 |
+
::anno::in_group("Transmission", "", ""),
|
| 36 |
+
::anno::usage("")
|
| 37 |
+
]],
|
| 38 |
+
uniform texture_2d roughness_texture = texture_2d() [[
|
| 39 |
+
::anno::description("The input texture"),
|
| 40 |
+
::anno::in_group("Roughness", "", ""),
|
| 41 |
+
::anno::usage("")
|
| 42 |
+
]],
|
| 43 |
+
uniform float ior = 1.34100008f [[
|
| 44 |
+
::anno::in_group("Material", "", ""),
|
| 45 |
+
::anno::usage("")
|
| 46 |
+
]],
|
| 47 |
+
uniform texture_2d transmission_color_texture = texture_2d() [[
|
| 48 |
+
::anno::description("The input texture"),
|
| 49 |
+
::anno::in_group("Transmission", "", "")
|
| 50 |
+
]],
|
| 51 |
+
float roughness_texture_influence = 1.f [[
|
| 52 |
+
::anno::in_group("Roughness", "", ""),
|
| 53 |
+
::anno::usage("")
|
| 54 |
+
]],
|
| 55 |
+
float roughness = 0.f [[
|
| 56 |
+
::anno::in_group("Roughness", "", ""),
|
| 57 |
+
::anno::usage("")
|
| 58 |
+
]],
|
| 59 |
+
uniform texture_2d reflection_color_texture = texture_2d() [[
|
| 60 |
+
::anno::description("The input texture"),
|
| 61 |
+
::anno::in_group("Reflection", "", ""),
|
| 62 |
+
::anno::usage("")
|
| 63 |
+
]],
|
| 64 |
+
uniform color reflection_color = color(1.f, 1.f, 1.f) [[
|
| 65 |
+
::anno::in_group("Reflection", "", ""),
|
| 66 |
+
::anno::usage("")
|
| 67 |
+
]],
|
| 68 |
+
float depth = 0.00100000005f [[
|
| 69 |
+
::anno::description("Controls how much light is absorbed through the surface"),
|
| 70 |
+
::anno::display_name("Volume Absorption"),
|
| 71 |
+
::anno::in_group("Volume", "", ""),
|
| 72 |
+
::anno::usage(""),
|
| 73 |
+
::anno::soft_range(0.f, 1.f),
|
| 74 |
+
::anno::hard_range(0.f, 1000.f)
|
| 75 |
+
]],
|
| 76 |
+
uniform texture_2d normal_map_texture = texture_2d() [[
|
| 77 |
+
::anno::description("The input texture"),
|
| 78 |
+
::anno::in_group("Normal Map", "", ""),
|
| 79 |
+
::anno::usage("")
|
| 80 |
+
]])
|
| 81 |
+
=
|
| 82 |
+
let {
|
| 83 |
+
bool tmp0 = thin_walled;
|
| 84 |
+
material_surface tmp1(
|
| 85 |
+
::df::fresnel_layer(ior, 1.f, ::df::microfacet_ggx_smith_bsdf(GlassUtils::apply_roughness_influence(roughness_texture, roughness, roughness_texture_influence), GlassUtils::apply_roughness_influence(roughness_texture, roughness, roughness_texture_influence), GlassUtils::get_color(reflection_color_texture, reflection_color), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::microfacet_ggx_smith_bsdf(GlassUtils::apply_roughness_influence(roughness_texture, roughness, roughness_texture_influence), GlassUtils::apply_roughness_influence(roughness_texture, roughness, roughness_texture_influence), thin_walled ? GlassUtils::get_color(transmission_color_texture, transmission_color) : color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_transmit, ""), ::state::normal()),
|
| 86 |
+
material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
|
| 87 |
+
material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
|
| 88 |
+
color tmp3 = ior;
|
| 89 |
+
material_volume tmp4(
|
| 90 |
+
vdf(),
|
| 91 |
+
thin_walled ? GlassUtils::get_color(transmission_color_texture, transmission_color) : GlassUtils::get_volume_absorption(depth, GlassUtils::get_color(transmission_color_texture, transmission_color)),
|
| 92 |
+
color(0.f, 0.f, 0.f));
|
| 93 |
+
material_geometry tmp5(
|
| 94 |
+
float3(0.f),
|
| 95 |
+
1.f,
|
| 96 |
+
::base::tangent_space_normal_texture(normal_map_texture, 1.f, false, false, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f));
|
| 97 |
+
hair_bsdf tmp6 = hair_bsdf();
|
| 98 |
+
} in
|
| 99 |
+
material(
|
| 100 |
+
thin_walled: tmp0,
|
| 101 |
+
surface: tmp1,
|
| 102 |
+
backface: tmp2,
|
| 103 |
+
ior: tmp3,
|
| 104 |
+
volume: tmp4,
|
| 105 |
+
geometry: tmp5,
|
| 106 |
+
hair: tmp6);
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/model_cabinet.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:689976a5d0e15267de333ce06da00c8f5a6a388196d28ad5bd53f76ae5ae63e6
|
| 3 |
+
size 217214
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/resource/img/e9f7c719a9c4fd93f4f8cbaf7f905858.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/resource/material.usd
ADDED
|
Binary file (2.34 kB). View file
|
|
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinet_1/resource/v_69323/link_0_0.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e59308974c589842c6715b882b5da0abb07a6c186fb929862f57d7bdcc2b4845
|
| 3 |
+
size 226711
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/model_cabinetb_2.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db3eb2568352859402fe5cd32f9b76c9f662fcef57434ab5e6f2a82bd59763f1
|
| 3 |
+
size 158326
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/resource/img/47e62735bb81ebd55a3b96179f4ca477.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/resource/img/b5438c25905693520be7b48998be40a7.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/resource/material.usd
ADDED
|
Binary file (2.41 kB). View file
|
|
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/cabinetb_2/resource/v_69323/link_0_0.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:783846aa23fc2dca783f4b6ce9226cdaaf4c8b0ff13f15bd63bd0baabfff8cef
|
| 3 |
+
size 150175
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/itm/potted_plant003/model_potted_plant003.usd
ADDED
|
Binary file (3.22 kB). View file
|
|
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/itm/potted_plant003/resource/img/dae60a53aa59e8e355383e2ef7d269cf.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/itm/potted_plant003/resource/material.usd
ADDED
|
Binary file (2.17 kB). View file
|
|
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/itm/potted_plant003/resource/v_0/link_default_0.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ee55ba9f04db23b1ede77cd0e9bf08f90067a40b04103301a62b81218b8fb35
|
| 3 |
+
size 602059
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/roundtable/model_roundtable.usd
ADDED
|
Binary file (2.73 kB). View file
|
|
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/roundtable/resource/img/b5438c25905693520be7b48998be40a7.png
ADDED
|
Git LFS Details
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/roundtable/resource/material.usd
ADDED
|
Binary file (2.15 kB). View file
|
|
|
usd_models/dry_kitchen.e2/backgrounds/localized/green_assets/ArtVIP/Interactive_scene/kitchen_with_parlor/roundtable/resource/v_69323/link_0_0.usd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:47470a6cfa947110fac0e0bcda80ecdd731d2a1e6a6e352b79c6b3b836c606d0
|
| 3 |
+
size 159522
|