2026-03-16 05:00:20 -04:00
|
|
|
|
from isaaclab.assets import ArticulationCfg, AssetBaseCfg
|
|
|
|
|
|
from isaaclab.scene import InteractiveSceneCfg
|
2026-03-18 06:05:30 -04:00
|
|
|
|
from isaaclab.sensors import ContactSensorCfg
|
2026-03-16 05:00:20 -04:00
|
|
|
|
from isaaclab.utils import configclass
|
|
|
|
|
|
from isaaclab.actuators import ImplicitActuatorCfg
|
|
|
|
|
|
from isaaclab import sim as sim_utils
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
_DEMO_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
|
|
|
|
|
T1_USD_PATH = os.path.join(_DEMO_DIR, "asset", "t1", "t1_locomotion_physics.usd")
|
|
|
|
|
|
|
|
|
|
|
|
@configclass
|
|
|
|
|
|
class T1SceneCfg(InteractiveSceneCfg):
|
|
|
|
|
|
"""修改后的 T1 机器人场景配置,适配随机姿态起身任务"""
|
|
|
|
|
|
|
|
|
|
|
|
# 1. 地面配置 (如果之前没定义,必须加上)
|
|
|
|
|
|
ground = AssetBaseCfg(
|
|
|
|
|
|
prim_path="/World/ground",
|
|
|
|
|
|
spawn=sim_utils.GroundPlaneCfg(),
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# 2. 机器人配置
|
|
|
|
|
|
robot = ArticulationCfg(
|
|
|
|
|
|
prim_path="{ENV_REGEX_NS}/Robot",
|
|
|
|
|
|
spawn=sim_utils.UsdFileCfg(
|
|
|
|
|
|
usd_path=T1_USD_PATH,
|
|
|
|
|
|
activate_contact_sensors=True,
|
|
|
|
|
|
rigid_props=sim_utils.RigidBodyPropertiesCfg(
|
|
|
|
|
|
disable_gravity=False,
|
|
|
|
|
|
max_depenetration_velocity=10.0, # ⬅️ 提高穿透修正速度,防止肢体卡在地下
|
|
|
|
|
|
),
|
|
|
|
|
|
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
|
|
|
|
|
|
enabled_self_collisions=True, # 开启自碰撞,起身时肢体可能互碰
|
|
|
|
|
|
solver_position_iteration_count=8, # ⬅️ 增加迭代次数,提高物理稳定性
|
|
|
|
|
|
solver_velocity_iteration_count=4,
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
init_state=ArticulationCfg.InitialStateCfg(
|
|
|
|
|
|
# ⬅️ 核心修改:高度降低。因为是躺着生成,0.2m 比较合适
|
2026-03-19 09:08:57 -04:00
|
|
|
|
pos=(0.0, 0.0, 0.3),
|
2026-03-16 05:00:20 -04:00
|
|
|
|
# 默认旋转设为单位阵,具体的随机化由 Event 管理器处理
|
|
|
|
|
|
rot=(1.0, 0.0, 0.0, 0.0),
|
|
|
|
|
|
joint_pos={".*": 0.0},
|
|
|
|
|
|
),
|
|
|
|
|
|
actuators={
|
|
|
|
|
|
"legs": ImplicitActuatorCfg(
|
|
|
|
|
|
joint_names_expr=[".*"],
|
|
|
|
|
|
effort_limit=400.0, # T1 通常有较强的力矩输出
|
|
|
|
|
|
velocity_limit=20.0, # ⬅️ 调高速度限制,起身需要爆发动作
|
|
|
|
|
|
stiffness=150.0, # ⬅️ 调高刚度:起身需要更“硬”的支撑
|
|
|
|
|
|
damping=5.0, # ⬅️ 增加阻尼:防止机器人站起瞬间晃动太厉害
|
|
|
|
|
|
),
|
|
|
|
|
|
},
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-03-19 09:08:57 -04:00
|
|
|
|
|
2026-03-19 09:36:32 -04:00
|
|
|
|
feet_contact_sensor = ContactSensorCfg(
|
|
|
|
|
|
prim_path="{ENV_REGEX_NS}/Robot/.*_foot_link", # 使用正则匹配所有脚部 link
|
|
|
|
|
|
update_period=0.0, # 随物理步长更新
|
|
|
|
|
|
history_length=3
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-03-19 09:08:57 -04:00
|
|
|
|
contact_sensor = ContactSensorCfg(
|
|
|
|
|
|
prim_path="{ENV_REGEX_NS}/Robot/.*",
|
|
|
|
|
|
update_period=0.0,
|
|
|
|
|
|
history_length=3,
|
2026-03-18 06:05:30 -04:00
|
|
|
|
)
|
|
|
|
|
|
|
2026-03-16 05:00:20 -04:00
|
|
|
|
# 3. 光照配置
|
|
|
|
|
|
light = AssetBaseCfg(
|
|
|
|
|
|
prim_path="/World/light",
|
|
|
|
|
|
spawn=sim_utils.DistantLightCfg(color=(0.75, 0.75, 0.75), intensity=3000.0),
|
2026-03-19 09:08:57 -04:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# ['Trunk', 'H1', 'H2', 'AL1', 'AL2', 'AL3', 'left_hand_link', 'AR1', 'AR2', 'AR3', 'right_hand_link', 'Waist', 'Hip_Pitch_Left', 'Hip_Roll_Left', 'Hip_Yaw_Left', 'Shank_Left', 'Ankle_Cross_Left', 'left_foot_link', 'Hip_Pitch_Right', 'Hip_Roll_Right', 'Hip_Yaw_Right', 'Shank_Right', 'Ankle_Cross_Right', 'right_foot_link']
|