LQRController
Constructor for the common holonomic robot control use case.
This constructor assumes a kinematic acceleration model where the state error x is [xError, yError, headingError, vxError, vyError, omegaError] and the control input u is the desired robot acceleration [ax, ay, alpha].
The system dynamics are approximated as: dx_dot = vx dy_dot = vy dtheta_dot = omega dvx_dot = ax dvy_dot = ay domega_dot = alpha
Parameters
The maximum error in the x-position.
The maximum error in the y-position.
The maximum error in the heading.
The maximum error in the x-velocity.
The maximum error in the y-velocity.
The maximum error in the angular velocity.
The maximum linear acceleration in the x-direction.
The maximum using linear acceleration in the y-direction.
The maximum angular acceleration.
The discrete time step (control loop period) in seconds.
General-purpose constructor for any linear time-invariant (LTI) system.
This constructor is for advanced users who have a full state-space model of their system in the form ẋ = Ax + Bu. It computes the optimal gain matrix K by iteratively solving the discrete-time Algebraic Riccati Equation (ARE) until convergence.
Parameters
The state matrix.
The input matrix.
The state cost matrix.
The control cost matrix.
The time step for the discrete-time model (your loop time)