Merged
Conversation
GianiStatie
approved these changes
Nov 29, 2024
Collaborator
|
I just plugged the changes in one of my projects and it's awesome. Way better than the overcomplicated workaround that I've built. 🙌 |
Collaborator
Author
|
@edbeeching Is it OK to merge this? |
edbeeching
approved these changes
Jan 22, 2025
Owner
edbeeching
left a comment
There was a problem hiding this comment.
Sorry I missed this PR, it is awesome. Thank you.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the 2D variant of the current 3D camera sensor. The main goal of the PR is to bring 2D support to a similar state as the 3D sensor and make them similar to use. This PR does not deal with e.g. onnx inference.
Test env: edbeeching/godot_rl_agents_examples#42
Usage:
RGBCameraSensor2Din Godot filesystem and attach it to the player or AIController:You can train it as usual, you can test Cnn or Mlp easily by adjusting the SB3 example script as below:
to
to use either
MlpPolicyorCnnPolicy.This works with a single obs space, and for mixing the
MultiInputPolicyis required, which will use CNN.Other notes:
There are small modifications to make this work with 2D in a similar way as the 3D sensor.
RGBCameraSensor2D) to use the shared World2D space as the root.Controlis changed to a window. That way the camera display doesn't render on the same viewport that is being captured. Also, as a nice side-effect, we can move the window for each AIController that uses the sensor. I'm thinking of adding this to the 3D sensor too.2DCameraWindows.mp4
DisplayServer.register_additional_output(self).TODO: