Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question My robot arm falls apart and gets stuck while training in ml-agents/

Discussion in 'ML-Agents' started by SkeVinci, Jun 9, 2022.

  1. SkeVinci

    SkeVinci

    Joined:
    May 8, 2022
    Posts:
    6
    Hi all,

    I'm training my robot arm these days. After I press the play button, the arm itself can move fluently and it seems that there isn't any question. stable.png

    However, when I use my .yaml to train it and then press the play button when the terminal calls me to do it, my robot immediately falls apart and doesn't move. fall_apart.png

    I wonder why it doesn't move properly while training but falls apart. Is there a problem with my arm or the wrong .yaml file will cause this thing to happen?
     
  2. spakment

    spakment

    Joined:
    Dec 19, 2017
    Posts:
    96
    How is the arm setup - if its an articulation body then check all your drive limits and increase your solver frequency.
    How is your agent driving the arm? If its randomly choosing a drive limit to apply then you could look into driving the arm incrementally (more like ROS does)
     
    SkeVinci likes this.
  3. WaxyMcRivers

    WaxyMcRivers

    Joined:
    May 9, 2016
    Posts:
    59
    Make sure that you can drive each individual joint through the heuristic function; you want to emulate the same types of inputs that the NN model is sending to the OnActionRecieved -> your arm. For things like this you can create a function that simply oscillates between -1 and 1 and use that value in the heuristic function to drive joints, then control it from the editor using a Boolean.

    If the arm works through heuristic mode, but not in training (through the yaml config), then something else is going on.
     
    SkeVinci likes this.
  4. SkeVinci

    SkeVinci

    Joined:
    May 8, 2022
    Posts:
    6
    Yeah, thanks for both of you quite a lot!!

    I previously use the configurable joint and don't apply parent child relationship to the robot arm, which seems to be very unstable. And now I apply parent child relationship and articulation body instead, which becomes stable!

    Although at first when I still used configurable joint, the robot arm may start moving properly at first after starting training and falling apart after a few seconds, which really confused me.

    Again, thanks for help!
     
  5. MonicaZ

    MonicaZ

    Joined:
    Jan 13, 2024
    Posts:
    4
    Does it need extra scripts along with articulation body?
     
    Last edited: Mar 18, 2024