Skip to content

Commit d48ff16

Browse files
committed
constrain u_virt_0,1 to force acceleration constraints
-> reduces oscillations a lot -> no accelerations violations
1 parent f5bc281 commit d48ff16

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎nav2_mppi_controller/include/nav2_mppi_controller/motion_models.hpp‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ class MotionModel
9797
.cwiseMax(state.wz.col(i - 1) - max_delta_wz)
9898
.cwiseMin(state.wz.col(i - 1) + max_delta_wz);
9999

100+
// constrain u_virt 0 & 1 to make sure accelerations are limited at the first step (state.vx(0) is from feedback)
101+
// also constrain u_virt_1 as this is published as command
102+
if (i <= 2)
103+
{
104+
state.cvx.col(i - 1) = state.vx.col(i);
105+
state.cwz.col(i - 1) = state.wz.col(i);
106+
}
107+
100108
if (is_holo) {
101109
auto lower_bound_vy = (state.vy.col(i - 1) >
102110
0).select(state.vy.col(i - 1) + min_delta_vy,

0 commit comments

Comments
 (0)