How to implement differential drive (rotation in place)? #2392
-
IntroHi! I'm a hobbyist programmer, and I'm trying to simulate a differential drive robot using Mujoco. I started from this: https://roboti.us/forum/index.php?resources/rover4we.28/ but the example ties the two back wheels together - I want the two wheels to be used for differential driving. My setupPython 3.8.18 mujoco.version == '3.1.2' My questionI've modified the code so that the two wheels can be driven separately. With simulate rover2.xml, you can set the two controls to 1.0 and the car speeds off into the right. If you set it to +1 and -1, instead of spinning with the same enthusiasm, it simply skids in place and doesn't move much. The original code used a tendon, but it seems used to fix the two wheels together - I want them to rotate in different directions. It works well on physical robots, so I'm not sure why it's not working in simulation. Minimal model and/or code that explain my question
Confirmations
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
I've not played with tendons yet, but it looks to me like your tendon is acting like an axle tying the two rotations together. If you want differential rotation, I would think you just omit it. |
Beta Was this translation helpful? Give feedback.
-
Inspect this model, I hope it will answer all your questions: |
Beta Was this translation helpful? Give feedback.
-
I'm still mystified as to how to get xml to show up in full when I paste, so I can't paste your full modified xml in here. If you could tell me how you do it, I would appreciate it. I deleted your default section
|
Beta Was this translation helpful? Give feedback.
Sure, you can have as many actuators as you want. Some for individual wheels/tracks, some for linear combinations (fixed tendons). Multiple actuators can affect the same joint, forces/torques will be summed.