Skip to content

Commit e2cf767

Browse files
committed
indent style control
1 parent e586e45 commit e2cf767

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

‎src/lqr_speed_steer_control.cpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ Vec_f calc_speed_profile(Vec_f rx, Vec_f ry, Vec_f ryaw, float target_speed){
5353
}
5454

5555
for(int k=0; k< 40; k++){
56-
*(speed_profile.end()-k) = target_speed / (50 - k);
57-
if (*(speed_profile.end()-k) <= 1.0 / 3.6){
58-
*(speed_profile.end()-k) = 1.0 / 3.6;
59-
}
56+
*(speed_profile.end()-k) = target_speed / (50 - k);
57+
if (*(speed_profile.end()-k) <= 1.0 / 3.6){
58+
*(speed_profile.end()-k) = 1.0 / 3.6;
59+
}
6060
}
6161
return speed_profile;
6262
};
@@ -100,9 +100,9 @@ Matrix5f solve_DARE(Matrix5f A, Matrix52f B, Matrix5f Q, Eigen::Matrix2f R){
100100
};
101101

102102
Matrix25f dlqr(Matrix5f A, Matrix52f B, Matrix5f Q, Eigen::Matrix2f R){
103-
Matrix5f X = solve_DARE(A, B ,Q, R);
104-
Matrix25f K = (B.transpose()*X*B + R).inverse() * (B.transpose()*X*A);
105-
return K;
103+
Matrix5f X = solve_DARE(A, B ,Q, R);
104+
Matrix25f K = (B.transpose()*X*B + R).inverse() * (B.transpose()*X*A);
105+
return K;
106106
};
107107

108108
Vec_f lqr_steering_control(State state, Vec_f cx, Vec_f cy, Vec_f cyaw, Vec_f ck, Vec_f sp, float& pe, float& pth_e){

‎src/model_predictive_control.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ Vec_f calc_speed_profile(Vec_f rx, Vec_f ry, Vec_f ryaw, float target_speed){
9090
float move_direction = std::atan2(dy, dx);
9191

9292
if (dx != 0.0 && dy != 0.0){
93-
float dangle = std::abs(YAW_P2P(move_direction - ryaw[i]));
94-
if (dangle >= M_PI/4.0) direction = -1.0;
95-
else direction = 1.0;
93+
float dangle = std::abs(YAW_P2P(move_direction - ryaw[i]));
94+
if (dangle >= M_PI/4.0) direction = -1.0;
95+
else direction = 1.0;
9696
}
9797

9898
if (direction != 1.0) speed_profile[i] = -1 * target_speed;
@@ -366,7 +366,7 @@ void mpc_simulation(Vec_f cx, Vec_f cy, Vec_f cyaw, Vec_f ck, Vec_f speed_profil
366366
Vec_f x_h;
367367
Vec_f y_h;
368368

369-
M_XREF xref;
369+
M_XREF xref;
370370

371371
while (MAX_TIME >= iter_count){
372372
calc_ref_trajectory(state, cx, cy, cyaw, ck, speed_profile, 1.0, target_ind, xref);

0 commit comments

Comments
 (0)