Skip to content

kvkpraneeth/LQR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linear Quadratic Regulator

About Repo:

This repo provides a C++ Library for implementation of LQR.

How to use this Repo:

This repo was made with ROS2 in mind, so colcon build tool is required and ROS2 standard workspace structure should be used while building the package.

Validity of the code:

The code and math validity can be confirmed by the test examples implemented.

Test 1 : LQR Problem from Christopher lum's video; Spring Mass State Regulation Problem:

Solution

Test 2 : Joint Control using LQR based on Error Regulation:

This solution was displayed in CoppeliaSim. In order to check that, you need to add Float32MultiArray message to the meta of the ros2 package. For more information: A good starting point

LQR as the name suggests is a regulator, maintains a value or state while trying to minimize a quadratic cost function that is based upon the effort it can apply on the actuators as well as the error importance of the state (R and Q respectively).

For reaching a reference state with LQR, we have to regulate the error to a 0. Which implies that instead of considering the state vector to be system state, the state vector should be the error.

Test 2 : Video

lqrtest.mp4

About

Linear Quadratic Regulator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published