Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question How to prevent a wheeled robot to slip in slope when not actuated ?

Discussion in 'Robotics' started by td05, Feb 28, 2022.

  1. td05

    td05

    Joined:
    Nov 23, 2021
    Posts:
    2
    Hi everyone,

    First of all thanks for all the work achieved with the Unity robotics Hub.

    My team is currently working on the simulation of a 4WS agricultural robot and we are working on making the physics as realistic as possible.

    We are testing the robot on different terrain shapes and we realized that when the robot is located on a slope and is not actuated it slips down the slope. The ideal behaviour is that the robot stands still in the slope if no command is given.
    We tried to use physical material with high friction on the terrain and on the wheels and we also tried to apply an opposite torque computed from the angular velocity of the wheels using the AddTorque API. None of these solutions worked so far.

    The wheels are articulation bodies with revolute joints and a mesh collider generated from a cylinder. The robot is also pretty heavy (almost 5 tons) therefore we had to use a really high damping parameter for the xDrive (10k). Stiffness is set to 0.

    Here a screenshot of the configurarion
    upload_2022-2-28_19-23-56.png

    Has anyone ever encountered this problem and knows how to solve it?

    Thanks in advance !
     
  2. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    Hi! Wanted to ask a few clarifying questions. Is the slip being wheels turns a little bit every frame, or is it that the wheels don't turn at all but simply slip slowly down the slope?

    If it's the slipping case, I believe the quickest way to fix that up is to add some scripting to your robot controller where once it knows the robot is "asleep" (=not moving, no input is being applied, etc), toggle "immovable" on the robot root.

    Another hack could be, again to detect when we need to sleep and then use a FixedJoint to stop the slippage. A joint needs a Rigidbody -- fine to add a kinematic Rigidbody somewhere at world origin, don't add any colliders. Add a FixedJoint to it. Set the connectedArticulationBody property to the root ArticulationBody of your robot. That should work equally as well.

    ----

    A slower path might be to check maybe the simulation frequency is not enough for a robot this heavy. Bump up your simulation frequency a little. Increase the solver iteration count, solver velocity iteration count. Try other friction modes (=directional friction instead of patch). I assume you're already using TGS?

    anthony.
     
  3. td05

    td05

    Joined:
    Nov 23, 2021
    Posts:
    2
    Hi yant !

    First of all thank you very much for your attention to my problem.

    Currently it seems that the wheels both turn a little bit every frame and slip slowly. In the last simulation I ran, 2 wheels where slipping and the others were rolling.

    I will try your suggestions and then give a feedback. And yes, I'm currently using TGS.

    I also saw that there is a wheel collider available in Unity with parameters that might help to solve the problem. I tried to add it to the robot but it needs rigidbodies and I didn't have any success so far. Do you think it could be worth spending times to make it works or am I heading in the wrong direction ?

    Thanks again !

    Thomas