Skip to content

feat: add PD and PID controller implementations#804

Merged
sebcrozet merged 12 commits intomasterfrom
pid-controller
Mar 5, 2025
Merged

feat: add PD and PID controller implementations#804
sebcrozet merged 12 commits intomasterfrom
pid-controller

Conversation

@sebcrozet
Copy link
Copy Markdown
Member

Currently, Rapier implements a character controller based on kinematic rigid bodies and shape queries. A second common paradigm for character controllers are velocity-based control of dynamic rigid-bodies. This as many advantages over kinematic character controller like the natural interaction with other dynamic bodies and fact it doesn’t need any scene queries (ray-cast/shape-cast) to operate. However, it provides slightly less control for non-physical behaviors than what we can get from kinematic character controllers.

This PR introduces a PdController and a PidController implementing the well-known concept of Proportional-Integral-Derivative control. This tool can be used to facilitate the implementation of character controllers based on dynamic rigid-bodies by calculating desired velocity changes based on the difference between a desired rigid-body pose and the current one.

The testbed character controller examples has been updated to let the user pick between kinematic control and dynamic control.

PID.control.mov

@sebcrozet sebcrozet merged commit 108a2a1 into master Mar 5, 2025
@sebcrozet sebcrozet deleted the pid-controller branch March 5, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant