Get Ray Perception Sensor 3D info

Hello,

How can I get the info about my sensors to put in my own log? I need to save the tag position provided by the sensor. My goal is train my agent based on the my log(xml file). So I have to write the sensor info on the file.

The CollectObservations method can be used?

7598965--942910--upload_2021-10-24_17-14-50.png

7598965--942913--upload_2021-10-24_17-16-50.png

Thanks in advance

Yes, that is possible. Here is what you can try:

If you would like to see the last observation you can simply call this.GetObservations() anywhere within the agent implementation. If you are using the stacked observations then you could use this.GetStackedObservations() and it will return last N observations where is the N is the stack size you chose in the editor. Note that GetStackedObservation is not yet a part of the release and you would need to use the master branch implementation of ML-Agents.

Thank you and please let me know if there is anything else I could help with.

Thanks for the answer!

I want to get the position of the elements detected by the sensor tags. But I try to use this.GetObservations() inside Heuristics and it returns me with:

7639897--951685--upload_2021-11-8_17-10-34.png

The elements that are looked for sensors are created and destroyed many times.

My need is get only one time all the observations made to save them into a log. Maybe it could be get later and not in Heuristics. Getobservations overwrites the content like an object or it is added like an array?

My configuration is: My agent (Turret) has sensors and every sensor has their detectable tags.

7639897--951682--upload_2021-11-8_17-8-1.png

I really appreciate your help! Thanks in advance