Collecting Gaze Points for Agents in SEDRO
To get the coordinates of the agent’s gaze in SEDRo, I have written the following script.
I have chosen to use OnTriggerStay as it is called on all frames for every collider that touches the trigger. In SEDRo, the trigger is the transparent cube created just on top of the Unity Perception experiment setups. The collider is the ‘laser’ under eyesight_main.
I have attached the tag ‘looking’ to the collider viz the laser. If the collider touching the trigger is ‘laser’ then using raycast, the collision point is stored.
To convert the collision point to from global coordinates to local coordinates in relation to the transparent cube.