Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Directional Friction and Skid Steer

Discussion in 'Robotics' started by MetroRobots, Feb 11, 2022.

  1. MetroRobots

    MetroRobots

    Joined:
    Jan 11, 2022
    Posts:
    8
    I'm working on a skid steer robot. It moves forward and backward just fine, but attempting to get it to turn is tricky. It won't turn unless you turn the velocities up very high.

    Gazebo has methods for simulating different friction constants for different directions. Could the existing properties in Physic Material for Dynamic/Static friction be used? I found this reference to directional friction maybe being removed from Unity.

    Is there another way to get the wheels of my robot to turn properly?
     
  2. MetroRobots

    MetroRobots

    Joined:
    Jan 11, 2022
    Posts:
    8
  3. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    575
    Unfortunately, the anisotropic friction option was removed in PhysX 3.x many years ago, and there isn't something that comes as a 100% substitute yet.

    One of the approaches that I saw working in the user base would be a custom script that applies forces or torques to steer depending on the current linear velocity and the steer angle. Quite easy to tweak to get the expected behaviour compared to what we used to have as anisotropic friction.

    Hope that helps.
     
  4. MetroRobots

    MetroRobots

    Joined:
    Jan 11, 2022
    Posts:
    8
    Can you point me to the custom script from the user base?
     
  5. mig_seixas

    mig_seixas

    Joined:
    Jul 30, 2021
    Posts:
    2
    I'm working in a project using a diff/skid robot on unity, I make it working using a script like diff controller from ROS. I encountered the same problem, the robot only go to front and back, no turn, I figured out we need to configure your rigidbody.inertiaTensor.

    Code (CSharp):
    1. public Rigidbody rb;
    2.  
    3. void Start(){
    4.             rb.inertiaTensor = tensor; //Vector3
    5.             rb.centerOfMass=centerOfMass.transform.localPosition;
    6. }
     
  6. ActiveSim

    ActiveSim

    Joined:
    May 10, 2019
    Posts:
    58
    Rebuilding instead of importing is a good options. Setting the inertia to a fix value is a good option as well.