Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapting the Mujoco model to enable drifting #61

Open
palanc opened this issue Dec 1, 2021 Discussed in #59 · 0 comments
Open

Adapting the Mujoco model to enable drifting #61

palanc opened this issue Dec 1, 2021 Discussed in #59 · 0 comments

Comments

@palanc
Copy link
Member

palanc commented Dec 1, 2021

Discussed in #59

Originally posted by silverjoda November 24, 2021
Dear Mushr team,

I'm currently working with a student on a sim-to-real project for a buggy car and recently came across the
Mujoco model that you have in your project. I had issues trying to make it drift (wheel slip) so I opened a issue on the mujoco
github page, where the authors were kind enough to help me solve my issue so I am here to inform of a subtle problem that exists with the model, and also how to set parameters of the model so that one can do drifts with it.

The issue:
If you lower the wheel friction then the car starts to exhibit strange behavior. This is caused by the following:

  1. The mesh used for the wheels is not well centered and causes wheel bouncing
  2. There is no suspension which leads to uneven forces on the wheels
  3. The contacts are very hard which causes bouncing.

The solution:

  1. Use a correctly scaled and centered ellipsoid as the collision instead of a mesh
  2. I added a very simple spring damper to each wheel
  3. setting the first parameter on solimp to zero makes the contacts soft. This has to be present on both contacting bodies to work apparently.

If anyone is interested, here is the modified models directory that you can just copy paste into the package. I suggest using the mujoco "simulate" binary which you can just run and then click and drop the one_car.xml model into the simulation, press "c" to see contacts and use the sliding bar for actuation.
models.zip

output.mp4

Thanks, T

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant