Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
CHH3213 committed Nov 26, 2022
1 parent dc9fafc commit 1f5ee6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion PathTracking/LQR/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#include "LQRControl.h"
#include "../utils/MyReferencePath.h"
#include "../../matplotlibcpp.h"
#include "../utils/KinematicModel.h"
#include "../utils/NormalizeAngle.h"
#include "../../matplotlibcpp.h"
namespace plt = matplotlibcpp;

int main(){
Expand Down
21 changes: 9 additions & 12 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#include <Eigen/Dense> // Eigen头文件,<Eigen/Dense>包含Eigen库里面所有的函数和类
#include<vector>
#include<cmath>
#include "matplotlibcpp.h"
namespace plt = matplotlibcpp;
using namespace std;
using namespace Eigen;

int main()
{
//Eigen::MatrixXd m(2,2); // MatrixXd 表示的是动态数组,初始化的时候指定数组的行数和列数
Expand All @@ -16,16 +17,12 @@ int main()
//b<<1,1,
//1,1;
//Eigen::MatrixXd a(1,2);
VectorXd v(6);
v<<1,2,3,4,5,6;
MatrixXd m(2,6);
m<<1,2,3,4,5,6,7,8,9,10,11,12;
cout<<m(1)<<endl;
MatrixXd xc(6,1);
xc<<1,2,3,4,5,6;
xc<<1,5,4653,4,5,6;
MatrixXd res = m*xc;
cout<<res(0,0)<<endl;

VectorXd v(3);
v<<1,2,3;
double y = 1;
double x = v(1)-y;
cout<<x<<endl;
plt::plot(v(0),v(1),"blue");
plt::show();
//cout<<v<<endl;
}

0 comments on commit 1f5ee6d

Please sign in to comment.