Skip to content

Commit

Permalink
[delta][control] clamp iniital variable by bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
sugikazu75 committed Nov 29, 2024
1 parent cc9d2f9 commit 92882b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion robots/delta/src/control/delta_ground_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,9 @@ void RollingController::nonlinearGroundWrenchAllocation()
// joint torque part (use osqp solution)
for(int i = 0; i < n_variables - 2 * motor_num_; i++)
{
opt_x.at(2 * motor_num_ + i) = osqp_solution_(2 * motor_num_ + i);
opt_x.at(2 * motor_num_ + i) = std::clamp(osqp_solution_(2 * motor_num_ + i),
lb.at(2 * motor_num_ + i),
ub.at(2 * motor_num_ + i));
}

for(int i = 0; i < n_variables; i++)
Expand Down

0 comments on commit 92882b7

Please sign in to comment.