Robotics
Inventor Constraint と Joint の関係 (URDF 用)
Constraint は幾何拘束、Joint は運動学的拘束。URDF joint 変換には Joint 主体で組むか、Convert to Joint / iLogic script で半自動化する
要点: Inventor の Constraint は幾何拘束 (面合致/軸合致)、Joint は運動学拘束 (Rotational/Slider)。URDF joint との対応は Joint が明示的で楽、Constraint は複数個の組み合わせを解釈する必要。Inventor 2019+ の Convert to Joint で半自動変換可、Insert 拘束はほぼ 1:1 対応。
Constraint の種類
Standard Assembly Constraint
| 種類 | 対象 | 説明 | 個数目安 |
|---|---|---|---|
| Mate (合致) | 面/線/点 | 一致 (対向 or 同方向) | 1 pair 3-4 個必要 |
| Angle (角度) | 面-面 / 線-線 | 角度指定 | 補助的 |
| Tangent (接線) | 曲面 | 接触 | ローラー等 |
| Insert (挿入) | 円筒 face 同士 | 軸合わせ + 平面合致 | ボルト-穴で 1 個 |
| Symmetry (対称) | 平面 | mirror | 稀 |
Motion Constraint (運動拘束)
| 種類 | 意味 |
|---|---|
| Rotation | 2 部品の回転比 (ギア比) |
| Rotation-Translation | 回転→直進 (ラックピニオン) |
Joint の種類 (Inventor 2014+)
| Joint 種類 | URDF 対応 | 拘束されない自由度 |
|---|---|---|
| Rigid | fixed | 0 |
| Rotational | revolute / continuous | 1 (回転) |
| Slider | prismatic | 1 (直進) |
| Cylindrical | (URDF に直接無) | 2 (回転 + 直進) |
| Planar | (URDF に直接無) | 3 (面内 2 直進 + 1 回転) |
| Ball | (URDF に直接無) | 3 (回転 3 軸) |
Inventor Joint は 限定範囲 (Limits) と初期姿勢 を明示的に持てる → URDF joint の <limit> にそのまま対応。
Constraint と Joint の対応 (典型)
| Joint | 対応する Constraint 組み合わせ |
|---|---|
| Rotational (revolute) | Insert 1 個 (最も clean) |
| Rotational (別解) | Mate 円筒面 + Mate 平面 (端面 stop) |
| Slider (prismatic) | Mate 平面 × 2 (guide) + Mate 平面 (端面) + Angle (回転止め) |
| Rigid (fixed) | Mate 面 × 3 or Grounded |
Insert 主体で組んでる assembly は Joint 変換が楽。Mate 主体だと 3-4 個の組み合わせを解釈する必要。
Constraint → Joint 変換
完全自動は無理、半自動は可能
難しい理由:
- 1 Joint = 複数 Constraint の集約
- 組み合わせパターンが assembly 流儀ごとに違う
- 意図の推定 (これは revolute か cylindrical か) が必要
3 つの実務的解
A) Inventor の Convert to Joint (半自動、2019+)
Assemble タブに Convert Constraints to Joints コマンドあり:
- Insert 1 個 → Rotational Joint (ほぼ自動で通る)
- 複雑な組み合わせ (Mate 3 個 → Slider) は失敗、手動で追加要
流れ:
- Constraint 選択 → Convert to Joint
- 変換後 assembly が動くか確認 (locked / broken なら手戻り)
- 通らなかった joint は手動追加
Insert 主体で組んでる部分なら 一括変換で 70% 済む。
B) iLogic script で pattern-match → Joint 追加 (社内規約が前提)
Constraint の組み合わせパターンから joint 種類を推定して自動追加:
For each pair of connected occurrences:
constraints = get_constraints_between(occ_a, occ_b)
if len(insert_constraints) >= 1:
add Rotational Joint at insert axis
elif len(mate_plane) == 3 and len(angle) >= 1:
add Slider Joint along mate normal
...社内規約が明確なら 90% 自動化可:
- 「Revolute は必ず Insert で表す」
- 「Slider は Mate 平面 × 2 + Insert 軸」
- のような書き方統一があれば script で全パターン網羅可
C) 新規 Joint で再アセンブル (最も確実、推奨)
URDF に出したい軸だけ Joint で組み直す:
- 既存 constraint はそのまま (Inventor は constraint + joint 共存 OK)
- 主要 revolute/prismatic 軸だけ Joint 追加 (10-20 個/機構)
- 所要時間: 30 分-1 時間/機構
- iLogic script で
AssemblyJointsを JSON export → URDF/xacro 生成
小規模 (機構あたり 5-10 joint) の assembly ならこれが最速で確実。
Constraint 主体 assembly からの移行
短期 (対象機構だけ URDF が要る)
- C 案: 該当機構だけ Joint で再アセンブル
- 既存 constraint は残す (壊さない)
- 主要軸を 5-10 分で追加 → JSON export → URDF
中期 (継続運用)
- 社内規約策定:
- Revolute → Insert 拘束を必ず使う
- Slider → Mate 平面 × 2 + Insert 軸 の組み合わせ
- これで A/B 案の自動変換率が上がる
- iLogic script を 1 本書く
- 以後は新規 assembly でも 1 コマンドで URDF export
長期 (根本解)
- 新規 assembly は最初から Joint で組む
- 手戻り無く URDF export 自動化
- 拘束と joint の共存廃止 (どちらか一方に統一)
Constraint 主体 assembly の落とし穴
- 矛盾チェック: constraint + joint 混在で意図がずれると assembly locked/broken
- 移動 (Free Move) の挙動: joint 追加後は joint の自由度で動く、constraint 無視されることがある
- update 順序: constraint 変更 → joint 位置ずれ、再計算必要
iLogic script のイメージ
Joint export (Joint 主体で組んだ assembly 用):
Dim doc As AssemblyDocument = ThisApplication.ActiveDocument
Dim asm As AssemblyComponentDefinition = doc.ComponentDefinition
Dim json As New StringBuilder()
json.AppendLine("{""joints"": [")
For Each j As AssemblyJoint In asm.Joints
Dim axis = j.Axis
Dim jtype = j.JointType.ToString()
Dim child = j.OccurrenceOne.Name
Dim parent = j.OccurrenceTwo.Name
json.AppendLine($"{{""name"":""{j.Name}"", ""type"":""{jtype}"", ""parent"":""{parent}"", ""child"":""{child}"", ""axis"":[{axis.X}, {axis.Y}, {axis.Z}], ""limit_min"":{j.Limits.Minimum}, ""limit_max"":{j.Limits.Maximum}}},")
Next
json.AppendLine("]}")
System.IO.File.WriteAllText("C:\temp\joints.json", json.ToString())関連
最終更新: