Add enum for sensor implementations, send in analytics#4871
Merged
Conversation
chriselion
commented
Jan 20, 2021
| { | ||
| const string k_VendorKey = "unity.ml-agents"; | ||
| const string k_EventName = "ml_agents_inferencemodelset"; | ||
| const int k_EventVersion = 1; |
Contributor
Author
There was a problem hiding this comment.
I think we'll need to use version 2 here, waiting to hear back from analytics team.
chriselion
commented
Jan 20, 2021
| Unknown = 0, | ||
| VectorSensor = 1, | ||
| // Note that StackingSensor actually returns the wrapped sensor's type | ||
| StackingSensor = 2, |
Contributor
Author
There was a problem hiding this comment.
I can omit this if you don't like it here (since it's not actually used).
chriselion
commented
Jan 20, 2021
| CameraSensor = 5, | ||
| RenderTextureSensor = 6, | ||
| BufferSensor = 7, | ||
| PhysicsBodySensor = 8, |
Contributor
Author
There was a problem hiding this comment.
The ordering doesn't actually matter here, but I could make the extensions implementations start at some offset, say 1000.
chriselion
commented
Jan 20, 2021
| public BuiltInSensorType GetBuiltInSensorType() | ||
| { | ||
| IBuiltInSensor wrappedBuiltInSensor = m_WrappedSensor as IBuiltInSensor; | ||
| return wrappedBuiltInSensor?.GetBuiltInSensorType() ?? BuiltInSensorType.Unknown; |
Contributor
Author
There was a problem hiding this comment.
TODO add unit test that checks this explicitly.
added 2 commits
January 26, 2021 11:03
3 tasks
10 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Proposed change(s)
Followup from the other analytics PRs. This tags ObservationSpecs in the events if we know that the sensor involved is one that we provided. Future sensor implementations should also inherit from the interface and add to the enum.
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
#4780
Types of change(s)
Checklist