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

RigidBodySensorComponent does not save which objects in hierarchy are enabled #5774

Closed
TV4Fun opened this issue Aug 12, 2022 · 3 comments · May be fixed by #5780
Closed

RigidBodySensorComponent does not save which objects in hierarchy are enabled #5774

TV4Fun opened this issue Aug 12, 2022 · 3 comments · May be fixed by #5780
Labels
bug Issue describes a potential bug in ml-agents. stale Issues that have been idle for a while. Automatically closed by a bot if idle for too long.

Comments

@TV4Fun
Copy link

TV4Fun commented Aug 12, 2022

Describe the bug
I am using RigidBodySensorComponent to report the positions and velocities of rigid bodies controlled by an agent. The sensor component correctly extracts the items in the hierarchy, but it always enables the whole hierarchy, the base of which is fixed in model space coordinates, and so just extra useless data being passed to the model. There are check boxes to disable these bodies, but they are not saved with the scene, and as soon as I start training, they are all re-enabled again. It looks like there is a settings object set to be serialized, so I'm not sure why they're not being properly trained. This also happens when I make the RigidBodySensorComponent part of a prefab and change anything there, the settings are not included with the prefab.

To Reproduce

  1. Create a GameObject with a RigidBody attached.
  2. Create several child GameObjects with their own RigidBodys.
  3. Attach a RigidBodySensorComponent to the root object.
  4. Disable some of the object's in the RigidBodySensorComponent's hierarchy settings.
  5. Save the scene, exit and reload it.
    Expected behavior: The disabled objects should be saved with the scene and persist across a save and reload.
    Actual behavior: The hierarchy always resets to the default of having all the objects enabled.

Environment (please complete the following information):

  • Unity Version: 2021.3.7f1 Apple Silicon
  • OS + version: macOS Monterey 12.5 (21G72) running on Apple Silicon
  • ML-Agents version: Latest main branch from source
  • Torch version: 1.13.0.dev20220804
  • Environment: Crawler. Try disabling one of the bodies in the RigidBodySensorComponent attached to CrawlerBase in the Platform prefab. It will not save once you have exited prefab mode.

NOTE: We are unable to help reproduce bugs with custom environments. Please attempt to reproduce your issue with one of the example environments, or provide a minimal patch to one of the environments needed to reproduce the issue.

@TV4Fun TV4Fun added the bug Issue describes a potential bug in ml-agents. label Aug 12, 2022
TV4Fun added a commit to TV4Fun/ml-agents that referenced this issue Aug 18, 2022
The settings of `RigidBodySensorComponent`s were not getting serialized
and saved properly before. Now they are.
Fixes Unity-Technologies#5774
@stale
Copy link

stale bot commented Sep 21, 2022

This issue has been automatically marked as stale because it has not had activity in the last 28 days. It will be closed in the next 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issues that have been idle for a while. Automatically closed by a bot if idle for too long. label Sep 21, 2022
@stale
Copy link

stale bot commented Nov 2, 2022

This issue has been automatically closed because it has not had activity in the last 120 days. If this issue is still valid, please ping a maintainer. Thank you for your contributions.

@stale stale bot closed this as completed Nov 2, 2022
@github-actions
Copy link

github-actions bot commented Dec 2, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue describes a potential bug in ml-agents. stale Issues that have been idle for a while. Automatically closed by a bot if idle for too long.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant