Skip to content

Adding another solution - #4

Open
hoonyyhoon wants to merge 2 commits into
masterfrom
jh
Open

hoonyyhoon wants to merge 2 commits into
masterfrom
jh

Conversation

@hoonyyhoon

@hoonyyhoon hoonyyhoon commented Oct 15, 2020 •

Copy link
Copy Markdown
Member

@KyuhwanYeon

빌드를 여러개해야해서 헷갈렸네요ㅜ

저는 coefficient를 받아서 처리하는 방식으로 구현해봤습니다.

  1. acado_code_generator 빌드
cd acado_code_generator/build
make
  1. code generation 실행
    ./mpc

  2. simple_mpc_export를 acado_mpc_export로 복사

mv simple_mpc_export/* ../../acado_mpc_export/
  1. acado_mpc_export 빌드
cd ../../acado_mpc_export
make
  1. mpc빌드
cd ../
cd build
make

파라미터 튜닝
src/acado.cpp 내 init_weight 함수 변수

//DifferentialState delta;
DifferentialState phi;

OnlineData coeff0, coeff1, coeff2, coeff3;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polynomial coefficient 입력

//
// Weighting matrices and reference functions (acadoVariables.y)
//
auto y_dev = coeff0 + coeff1 * x + coeff2 * x * x + coeff3 * x * x * x;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CTE

// Weighting matrices and reference functions (acadoVariables.y)
//
auto y_dev = coeff0 + coeff1 * x + coeff2 * x * x + coeff3 * x * x * x;
auto angle = atan(coeff1 + 2*coeff2*x + 3*coeff3*x*x);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heading Error

rfN << x << y << v << phi;
rf << y_dev - y;
rf << angle - phi;
rf << v - 60.0;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

원본 코드의 목표 속력 60

mpc.set(DISCRETIZATION_TYPE, MULTIPLE_SHOOTING);
//mpc.set(INTEGRATOR_TYPE, INT_RK4);
mpc.set(INTEGRATOR_TYPE, INT_IRK_RIIA3);
mpc.set(NUM_INTEGRATOR_STEPS, N * Ni);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ni?

@KyuhwanYeon

Copy link
Copy Markdown
Member

build folder 날려주세요~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants