Search Unity

Question How to train an agent that can avoid dynamic randomized obstacles?

Discussion in 'ML-Agents' started by fankepolimi, May 8, 2023.

  1. fankepolimi

    fankepolimi

    Joined:
    May 5, 2023
    Posts:
    2
    In this project, the withe ball aims to reach the green box without collision with these red obstacles. These red obstacles move in this area randomly.

    I tried a lot of times with different reward functions (dense/sparse), and different observations such as grid sensors and ray cast sensors. I can not get good results. Can someone help me with this? I wonder if ppo can not handle this kind of randomized obstacles.
    Thank you very much!!!!!
     

    Attached Files:

  2. fankepolimi

    fankepolimi

    Joined:
    May 5, 2023
    Posts:
    2
    Project overview
     

    Attached Files:

  3. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    What does your training config file look like?
     
  4. tanushka_iv

    tanushka_iv

    Joined:
    Sep 25, 2022
    Posts:
    2
    With dynamic obstacles, you can try using a stack observation of rays,
    for example,
    3-5.
     
  5. MarkMaa

    MarkMaa

    Joined:
    Jan 20, 2020
    Posts:
    36
    I heard that rays must be small (like 1-4 length) for avoiding obstacles
    SetReward(-1) when collided with a red box
    SetReward(0.5f) when reached the green box

    Try it if you haven't yet
     
  6. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    Pretty sure it is “AddReward” not “SetReward”.
     
  7. MarkMaa

    MarkMaa

    Joined:
    Jan 20, 2020
    Posts:
    36
    SetReward
    EndEpisode()