Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renderer #81

Closed
Geson-anko opened this issue Sep 15, 2022 · 2 comments
Closed

Renderer #81

Geson-anko opened this issue Sep 15, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Geson-anko
Copy link
Owner

matplotlibによるリアルタイムRendering処理について

@Geson-anko Geson-anko added the enhancement New feature or request label Sep 15, 2022
@Geson-anko
Copy link
Owner Author

Gym APIのrenderの内部処理を行うクラスを実装します。

コンストラクタでPynkTrombone環境モデルを受け取り、plt.Figureなどを作成した後に、updaterender_rgb_arrayを呼び出すことで使用します。
現在は RGB 画像配列を作成することだけをサポートします。将来的にMatplotlibによるGUIレンダリング処理(humanあたる実装)を追加します。

@Geson-anko
Copy link
Owner Author

PynkTrombone Environment classのレンダリング処理を置き換えます。
また、figuressingle_figureをサポート外にし、rgb_arrayssingle_rgb_arrayのみのサポートとします。
従って、render(None)で格納されるオブジェクトはNumpy.ndarrayオブジェクトになります。

また、環境クラスのコンストラクタ__init__の引数にrenderer=Noneを追記ます。これによって、任意のカスタマイズされたRendererクラスを使用することができます。

env.pyの変更箇所

  • initialize_state
    _stored_state_figures -> _rendered_rgb_arrays
  • render メソッド
  • fig2rgba_array メソッドを削除
  • TypeVar("RenderFrame")をNumpy ndarrayのみに
  • ドキュメントの加筆修正

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant