AGXの動作確認

  • AGXのシミュレーションを実行できるか確認する。

【Windows】プログラムの実行

確認環境

  • OS: Windows 10 Pro x64

  • AGXバージョン: agx-2.38.0.1-x64-VS2022-double.exe

「AGX Dynamics Main Page」から Python tutorials を開く。

ページをスクロールし、「Tutorial: Supporting both python and agxViewer」を見つける。

Start tutorial2_python3_agxViewer.agxPy in agxViewer または 画像 を選択する。

../../../_images/operation_check_1_select_tutorial.png

agx_cmd.bat の実行確認ポップアップが表示される [1]開く を選択する。

../../../_images/operation_check_2_run_agx_cmd_bat.png

【Ubuntu】プログラムの実行

確認環境

  • OS: Ubuntu 22.04 LTS

  • AGXバージョン: agx-2.38.0.1-amd64-ubuntu_22.04.deb

ターミナルを開き、次のコマンドでプログラムを実行する。 <AGX_DIR> はAGXのインストールディレクトリ /opt/Algoryx/AGX-${AGX_VERSION} である。

cd <AGX_DIR>/data/python/tutorials
agxViewer tutorial2_python3_agxViewer.agxPy

プログラムの動作確認と終了

agxViewerが起動すると、次のCGが表示される。

画面上でキーボードの e を入力してシミュレーションを開始する。

2つのボックスが落下することを確認する。

../../../_images/operation_check_3_tutorial2_start.png ../../../_images/operation_check_4_tutorial2_end.png

アプリケーションの終了は Esc を入力するかウインドウを閉じる。

グラフィックスなしでのプログラムの実行

グラフィックスに対応していない環境でグラフィックスありのプログラムを実行すると、グラフィックスウィンドウが開かず終了する。 終了時には次のエラーが表示される。

agxViewer tutorial2_python3_agxViewer.agxPy
Caught exception: Failed to find window with number: 0

この場合、次のコマンドを実行して動作確認をする。 エラーなくプログラムが終了すればよい。

# --agxOnly: CG描画なし、--stopAt 5: 秒シミュレーションをしたのち終了
agxViewer tutorial2_python3_agxViewer.agxPy --agxOnly --stopAt 5

buildScene1 - boxes
Loading scene took 0.378219 sec
Stepping 301 timesteps (5.01667 sec simulated time) took 0.0327874 sec