Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Ray Perception Sensor not registering observations

Discussion in 'ML-Agents' started by Brian16446, Mar 28, 2020.

  1. Brian16446

    Brian16446

    Joined:
    Apr 3, 2019
    Posts:
    1
    I have a car set up with raycasts using the ray perception sensor to detect 3 tags. For some reason, I am getting the warning in unity: Fewer observations (0) made than vector observation size (45).

    I think because there are no observations, it is not learning. Why does this have 0 observations? I thought the Ray Perception Sensor automatically collected observations and passed them to the behavior parameters?

    Here is a screenshot of the scripts:

    Ray Perception Sensor:


    Behaviour Parameters:
     
  2. LexVolkov

    LexVolkov

    Joined:
    Sep 14, 2014
    Posts:
    62
    yes, automatically. therefore, it is not necessary to enter the number of ray sensors in the component of observations. In the component you enter only those sensors that you entered in your code.
     
  3. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hi @Brian16446,
    @LexVolkov is correct. The vector observations on the BrainParameters are referencing the observations you make in your code within the CollectObservations method on Agent. The size for the sensors is added automatically for you. Let us know if you have any further questions.
     
  4. KVTeja_512

    KVTeja_512

    Joined:
    Apr 19, 2021
    Posts:
    4
    How do I debug log the game object that the ray is hitting?