Skip to content

Commit 701cd4e

Browse files
Fix compilation error on constraints (#35)
1 parent 84fa37c commit 701cd4e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/cddp_core/cddp_core.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,13 @@ bool CDDP::solveBackwardPass() {
424424

425425
// TODO: Implement active set method
426426
for (int j = 0; j < control_dim; j++) {
427-
if (u(j) <= control_box_constraint.getLowerBound()(j) + active_set_tol) {
427+
if (u(j) <= control_box_constraint->getLowerBound()(j) + active_set_tol) {
428428
Eigen::VectorXd e = Eigen::VectorXd::Zero(control_dim);
429429
e(j) = 1.0;
430430
C.row(active_constraint_index) = -e; // Note the negative sign
431431
D.row(active_constraint_index) = Eigen::VectorXd::Zero(state_dim);
432432
active_constraint_index += 1;
433-
} else if (u(j) >= control_box_constraint.getUpperBound()(j) - active_set_tol) {
433+
} else if (u(j) >= control_box_constraint->getUpperBound()(j) - active_set_tol) {
434434
Eigen::VectorXd e = Eigen::VectorXd::Zero(control_dim);
435435
e(j) = 1.0; // No negative here
436436
C.row(active_constraint_index) = e;
@@ -573,8 +573,8 @@ bool CDDP::solveForwardPass() {
573573
osqp_solver_.SetObjectiveVector(q);
574574

575575
// Lower and upper bounds
576-
Eigen::VectorXd lb = 1.0 * (control_box_constraint.getLowerBound() - u);
577-
Eigen::VectorXd ub = 1.0 * (control_box_constraint.getUpperBound() - u);
576+
Eigen::VectorXd lb = 1.0 * (control_box_constraint->getLowerBound() - u);
577+
Eigen::VectorXd ub = 1.0 * (control_box_constraint->getUpperBound() - u);
578578
osqp_solver_.SetBounds(lb, ub);
579579

580580
// Solve the QP problem TODO: Use SDQP instead of OSQP
@@ -1128,8 +1128,8 @@ bool CDDP::solveCLDDPBackwardPass() {
11281128
osqp_solver_.SetObjectiveVector(q);
11291129

11301130
// Lower and upper bounds
1131-
Eigen::VectorXd lb = 1.0 * (control_box_constraint.getLowerBound() - u);
1132-
Eigen::VectorXd ub = 1.0 * (control_box_constraint.getUpperBound() - u);
1131+
Eigen::VectorXd lb = 1.0 * (control_box_constraint->getLowerBound() - u);
1132+
Eigen::VectorXd ub = 1.0 * (control_box_constraint->getUpperBound() - u);
11331133
osqp_solver_.SetBounds(lb, ub);
11341134

11351135
// Solve the QP problem TODO: Use SDQP instead of OSQP

0 commit comments

Comments
 (0)