@@ -53,14 +53,14 @@ int main() {
53
53
x_ref << 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ;
54
54
55
55
// Input constraints
56
- double u_max = 0.8 ; // for each dimension
57
- double u_min = -0.8 ; // for each dimension
56
+ double u_max = 1.0 ; // for each dimension
57
+ double u_min = -1.0 ; // for each dimension
58
58
59
59
// Cost weighting
60
60
Eigen::MatrixXd Q = Eigen::MatrixXd::Zero (6 ,6 );
61
61
{
62
- Q (0 ,0 ) = 1e+0 ; Q (1 ,1 ) = 1e+0 ; Q (2 ,2 ) = 1e+0 ;
63
- Q (3 ,3 ) = 1e-1 ; Q (4 ,4 ) = 1e-1 ; Q (5 ,5 ) = 1e-1 ;
62
+ Q (0 ,0 ) = 1e+1 ; Q (1 ,1 ) = 1e+1 ; Q (2 ,2 ) = 1e+1 ;
63
+ Q (3 ,3 ) = 1e-0 ; Q (4 ,4 ) = 1e-0 ; Q (5 ,5 ) = 1e-0 ;
64
64
}
65
65
66
66
Eigen::MatrixXd R = Eigen::MatrixXd::Zero (3 ,3 );
@@ -107,6 +107,33 @@ int main() {
107
107
{100.0 ,-75.0 /sqrt3, 0 , 0 , 0 , 0 }
108
108
};
109
109
110
+ // std::vector<std::vector<double>> ics_data = {
111
+ // {25.0/sqrt3, 25.0, 0, 0, 0, 0},
112
+ // {0, 25.0, 0, 0, 0, 0},
113
+ // {-25.0/sqrt3, 25.0, 0, 0, 0, 0},
114
+ // {50.0/sqrt3, 50.0, 0, 0, 0, 0},
115
+ // {0, 50.0, 0, 0, 0, 0},
116
+ // {-50.0/sqrt3, 50.0, 0, 0, 0, 0},
117
+ // {75.0/sqrt3, 75.0, 0, 0, 0, 0},
118
+ // {0, 75.0, 0, 0, 0, 0},
119
+ // {-75.0/sqrt3, 75.0, 0, 0, 0, 0},
120
+ // {100.0/sqrt3, 100.0, 0, 0, 0, 0},
121
+ // {0, 100.0, 0, 0, 0, 0},
122
+ // {-100.0/sqrt3,100.0, 0, 0, 0, 0},
123
+ // {25.0/sqrt3, 75.0, 0, 0, 0, 0},
124
+ // {-25.0/sqrt3, 75.0, 0, 0, 0, 0},
125
+ // {25.0/sqrt3, 100.0, 0, 0, 0, 0},
126
+ // {-25.0/sqrt3, 100.0, 0, 0, 0, 0},
127
+ // {50.0/sqrt3, 75.0, 0, 0, 0, 0},
128
+ // {-50.0/sqrt3, 75.0, 0, 0, 0, 0},
129
+ // {50.0/sqrt3, 100.0, 0, 0, 0, 0},
130
+ // {-50.0/sqrt3, 100.0, 0, 0, 0, 0},
131
+ // {75.0/sqrt3, 75.0, 0, 0, 0, 0},
132
+ // {-75.0/sqrt3, 75.0, 0, 0, 0, 0},
133
+ // {75.0/sqrt3, 100.0, 0, 0, 0, 0},
134
+ // {-75.0/sqrt3, 100.0, 0, 0, 0, 0}
135
+ // };
136
+
110
137
for (auto &data : ics_data) {
111
138
Eigen::VectorXd x0 (6 );
112
139
x0 << data[0 ], data[1 ], data[2 ], data[3 ], data[4 ], data[5 ];
@@ -286,14 +313,17 @@ int main() {
286
313
// axis limit
287
314
plt::xlim (-10 , 110 );
288
315
plt::ylim (-100 , 100 );
316
+
317
+ // plt::xlim(-100, 100);
318
+ // plt::ylim(-10, 110);
289
319
plt::grid (true );
290
320
291
321
// Create results directory
292
322
const std::string plotDirectory = " ../results/simulations" ;
293
323
if (!fs::exists (plotDirectory)) {
294
324
fs::create_directories (plotDirectory);
295
325
}
296
- std::string figPath = plotDirectory + " /hcw_mpc_cddp_trajectories .png" ;
326
+ std::string figPath = plotDirectory + " /hcw_mpc_cddp_xaxis_trajectories .png" ;
297
327
plt::save (figPath);
298
328
// plt::show();
299
329
}
0 commit comments