I am setting up a simulation with some revolute and prismatic joints (fairly simple robot arm), and I was wondering if there is a straightforward way to add friction to the arm's joints?
Something simple like a coefficient of static friction and a coefficient of kinetic friction, and switching between the two based on the joint's velocity.
In the sim I just have gravity as an external force and then a PID controller controlling the joint positions and velocities. The way I see it, I could add friction to the joints by either:
- Hacking together a torque to apply by looking at the gravity and actuation forces at each time step
- Writing a new joint class that inherits from the linear/revolute joint classes and add in some sort of friction
Do either of these seem like the best way to do this? I'm hoping there's an easier way I am missing.
Thanks!