@@ -44,9 +44,9 @@ struct CDDPOptions {
44
44
45
45
// Line search method
46
46
int max_line_search_iterations = 11 ; // Maximum iterations for line search
47
- double backtracking_coeff = 1.0 ; // Maximum step size for line search backtracking
48
- double backtracking_min = 0.5 ; // Coefficient for line search backtracking
49
- double backtracking_factor = std::pow( 10 , (- 3.0 / 10.0 )) ; // Factor for line search backtracking
47
+ double backtracking_coeff = 1.0 ; // Coefficient for line search backtracking
48
+ double backtracking_min = 1e-7 ; // Minimum step size for line search
49
+ double backtracking_factor = 0.5 ; // Factor for line search backtracking
50
50
double minimum_reduction_ratio = 1e-6 ; // Minimum reduction for line search
51
51
52
52
// interior-point method
@@ -121,6 +121,7 @@ struct ForwardPassResult {
121
121
std::vector<Eigen::VectorXd> control_sequence;
122
122
std::map<std::string, std::vector<Eigen::VectorXd>> dual_sequence;
123
123
std::map<std::string, std::vector<Eigen::VectorXd>> slack_sequence;
124
+ std::map<std::string, std::vector<Eigen::VectorXd>> constraint_sequence;
124
125
double cost;
125
126
double lagrangian;
126
127
double alpha = 1.0 ;
@@ -129,10 +130,17 @@ struct ForwardPassResult {
129
130
};
130
131
131
132
struct FilterPoint {
132
- double cost ;
133
+ double log_cost ;
133
134
double violation;
135
+
136
+ // Default constructor
137
+ FilterPoint () : log_cost(0.0 ), violation(0.0 ) {}
138
+
139
+ // Constructor with parameters
140
+ FilterPoint (double lc, double v) : log_cost(lc), violation(v) {}
141
+
134
142
bool dominates (const FilterPoint& other) const {
135
- return cost <= other.cost && violation <= other.violation ;
143
+ return log_cost <= other.log_cost && violation <= other.violation ;
136
144
}
137
145
};
138
146
@@ -304,6 +312,9 @@ class CDDP {
304
312
CDDPSolution solveFeasibleIPDDP ();
305
313
ForwardPassResult solveFeasibleIPDDPForwardPass (double alpha);
306
314
bool solveFeasibleIPDDPBackwardPass ();
315
+ void resetIPDDPFilter ();
316
+ void initialIPDDPRollout ();
317
+ void resetIPDDPRegularization ();
307
318
308
319
// Helper methods
309
320
double computeConstraintViolation (const std::vector<Eigen::VectorXd>& X, const std::vector<Eigen::VectorXd>& U) const ;
@@ -343,6 +354,7 @@ class CDDP {
343
354
// Intermediate trajectories
344
355
std::vector<Eigen::VectorXd> X_; // State trajectory
345
356
std::vector<Eigen::VectorXd> U_; // Control trajectory
357
+ std::map<std::string, std::vector<Eigen::VectorXd>> G_; // Constraint trajectory
346
358
std::map<std::string, std::vector<Eigen::VectorXd>> Y_; // Dual trajectory
347
359
std::map<std::string, std::vector<Eigen::VectorXd>> S_; // Slack trajectory
348
360
@@ -359,6 +371,8 @@ class CDDP {
359
371
360
372
// Log-barrier
361
373
double mu_; // Barrier coefficient
374
+ std::vector<FilterPoint> filter_; // [logcost, error measure
375
+ int ipddp_regularization_counter_ = 0 ; // Regularization counter for IPDDP
362
376
double constraint_violation_; // Current constraint violation measure
363
377
double gamma_; // Small value for filter acceptance
364
378
0 commit comments