Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question How JointDriveController.cs work

Discussion in 'ML-Agents' started by henrik9999, Oct 17, 2023.

  1. henrik9999

    henrik9999

    Joined:
    Sep 9, 2022
    Posts:
    3
    Hello, I am making a quadruped very similar to ml-agent's crawler, which I will eventually build in reality.
    I was thinking of using JointDriveController.cs and Configurable joints to control the joints like the crawler and walker do.
    By default the values are very large (see picture), in which unit are they?
    upload_2023-10-17_13-15-47.png
    The idea is to model a Dynamixel Servo https://robosavvy.co.uk/robotis-dynamixel-xl330-m288-t.html with a Stall Torque [N·m] of 0.52 and a speed of 104.0 [rpm] is this possible to change to Joint Drive Settings?

    Thank you in advance
     
  2. zyunlongz

    zyunlongz

    Joined:
    Apr 22, 2024
    Posts:
    4
    Have you figure out How JointDriverController work? Recently I want built a visual crawler in mixed reality, I must change the scale of the crawler otherwise it is too large for mixed reality environment, but when I set the scale to 0.1, The trained crawler is not able to walk.
     
  3. GamerLordMat

    GamerLordMat

    Joined:
    Oct 10, 2019
    Posts:
    186
    you cannot change the size of ML trained objects bc they kind of overfitted. You ahve to specifically train the agent to get as input the scale and randomize it if you want different scales
     
    zyunlongz likes this.
  4. zyunlongz

    zyunlongz

    Joined:
    Apr 22, 2024
    Posts:
    4
    Thank you very much, I'll try
     
  5. henrik9999

    henrik9999

    Joined:
    Sep 9, 2022
    Posts:
    3
    To answer my own question for others who may be wondering the same thing. I found that "Joint Drive Controller" and joint in Unity generally works as a PD controller:

    force = PositionSpring * (target position - position) + PositionDamper * (targetVelocity - velocity)



    This means that:
    Max Joint Spring -> PositionSpring -> P in PD controller
    Joint Dampen -> PositionDamper -> D in PD
    Max Joint Force Limit -> Max force the joint can apply. This is in Nm.

    I never figured out a good way to limit the speed of the servo. However, I could set the “Max angular speed”, either globally or for one object. Edit -> Project Settings -> Physics -> Default Max Angular speed