(joint_name)
| 152 | |
| 153 | |
| 154 | def get_action_scale(joint_name): |
| 155 | for pattern, scale in scale_dict.items(): |
| 156 | # 用 left/right 替换 .* |
| 157 | if pattern.startswith(".*"): |
| 158 | if joint_name.startswith("left") or joint_name.startswith("right"): |
| 159 | if joint_name.endswith(pattern[3:]): |
| 160 | return scale |
| 161 | else: |
| 162 | if joint_name == pattern: |
| 163 | return scale |
| 164 | raise ValueError(f"No scale found for joint: {joint_name}") |
| 165 | |
| 166 | |
| 167 | # 根据 isaaclab joint_pos 配置设置默认关节位置 |