-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Enable child GameObjects to have a SensorComponent as well #3095
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @Blueeyesjt1, are you using the UnitySDK folder from the |
Interesting - and you have "UseChildSensors" checked? I've been able to add such a sensor to an empty child gameobject and it does work. What's the error you're getting? |
Awesome! Glad you figured it out. |
(I deleted my other question because it was unrelated to the topic.) But now, I'm having an issue when try to test my agent AFTER training and adding the model to the inspector. Adding more observations does not fix this. What should I do? If I add an extra 33, then the error also adds another 33. It keeps asking for +33 over and over again the more I add on! |
Hi @Blueeyesjt1, it's a little confusing but you shouldn't add the RayPerceptionSensor obs to the VectorObservationSpaceSize. When you quit Python training, the terminal should print out something like this:
Can you post your output? It'll help a lot in debugging. Thanks! |
This looks correct - are you absolutely sure that you're using the right model file? The model file that's exported shows 328 observations, which is the right number. |
@ervteng Yes, I am. Now, I have the rayPerceptionSensorComp3D set as an observation. Is that a bad idea? I have heard it works on its own. |
Yes it does. If you're using only RayPerceptionSensor, the VectorObservations parameter in the agent should be 0. What're the other 295 vector obs? |
Update: Removing the raySensor3D component from the observation list fixed it. Thanks for the help. (Again!) @ervteng |
In many cases, we want to add Sensors to child GameObjects of the Agent - this could be when the Agent is made up of many GameObjects, or if we want to apply a transform to e.g. a RayPerception component.
However, in the case of hierarchical agents, we don't necessarily want this. This PR makes whether or not we search children for Sensors optional.