このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
clearCollision
説明
例
衝突メッシュの追加とマニピュレーター ロボット アームの衝突チェック
ロボット モデルを読み込み、衝突メッシュを変更します。既存の衝突メッシュをクリアし、簡易衝突オブジェクトのプリミティブ型を追加して、特定のコンフィギュレーションが競合しているかどうかを確認します。
ロボット モデルの読み込み
関数 loadrobot
を使用して、事前構成済みのロボット モデルをワークスペースに読み込みます。このモデルには、既に各ボディに指定された衝突メッシュがあります。すべての剛体要素を反復し、既存の衝突メッシュをクリアします。既存のメッシュがなくなっていることを確認します。
robot = loadrobot('kukaIiwa7','DataFormat','column'); for i = 1:robot.NumBodies clearCollision(robot.Bodies{i}) end show(robot,'Collisions','on','Visuals','off');
衝突シリンダーの追加
衝突シリンダーを各ボディに追加する作業を繰り返します。この特定のモデルに対するボディの一部は、オーバーラップしてエンドエフェクタ (ボディ 10) と常に衝突するため、スキップします。
collisionObj = collisionCylinder(0.05,0.25); for i = 1:robot.NumBodies if i > 6 && i < 10 % Skip these bodies. else addCollision(robot.Bodies{i},collisionObj) end end show(robot,'Collisions','on','Visuals','off');
衝突チェック
一連のランダムなコンフィギュレーションを生成します。ロボットが各コンフィギュレーションで競合しているかどうかを確認します。競合している各コンフィギュレーションを可視化します。
figure rng(0) % Set random seed for repeatability. for i = 1:20 config = randomConfiguration(robot); isColliding = checkCollision(robot,config,'SkippedSelfCollisions','parent'); if isColliding show(robot,config,'Collisions','on','Visuals','off'); title('Collision Detected') else % Skip non-collisions. end end
拡張機能
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
バージョン履歴
R2020b で導入
参考
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)