Giter VIP home page Giter VIP logo

inverted-pendulum-lqr's Introduction

Inverted-pendulum-LQR

Inverted pendulum LQR

Constitution

lqr_control.hにclassを定義. 関数の実装はlqr_control.cppに書いてあります. またmain.cppがmainのファイルになります. 実行方法は以下のProcedureを参考に行ってください. 実行にはEigenのインストールが必要です.

sudo apt-get install libeigen3-dev

Result

LQR

KalmanFilter

青線が真値で赤線が推定値 Estimate

Environment

Ubuntu18.04

Procedure

g++ main.cpp lqr_control.cpp -I /usr/include/eigen3
./a.out

inverted-pendulum-lqr's People

Contributors

ramune6110 avatar

Watchers

 avatar

inverted-pendulum-lqr's Issues

ABC Matrix problem

in lqr_control.cpp, I think the element of B Matrix is (J + m * pow(l, 2.0)) / alpha, -(m * l) / alpha not (J * m * pow(l, 2.0)) / alpha, -(m * l) / alpha.

Also I think C is a 2 X 4 Matrix , not 1X4 Matrix.

what do you think, please check.

    A << 0, 0, 1, 0,
         0, 0, 0, 1,
         0, -(pow(m, 2.0) * pow(l, 2.0) * g) / alpha, 0, 0,
         0, ((M + m) * m * g * l) / alpha, 0, 0;

    B << 0, 0, (J * m * pow(l, 2.0)) / alpha, -(m * l) / alpha;

    C << 1, 0, 0, 0;

    Q << 10, 0, 0, 0,
         0, 10, 0, 0,
         0, 0, 10, 0,
         0, 0, 0, 10;

    R << 1;

    x << 1, 0, 0, 0;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.