Contact/friction fidelity for contact-rich RL (legged locomotion): policies exploit foot-contact artifacts
https://github.com/user-attachments/assets/75f8657e-ec07-46a2-bc79-7a96723c8c14
## Summary
When using rapier3d, I fail to train a walking policy because it seems that the Contact/friction fidelity is too loose and make the robot able to stand on the tip of his feet.
## AI Summary
## Context
I'm using rapier3d (CPU multibody) as the physics backend for reinforcement learning of a **bipedal walking** policy (velocity tracking, foot‑PD position control, ~50 Hz control, `IntegrationParameters { num_solver_iterations: 8, .. }`). The feet are box colliders contacting a static ground plane.
RL is essentially an *adversarial* stress test of contact fidelity: the policy optimizer finds and exploits **any** inaccuracy in the contact/friction model that yields reward, even when the resulting behavior is physically implausible. I'd like to raise — and get maintainer guidance on — how faithful rapier's default contact/friction handling is for this kind of contact‑rich learning.
## Observations
- Policies readily found gaits that **balance on a foot edge/corner** (sole tilted 50–70° from horizontal) as if it were a stable stance. Physically that's a knife‑edge that should tip immediately.
- Caveat for honesty: I was able to largely suppress this with a reward penalty on sole tilt, so it is *partly* a reward‑design issue. The concern is that the configuration is **mechanically stable enough in‑sim to be exploitable** in the first place.
- Foot–ground contact felt "sporadic" — feet grazing / micro‑skating rather than planting with a stable multi‑point contact patch.
## Questions on fidelity for RL
1. **Friction model** — does rapier use a pyramid/box (two tangent‑axis) Coulomb approximation rather than a true friction cone? If so, the anisotropy (friction differing along vs. between the tangent basis axes) is exactly the kind of artifact an RL policy will exploit. Is a friction‑cone option available/planned?
2. **Flat‑contact stability** — for a box collider resting on a plane, how many persistent contact points are generated, and how stable is the contact manifold step‑to‑step? A reduced or "blinking" manifold would help explain edge‑balancing and grazing contact.
3. **Solver iterations vs. contact accuracy** — how does `num_solver_iterations` trade off against contact/friction accuracy, and is there a recommended value for stiff legged contact?
4. **Soft vs. rigid contact / penetration** — recommended `IntegrationParameters` (ERP, contact stiffness/`contact_natural_frequency`, allowed penetration) for legged RL where a consistent ground‑reaction force matters?
5. **Determinism / batch consistency** — across many parallel envs, are contacts deterministic given identical states (important for reproducible RL rollouts)?
## Ask
Recommended `IntegrationParameters` + collider material settings (friction model, restitution, contact stiffness) for legged‑locomotion RL, plus any **known contact‑fidelity limitations** relative to an LCP / MuJoCo‑style solver. I'm happy to provide a minimal repro (box foot on a plane in the edge‑balance configuration) if useful.
**Environment:** rapier3d 0.32, CPU multibody, macOS.
4 条评论